@nyaomaru/divider 2.0.14 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -504,7 +504,8 @@ function countUnescaped(text, quote) {
504
504
  // src/utils/divide-preserve.ts
505
505
  function dividePreserve(input, separator) {
506
506
  if (isEmptyString(input)) return [""];
507
- return divider(input, separator, { preserveEmpty: true });
507
+ const regex = getRegex([separator]);
508
+ return regex == null ? [input] : input.split(regex);
508
509
  }
509
510
 
510
511
  // src/utils/strip-outer-quotes.ts
package/dist/index.js CHANGED
@@ -470,7 +470,8 @@ function countUnescaped(text, quote) {
470
470
  // src/utils/divide-preserve.ts
471
471
  function dividePreserve(input, separator) {
472
472
  if (isEmptyString(input)) return [""];
473
- return divider(input, separator, { preserveEmpty: true });
473
+ const regex = getRegex([separator]);
474
+ return regex == null ? [input] : input.split(regex);
474
475
  }
475
476
 
476
477
  // src/utils/strip-outer-quotes.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nyaomaru/divider",
3
3
  "type": "module",
4
- "version": "2.0.14",
4
+ "version": "2.0.15",
5
5
  "description": "To divide string or string[] with a given separator",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",