diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/split-string/README.md | |
parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) |
upgrade dependencies
Diffstat (limited to 'node_modules/split-string/README.md')
-rw-r--r-- | node_modules/split-string/README.md | 146 |
1 files changed, 106 insertions, 40 deletions
diff --git a/node_modules/split-string/README.md b/node_modules/split-string/README.md index d687353c3..d622e44d9 100644 --- a/node_modules/split-string/README.md +++ b/node_modules/split-string/README.md @@ -1,8 +1,19 @@ -# split-string [](https://www.npmjs.com/package/split-string) [](https://npmjs.org/package/split-string) [](https://npmjs.org/package/split-string) [](https://travis-ci.org/jonschlinkert/split-string) +# split-string [](https://www.npmjs.com/package/split-string) [](https://npmjs.org/package/split-string) [](https://npmjs.org/package/split-string) [](https://travis-ci.org/jonschlinkert/split-string) > Split a string on a character except when the character is escaped. +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save split-string +``` + <!-- section: Why use this? --> + <details> <summary><strong>Why use this?</strong></summary> @@ -44,20 +55,6 @@ See the [options](#options) to learn how to choose the separator or retain quote </details> -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save split-string -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add split-string -``` - ## Usage ```js @@ -75,11 +72,61 @@ split('a."b.c.d".e'); //=> ['a', 'b.c.d', 'e'] ``` +**Brackets** + +Also respects brackets [unless disabled](#optionsbrackets): + +```js +split('a (b c d) e', ' '); +//=> ['a', '(b c d)', 'e'] +``` + ## Options +### options.brackets + +**Type**: `object|boolean` + +**Default**: `undefined` + +**Description** + +If enabled, split-string will not split inside brackets. The following brackets types are supported when `options.brackets` is `true`, + +```js +{ + '<': '>', + '(': ')', + '[': ']', + '{': '}' +} +``` + +Or, if object of brackets must be passed, each property on the object must be a bracket type, where the property key is the opening delimiter and property value is the closing delimiter. + +**Examples** + +```js +// no bracket support by default +split('a.{b.c}'); +//=> [ 'a', '{b', 'c}' ] + +// support all basic bracket types: "<>{}[]()" +split('a.{b.c}', {brackets: true}); +//=> [ 'a', '{b.c}' ] + +// also supports nested brackets +split('a.{b.{c.d}.e}.f', {brackets: true}); +//=> [ 'a', '{b.{c.d}.e}', 'f' ] + +// support only the specified brackets +split('[a.b].(c.d)', {brackets: {'[': ']'}}); +//=> [ '[a.b]', '(c', 'd)' ] +``` + ### options.sep -**Type**: `String` +**Type**: `string` **Default**: `.` @@ -98,7 +145,7 @@ split('a.b,c', ','); ### options.keepEscaping -**Type**: `Boolean` +**Type**: `boolean` **Default**: `undefined` @@ -116,7 +163,7 @@ split('a.b.\\c', {keepEscaping: true}); ### options.keepQuotes -**Type**: `Boolean` +**Type**: `boolean` **Default**: `undefined` @@ -137,7 +184,7 @@ split('a.\'b.c.d\'.e', {keepQuotes: true}); ### options.keepDoubleQuotes -**Type**: `Boolean` +**Type**: `boolean` **Default**: `undefined` @@ -155,7 +202,7 @@ split('a."b.c.d".e', {keepDoubleQuotes: true}); ### options.keepSingleQuotes -**Type**: `Boolean` +**Type**: `boolean` **Default**: `undefined` @@ -173,7 +220,7 @@ split('a.\'b.c.d\'.e', {keepSingleQuotes: true}); ## Customizer -**Type**: `Function` +**Type**: `function` **Default**: `undefined` @@ -200,27 +247,36 @@ The `tok` object has the following properties: * `tok.str` (string) the entire string * `tok.arr` (array) the result array -## About +## Release history -### Related projects +### v3.0.0 - 2017-06-17 -* [deromanize](https://www.npmjs.com/package/deromanize): Convert roman numerals to arabic numbers (useful for books, outlines, documentation, slide decks, etc) | [homepage](https://github.com/jonschlinkert/deromanize "Convert roman numerals to arabic numbers (useful for books, outlines, documentation, slide decks, etc)") -* [randomatic](https://www.npmjs.com/package/randomatic): Generate randomized strings of a specified length, fast. Only the length is necessary, but you… [more](https://github.com/jonschlinkert/randomatic) | [homepage](https://github.com/jonschlinkert/randomatic "Generate randomized strings of a specified length, fast. Only the length is necessary, but you can optionally generate patterns using any combination of numeric, alpha-numeric, alphabetical, special or custom characters.") -* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") -* [romanize](https://www.npmjs.com/package/romanize): Convert arabic numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc) | [homepage](https://github.com/jonschlinkert/romanize "Convert arabic numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc)") +**Added** + +* adds support for brackets -### Contributing +## About + +<details> +<summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). -### Contributors +</details> -| **Commits** | **Contributor** | -| --- | --- | -| 12 | [jonschlinkert](https://github.com/jonschlinkert) | -| 9 | [doowb](https://github.com/doowb) | +<details> +<summary><strong>Running Tests</strong></summary> -### Building docs +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +</details> + +<details> +<summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ @@ -230,13 +286,23 @@ To generate the readme, run the following command: $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -### Running tests +</details> -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: +### Related projects -```sh -$ npm install && npm test -``` +You might also be interested in these projects: + +* [deromanize](https://www.npmjs.com/package/deromanize): Convert roman numerals to arabic numbers (useful for books, outlines, documentation, slide decks, etc) | [homepage](https://github.com/jonschlinkert/deromanize "Convert roman numerals to arabic numbers (useful for books, outlines, documentation, slide decks, etc)") +* [randomatic](https://www.npmjs.com/package/randomatic): Generate randomized strings of a specified length using simple character sequences. The original generate-password. | [homepage](https://github.com/jonschlinkert/randomatic "Generate randomized strings of a specified length using simple character sequences. The original generate-password.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") +* [romanize](https://www.npmjs.com/package/romanize): Convert numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc) | [homepage](https://github.com/jonschlinkert/romanize "Convert numbers to roman numerals (useful for books, outlines, documentation, slide decks, etc)") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 28 | [jonschlinkert](https://github.com/jonschlinkert) | +| 9 | [doowb](https://github.com/doowb) | ### Author @@ -252,4 +318,4 @@ Released under the [MIT License](LICENSE). *** -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 27, 2017._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 19, 2017._
\ No newline at end of file |