Package Exports
- string-split-by
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (string-split-by) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
string-split-by

Split string by a separator with respect to brackets, quotes and escape markers. Optimized version of string-split.
Usage
var split = require('string-split-by')
split('a."b.c".d.{.e.f.g.}.h', '.')
// ['a', '"b.c"', 'd', '{.e.f.g.}', 'h']
split('a."b.c".d.{.e.f.g.}.h', '.', {ignore: '""'})
// ['a', '"b.c"', 'd', '{', 'e', 'f', 'g', '}', 'h']
API
parts = splitBy(string, separator, options?)
Return array with parts split from string by a separator, which can be whether String or RegExp. Options can define:
Option | Default | Meaning |
---|---|---|
ignore |
['"', "'", '`', '“”', '«»', '[]', '()', '{}'] |
Avoid splitting content enclosed in the character pairs. Can be a string or a list of strings. |
escape |
true |
Avoid splitting at the escaped separator, eg. \. won't be separated by '.' separator. |
Related
License
© 2018 Dmitry Yv. MIT License