@wavy/fn 0.0.30 → 0.0.31
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/main.cjs +21 -0
- package/dist/main.d.cts +3 -1
- package/dist/main.d.ts +3 -1
- package/dist/main.js +19 -0
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var main_exports = {};
|
|
22
22
|
__export(main_exports, {
|
|
23
23
|
addArticle: () => addArticle,
|
|
24
|
+
arrayEquals: () => arrayEquals,
|
|
24
25
|
arrayWithConst: () => arrayWithConst,
|
|
25
26
|
asyncRun: () => asyncRun,
|
|
26
27
|
averageOf: () => averageOf,
|
|
@@ -89,6 +90,7 @@ __export(main_exports, {
|
|
|
89
90
|
someValuesEmpty: () => someValuesEmpty,
|
|
90
91
|
sort: () => sort,
|
|
91
92
|
strictArray: () => strictArray,
|
|
93
|
+
strictArrayEquals: () => strictArrayEquals,
|
|
92
94
|
stringToSearch: () => stringToSearch,
|
|
93
95
|
subObjectList: () => subObjectList,
|
|
94
96
|
sumOf: () => sumOf,
|
|
@@ -618,6 +620,23 @@ function isPromise(value) {
|
|
|
618
620
|
if (value instanceof Promise) return true;
|
|
619
621
|
return !!value && (typeof value === "object" || typeof value === "function") && "then" in value && typeof value.then === "function";
|
|
620
622
|
}
|
|
623
|
+
function arrayEquals(...args) {
|
|
624
|
+
if (!args) return false;
|
|
625
|
+
if (args.length === 0) return false;
|
|
626
|
+
if (args.length === 1) return true;
|
|
627
|
+
return args.every((array, i) => {
|
|
628
|
+
const compareTo = args[i - 1] ?? args[i + 1];
|
|
629
|
+
return array.length === compareTo.length && array.every((item) => compareTo.includes(item));
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
function strictArrayEquals(...args) {
|
|
633
|
+
if (!args) return false;
|
|
634
|
+
if (args.length === 0) return false;
|
|
635
|
+
if (args.length === 1) return true;
|
|
636
|
+
return args.every(
|
|
637
|
+
(array, i) => JSON.stringify(args[i - 1] ?? args[i + 1]) === JSON.stringify(array)
|
|
638
|
+
);
|
|
639
|
+
}
|
|
621
640
|
var parseDate = dateFormat;
|
|
622
641
|
function parseName(value) {
|
|
623
642
|
if (typeof value === "string") {
|
|
@@ -1028,6 +1047,7 @@ function arrayWithConst(array) {
|
|
|
1028
1047
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1029
1048
|
0 && (module.exports = {
|
|
1030
1049
|
addArticle,
|
|
1050
|
+
arrayEquals,
|
|
1031
1051
|
arrayWithConst,
|
|
1032
1052
|
asyncRun,
|
|
1033
1053
|
averageOf,
|
|
@@ -1096,6 +1116,7 @@ function arrayWithConst(array) {
|
|
|
1096
1116
|
someValuesEmpty,
|
|
1097
1117
|
sort,
|
|
1098
1118
|
strictArray,
|
|
1119
|
+
strictArrayEquals,
|
|
1099
1120
|
stringToSearch,
|
|
1100
1121
|
subObjectList,
|
|
1101
1122
|
sumOf,
|
package/dist/main.d.cts
CHANGED
|
@@ -86,6 +86,8 @@ declare function isFile(value: unknown): value is File;
|
|
|
86
86
|
declare function isFileDetails(value: unknown): value is FileDetails;
|
|
87
87
|
declare function isIterable<T>(value: unknown): value is Iterable<T>;
|
|
88
88
|
declare function isPromise<T>(value: unknown): value is Promise<T>;
|
|
89
|
+
declare function arrayEquals(...args: any[][]): boolean;
|
|
90
|
+
declare function strictArrayEquals(...args: any[][]): boolean;
|
|
89
91
|
declare const parseDate: (time: number | Date | "now", format?: DateFormat) => string;
|
|
90
92
|
declare function parseName<Value extends string | Name>(value: Value): Value extends string ? Name : Value extends Name ? string : never;
|
|
91
93
|
declare function parseMoney(value: string | number, options?: Parameters<typeof NumberFormatter.toMoney>[1]): string;
|
|
@@ -217,4 +219,4 @@ declare function arrayWithConst<T>(array: T[]): {
|
|
|
217
219
|
asConst: readonly T[];
|
|
218
220
|
};
|
|
219
221
|
|
|
220
|
-
export { addArticle, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, castArray, castReturn, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, getCaps, getFileExt, getFilename, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isFileDetails, isIterable, isLetter, isNumber, isPromise, lastIndex, limit, map, mapToArray, maxOf, minOf, negate, omit, omitNils, ordinalIndicator, overwrite, parseAddress, parseDate, parseFileSize, parseMoney, parseName, pick, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, someValuesEmpty, sort, strictArray, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, toObject, trimString, undefinedIfEmpty, upperFirst, windowed };
|
|
222
|
+
export { addArticle, arrayEquals, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, castArray, castReturn, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, getCaps, getFileExt, getFilename, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isFileDetails, isIterable, isLetter, isNumber, isPromise, lastIndex, limit, map, mapToArray, maxOf, minOf, negate, omit, omitNils, ordinalIndicator, overwrite, parseAddress, parseDate, parseFileSize, parseMoney, parseName, pick, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, someValuesEmpty, sort, strictArray, strictArrayEquals, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, toObject, trimString, undefinedIfEmpty, upperFirst, windowed };
|
package/dist/main.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ declare function isFile(value: unknown): value is File;
|
|
|
86
86
|
declare function isFileDetails(value: unknown): value is FileDetails;
|
|
87
87
|
declare function isIterable<T>(value: unknown): value is Iterable<T>;
|
|
88
88
|
declare function isPromise<T>(value: unknown): value is Promise<T>;
|
|
89
|
+
declare function arrayEquals(...args: any[][]): boolean;
|
|
90
|
+
declare function strictArrayEquals(...args: any[][]): boolean;
|
|
89
91
|
declare const parseDate: (time: number | Date | "now", format?: DateFormat) => string;
|
|
90
92
|
declare function parseName<Value extends string | Name>(value: Value): Value extends string ? Name : Value extends Name ? string : never;
|
|
91
93
|
declare function parseMoney(value: string | number, options?: Parameters<typeof NumberFormatter.toMoney>[1]): string;
|
|
@@ -217,4 +219,4 @@ declare function arrayWithConst<T>(array: T[]): {
|
|
|
217
219
|
asConst: readonly T[];
|
|
218
220
|
};
|
|
219
221
|
|
|
220
|
-
export { addArticle, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, castArray, castReturn, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, getCaps, getFileExt, getFilename, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isFileDetails, isIterable, isLetter, isNumber, isPromise, lastIndex, limit, map, mapToArray, maxOf, minOf, negate, omit, omitNils, ordinalIndicator, overwrite, parseAddress, parseDate, parseFileSize, parseMoney, parseName, pick, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, someValuesEmpty, sort, strictArray, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, toObject, trimString, undefinedIfEmpty, upperFirst, windowed };
|
|
222
|
+
export { addArticle, arrayEquals, arrayWithConst, asyncRun, averageOf, blankSpaces, buildArray, camelCaseToLetter, castArray, castReturn, classNameExt, classNameResolver, coerceIn, copyToClipboard, count, dataSearcher, distinct, drop, dropLast, dropLastWhile, dropWhile, format, getCaps, getFileExt, getFilename, getMimeTypes, group, hasIndex, ifDefined, ifEmpty, inRange, indexOf, indices, inferFilename, insertAt, isEmpty, isFile, isFileDetails, isIterable, isLetter, isNumber, isPromise, lastIndex, limit, map, mapToArray, maxOf, minOf, negate, omit, omitNils, ordinalIndicator, overwrite, parseAddress, parseDate, parseFileSize, parseMoney, parseName, pick, pluralize, poll, random, range, readClipboardText, removeAll, repeat, run, someValuesEmpty, sort, strictArray, strictArrayEquals, stringToSearch, subObjectList, sumOf, take, takeLast, takeLastWhile, takeWhile, timeDuration, toNumber, toObject, trimString, undefinedIfEmpty, upperFirst, windowed };
|
package/dist/main.js
CHANGED
|
@@ -513,6 +513,23 @@ function isPromise(value) {
|
|
|
513
513
|
if (value instanceof Promise) return true;
|
|
514
514
|
return !!value && (typeof value === "object" || typeof value === "function") && "then" in value && typeof value.then === "function";
|
|
515
515
|
}
|
|
516
|
+
function arrayEquals(...args) {
|
|
517
|
+
if (!args) return false;
|
|
518
|
+
if (args.length === 0) return false;
|
|
519
|
+
if (args.length === 1) return true;
|
|
520
|
+
return args.every((array, i) => {
|
|
521
|
+
const compareTo = args[i - 1] ?? args[i + 1];
|
|
522
|
+
return array.length === compareTo.length && array.every((item) => compareTo.includes(item));
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
function strictArrayEquals(...args) {
|
|
526
|
+
if (!args) return false;
|
|
527
|
+
if (args.length === 0) return false;
|
|
528
|
+
if (args.length === 1) return true;
|
|
529
|
+
return args.every(
|
|
530
|
+
(array, i) => JSON.stringify(args[i - 1] ?? args[i + 1]) === JSON.stringify(array)
|
|
531
|
+
);
|
|
532
|
+
}
|
|
516
533
|
var parseDate = dateFormat;
|
|
517
534
|
function parseName(value) {
|
|
518
535
|
if (typeof value === "string") {
|
|
@@ -922,6 +939,7 @@ function arrayWithConst(array) {
|
|
|
922
939
|
}
|
|
923
940
|
export {
|
|
924
941
|
addArticle,
|
|
942
|
+
arrayEquals,
|
|
925
943
|
arrayWithConst,
|
|
926
944
|
asyncRun,
|
|
927
945
|
averageOf,
|
|
@@ -990,6 +1008,7 @@ export {
|
|
|
990
1008
|
someValuesEmpty,
|
|
991
1009
|
sort,
|
|
992
1010
|
strictArray,
|
|
1011
|
+
strictArrayEquals,
|
|
993
1012
|
stringToSearch,
|
|
994
1013
|
subObjectList,
|
|
995
1014
|
sumOf,
|