@nyaomaru/divider 1.9.21 → 1.9.22
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 +5 -6
- package/dist/index.js +5 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,11 +103,10 @@ function isValidInput(value) {
|
|
|
103
103
|
function isStringOrNumber(value) {
|
|
104
104
|
return isString(value) || isNumber(value);
|
|
105
105
|
}
|
|
106
|
-
function isStringArray(value) {
|
|
107
|
-
return Array.isArray(value) && value.every(isString);
|
|
108
|
-
}
|
|
109
106
|
function isNestedStringArray(value) {
|
|
110
|
-
|
|
107
|
+
if (!Array.isArray(value) || value.length === 0) return false;
|
|
108
|
+
const firstRow = value[0];
|
|
109
|
+
return Array.isArray(firstRow) && firstRow.every((item) => isString(item));
|
|
111
110
|
}
|
|
112
111
|
function isWhitespaceOnly(value) {
|
|
113
112
|
return value.trim() === "";
|
|
@@ -301,8 +300,8 @@ var applyTrimOption = (output, options, shouldPreserveEmpty) => {
|
|
|
301
300
|
};
|
|
302
301
|
var applyFlattenOption = (output, options) => options.flatten ? output.flat() : output;
|
|
303
302
|
var applyExcludeOption = (output, options, shouldPreserveEmpty) => {
|
|
304
|
-
if (isNoneMode(options.exclude)) return output;
|
|
305
|
-
const exclude = options.exclude
|
|
303
|
+
if (options.exclude == null || isNoneMode(options.exclude)) return output;
|
|
304
|
+
const exclude = options.exclude;
|
|
306
305
|
let shouldKeep = () => true;
|
|
307
306
|
if (exclude in excludePredicateMap) {
|
|
308
307
|
shouldKeep = excludePredicateMap[exclude];
|
package/dist/index.js
CHANGED
|
@@ -69,11 +69,10 @@ function isValidInput(value) {
|
|
|
69
69
|
function isStringOrNumber(value) {
|
|
70
70
|
return isString(value) || isNumber(value);
|
|
71
71
|
}
|
|
72
|
-
function isStringArray(value) {
|
|
73
|
-
return Array.isArray(value) && value.every(isString);
|
|
74
|
-
}
|
|
75
72
|
function isNestedStringArray(value) {
|
|
76
|
-
|
|
73
|
+
if (!Array.isArray(value) || value.length === 0) return false;
|
|
74
|
+
const firstRow = value[0];
|
|
75
|
+
return Array.isArray(firstRow) && firstRow.every((item) => isString(item));
|
|
77
76
|
}
|
|
78
77
|
function isWhitespaceOnly(value) {
|
|
79
78
|
return value.trim() === "";
|
|
@@ -267,8 +266,8 @@ var applyTrimOption = (output, options, shouldPreserveEmpty) => {
|
|
|
267
266
|
};
|
|
268
267
|
var applyFlattenOption = (output, options) => options.flatten ? output.flat() : output;
|
|
269
268
|
var applyExcludeOption = (output, options, shouldPreserveEmpty) => {
|
|
270
|
-
if (isNoneMode(options.exclude)) return output;
|
|
271
|
-
const exclude = options.exclude
|
|
269
|
+
if (options.exclude == null || isNoneMode(options.exclude)) return output;
|
|
270
|
+
const exclude = options.exclude;
|
|
272
271
|
let shouldKeep = () => true;
|
|
273
272
|
if (exclude in excludePredicateMap) {
|
|
274
273
|
shouldKeep = excludePredicateMap[exclude];
|