Split an input with quotes.
hello "world" 'it works' “also supports iOS quotes”
-> [ 'hello', 'world', 'it works', 'also supports iOS quotes' ]
$ npm install @ayame/quotes
TypeScript typings included.
const quotes = require("@ayame/quotes");
quotes.parse(input, seperator);
Use it instead of your string.split logic.
Seperator defaults to a space " "
but any single character string can be used to split on.
E.g: quotes.parse("hello, world", ",")
-> [ 'hello', 'world' ]
- Added a seperator option to split by different characters other than space.
- Added TypeScript typings.
- Initial release.