summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js')
-rw-r--r--tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js
new file mode 100644
index 0000000000..b5550e1007
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/remark-parse/lib/locate/break.js
@@ -0,0 +1,25 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:break
+ * @fileoverview Locate a break.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ var index = value.indexOf('\n', fromIndex);
+
+ while (index > fromIndex) {
+ if (value.charAt(index - 1) !== ' ') {
+ break;
+ }
+
+ index--;
+ }
+
+ return index;
+}