break.js 253 B

1234567891011121314151617
  1. 'use strict';
  2. module.exports = locate;
  3. function locate(value, fromIndex) {
  4. var index = value.indexOf('\n', fromIndex);
  5. while (index > fromIndex) {
  6. if (value.charAt(index - 1) !== ' ') {
  7. break;
  8. }
  9. index--;
  10. }
  11. return index;
  12. }