@nyaomaru/divider 1.9.2 → 1.9.4

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
@@ -262,7 +262,7 @@ function applyDividerOptions(result, options) {
262
262
  output = output.flat();
263
263
  }
264
264
  if (!isNoneMode(options.exclude)) {
265
- const exclude = options.exclude ?? "none";
265
+ const exclude = options.exclude ?? DividerExcludeModes.NONE;
266
266
  let shouldKeep = () => true;
267
267
  if (exclude in excludePredicateMap) {
268
268
  shouldKeep = excludePredicateMap[exclude];
@@ -376,7 +376,7 @@ function dividerNumberString(input, options) {
376
376
 
377
377
  // src/utils/quoted.ts
378
378
  function dividePreserve(input, separator) {
379
- if (input === "") return [""];
379
+ if (isEmptyString(input)) return [""];
380
380
  const divided = divider(input, separator);
381
381
  return divided.join(separator) === input ? divided : input.split(separator);
382
382
  }
@@ -421,7 +421,7 @@ function quotedDivide(line, {
421
421
  trim = false,
422
422
  lenient = true
423
423
  } = {}) {
424
- if (line === "") return [""];
424
+ if (isEmptyString(line)) return [""];
425
425
  const pieces = dividePreserve(line, delimiter);
426
426
  const fields = [];
427
427
  let currentFieldBuffer = "";
package/dist/index.js CHANGED
@@ -229,7 +229,7 @@ function applyDividerOptions(result, options) {
229
229
  output = output.flat();
230
230
  }
231
231
  if (!isNoneMode(options.exclude)) {
232
- const exclude = options.exclude ?? "none";
232
+ const exclude = options.exclude ?? DividerExcludeModes.NONE;
233
233
  let shouldKeep = () => true;
234
234
  if (exclude in excludePredicateMap) {
235
235
  shouldKeep = excludePredicateMap[exclude];
@@ -343,7 +343,7 @@ function dividerNumberString(input, options) {
343
343
 
344
344
  // src/utils/quoted.ts
345
345
  function dividePreserve(input, separator) {
346
- if (input === "") return [""];
346
+ if (isEmptyString(input)) return [""];
347
347
  const divided = divider(input, separator);
348
348
  return divided.join(separator) === input ? divided : input.split(separator);
349
349
  }
@@ -388,7 +388,7 @@ function quotedDivide(line, {
388
388
  trim = false,
389
389
  lenient = true
390
390
  } = {}) {
391
- if (line === "") return [""];
391
+ if (isEmptyString(line)) return [""];
392
392
  const pieces = dividePreserve(line, delimiter);
393
393
  const fields = [];
394
394
  let currentFieldBuffer = "";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nyaomaru/divider",
3
3
  "type": "module",
4
- "version": "1.9.2",
4
+ "version": "1.9.4",
5
5
  "description": "To divide string or string[] with a given separator",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",