package-json-scripts-portability 0.0.1 → 0.0.3
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/README.md +59 -20
- package/dist/analyze-script.d.mts +34 -0
- package/dist/analyze-script.mjs +53 -0
- package/dist/command-checker.mjs +527 -0
- package/dist/command-usage.mjs +413 -0
- package/dist/commands.mjs +639 -0
- package/dist/context.mjs +25 -0
- package/dist/fixes.d.mts +9 -0
- package/dist/fixes.mjs +354 -0
- package/dist/index.d.mts +6 -118
- package/dist/index.mjs +4 -3787
- package/dist/line-break-checker.mjs +104 -0
- package/dist/messages.mjs +38 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-difference.mjs +11 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-includes.mjs +8 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-intersection.mjs +13 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-is-subset.mjs +16 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/arrayify.mjs +7 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/sorted-array-insertion-index-with.mjs +33 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/sorted-array-insertion-index.mjs +10 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/iterable/sliding-window.mjs +30 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/map/map-get-or-insert-computed.mjs +42 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/map/map-get-or-insert.mjs +40 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/math/clamp.mjs +7 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/path/to-forward-slashes.mjs +8 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/predicate/is-array.mjs +39 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/semver/is-semver-in-range.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/semver/parse-semver.mjs +26 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/set/set-has.mjs +8 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/substring-after-last.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/substring-after.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/substring-before.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/truncate.mjs +46 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/ts/all-union-members.mjs +45 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/types/maybe-readonly-array.d.mts +17 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/value/is-equal.mjs +37 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/@antfu/utils/dist/index.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/_internal/globalThis.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/_internal/isUnsafeProperty.mjs +18 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/_internal/setOwnValue.mjs +23 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/_internal/toPropertyKey.mjs +16 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/differenceBy.mjs +40 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/differenceWith.mjs +37 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/intersectionWith.mjs +43 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/isSubsetWith.mjs +36 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/bigint/clamp.mjs +15 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/baseToString.mjs +26 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/getSymbols.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/getTag.mjs +13 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/hasOwn.mjs +13 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/isDeepKey.mjs +39 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/isIndex.mjs +10 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/regexMultiByte.mjs +10 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/tags.mjs +28 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/toKey.mjs +15 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/array/sortedIndex.mjs +36 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/array/sortedIndexBy.mjs +54 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/array/sortedLastIndex.mjs +34 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/array/sortedLastIndexBy.mjs +21 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/function/identity.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/object/cloneDeep.mjs +52 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/object/cloneDeepWith.mjs +179 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/object/get.mjs +67 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/object/has.mjs +53 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/object/property.mjs +26 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isArguments.mjs +26 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isBuffer.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isMatch.mjs +34 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isMatchWith.mjs +163 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isNaN.mjs +18 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isNil.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isNumber.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isObject.mjs +28 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isObjectLike.mjs +28 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isSymbol.mjs +19 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isTypedArray.mjs +21 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/matches.mjs +36 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/matchesProperty.mjs +47 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/string/truncate.mjs +78 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/eq.mjs +18 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/iteratee.mjs +46 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/toPath.mjs +75 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/toString.mjs +23 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/function/identity.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/function/noop.mjs +12 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/math/clamp.mjs +23 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isBuffer.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isEqual.mjs +21 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isEqualWith.mjs +150 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isNil.mjs +24 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isNull.mjs +25 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isPlainObject.mjs +50 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isPrimitive.mjs +26 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isSymbol.mjs +28 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isTypedArray.mjs +20 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isUndefined.mjs +25 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/remeda/dist/binarySearchCutoffIndex-Bu-OMJ0Z.mjs +26 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/remeda/dist/isArray.mjs +18 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/remeda/dist/sortedIndexWith.mjs +7 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/ts-extras/distribution/array-includes.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/ts-extras/distribution/set-has.mjs +5 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/verkit/dist/comparison-CmVirWIW.mjs +108 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/verkit/dist/range-C5wjdo9a.mjs +164 -0
- package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/verkit/dist/set-BGFWKKE8.mjs +38 -0
- package/dist/platforms.d.mts +8 -0
- package/dist/platforms.mjs +26 -0
- package/dist/redirection-checker.mjs +169 -0
- package/dist/reporter.d.mts +32 -0
- package/dist/reporter.mjs +143 -0
- package/dist/runners.d.mts +21 -0
- package/dist/runners.mjs +199 -0
- package/dist/script-analyzer.mjs +853 -0
- package/dist/word-checker.mjs +573 -0
- package/dist/words.mjs +70 -0
- package/package.json +36 -30
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getTag } from "../_internal/getTag.mjs";
|
|
2
|
+
import { isObjectLike } from "./isObjectLike.mjs";
|
|
3
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isNumber.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Checks if a given value is a number.
|
|
6
|
+
*
|
|
7
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `number`.
|
|
8
|
+
*
|
|
9
|
+
* @param value The value to check if it is a number.
|
|
10
|
+
* @returns Returns `true` if `value` is a number, else `false`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const value1 = 123;
|
|
14
|
+
* const value2 = 'abc';
|
|
15
|
+
* const value3 = true;
|
|
16
|
+
*
|
|
17
|
+
* console.log(isNumber(value1)); // true
|
|
18
|
+
* console.log(isNumber(value2)); // false
|
|
19
|
+
* console.log(isNumber(value3)); // false
|
|
20
|
+
*/
|
|
21
|
+
function isNumber(value) {
|
|
22
|
+
return typeof value === "number" || isObjectLike(value) && getTag(value) === "[object Number]";
|
|
23
|
+
}
|
|
24
|
+
export { isNumber };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isObject.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the given value is an object. An object is a value that is
|
|
4
|
+
* not a primitive type (string, number, boolean, symbol, null, or undefined).
|
|
5
|
+
*
|
|
6
|
+
* This function tests whether the provided value is an object or not.
|
|
7
|
+
* It returns `true` if the value is an object, and `false` otherwise.
|
|
8
|
+
*
|
|
9
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object value.
|
|
10
|
+
*
|
|
11
|
+
* @param value - The value to check if it is an object.
|
|
12
|
+
* @returns `true` if the value is an object, `false` otherwise.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const value1 = {};
|
|
16
|
+
* const value2 = [1, 2, 3];
|
|
17
|
+
* const value3 = () => {};
|
|
18
|
+
* const value4 = null;
|
|
19
|
+
*
|
|
20
|
+
* console.log(isObject(value1)); // true
|
|
21
|
+
* console.log(isObject(value2)); // true
|
|
22
|
+
* console.log(isObject(value3)); // true
|
|
23
|
+
* console.log(isObject(value4)); // false
|
|
24
|
+
*/
|
|
25
|
+
function isObject(value) {
|
|
26
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
27
|
+
}
|
|
28
|
+
export { isObject };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isObjectLike.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the given value is object-like.
|
|
4
|
+
*
|
|
5
|
+
* A value is object-like if its type is object and it is not null.
|
|
6
|
+
*
|
|
7
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an object-like value.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The value to test if it is an object-like.
|
|
10
|
+
* @returns `true` if the value is an object-like, `false` otherwise.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const value1 = { a: 1 };
|
|
14
|
+
* const value2 = [1, 2, 3];
|
|
15
|
+
* const value3 = 'abc';
|
|
16
|
+
* const value4 = () => {};
|
|
17
|
+
* const value5 = null;
|
|
18
|
+
*
|
|
19
|
+
* console.log(isObjectLike(value1)); // true
|
|
20
|
+
* console.log(isObjectLike(value2)); // true
|
|
21
|
+
* console.log(isObjectLike(value3)); // false
|
|
22
|
+
* console.log(isObjectLike(value4)); // false
|
|
23
|
+
* console.log(isObjectLike(value5)); // false
|
|
24
|
+
*/
|
|
25
|
+
function isObjectLike(value) {
|
|
26
|
+
return typeof value === "object" && value !== null;
|
|
27
|
+
}
|
|
28
|
+
export { isObjectLike };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isSymbol.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Check whether a value is a symbol.
|
|
4
|
+
*
|
|
5
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `symbol`.
|
|
6
|
+
*
|
|
7
|
+
* @param value The value to check.
|
|
8
|
+
* @returns Returns `true` if `value` is a symbol, else `false`.
|
|
9
|
+
* @example
|
|
10
|
+
* isSymbol(Symbol.iterator);
|
|
11
|
+
* // => true
|
|
12
|
+
*
|
|
13
|
+
* isSymbol('abc');
|
|
14
|
+
* // => false
|
|
15
|
+
*/
|
|
16
|
+
function isSymbol(value) {
|
|
17
|
+
return typeof value === "symbol" || value instanceof Symbol;
|
|
18
|
+
}
|
|
19
|
+
export { isSymbol };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isTypedArray as isTypedArray$1 } from "../../predicate/isTypedArray.mjs";
|
|
2
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isTypedArray.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a value is a TypedArray.
|
|
5
|
+
* @param x The value to check.
|
|
6
|
+
* @returns Returns true if `x` is a TypedArray, false otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const arr = new Uint8Array([1, 2, 3]);
|
|
10
|
+
* isTypedArray(arr); // true
|
|
11
|
+
*
|
|
12
|
+
* const regularArray = [1, 2, 3];
|
|
13
|
+
* isTypedArray(regularArray); // false
|
|
14
|
+
*
|
|
15
|
+
* const buffer = new ArrayBuffer(16);
|
|
16
|
+
* isTypedArray(buffer); // false
|
|
17
|
+
*/
|
|
18
|
+
function isTypedArray(x) {
|
|
19
|
+
return isTypedArray$1(x);
|
|
20
|
+
}
|
|
21
|
+
export { isTypedArray };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isMatch } from "./isMatch.mjs";
|
|
2
|
+
import { cloneDeep } from "../object/cloneDeep.mjs";
|
|
3
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/matches.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Creates a function that performs a deep comparison between a given target and the source object.
|
|
6
|
+
*
|
|
7
|
+
* @template T
|
|
8
|
+
* @template V
|
|
9
|
+
* @param source - The source object to create the matcher from.
|
|
10
|
+
* @returns Returns a function that takes a target object and returns `true` if the target matches the source, otherwise `false`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* const matcher = matches({ a: 1, b: 2 });
|
|
15
|
+
* matcher({ a: 1, b: 2, c: 3 }); // true
|
|
16
|
+
* matcher({ a: 1, c: 3 }); // false
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Matching arrays
|
|
20
|
+
* const arrayMatcher = matches([1, 2, 3]);
|
|
21
|
+
* arrayMatcher([1, 2, 3, 4]); // true
|
|
22
|
+
* arrayMatcher([4, 5, 6]); // false
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Matching objects with nested structures
|
|
26
|
+
* const nestedMatcher = matches({ a: { b: 2 } });
|
|
27
|
+
* nestedMatcher({ a: { b: 2, c: 3 } }); // true
|
|
28
|
+
* nestedMatcher({ a: { c: 3 } }); // false
|
|
29
|
+
*/
|
|
30
|
+
function matches(source) {
|
|
31
|
+
source = cloneDeep(source);
|
|
32
|
+
return (target) => {
|
|
33
|
+
return isMatch(target, source);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export { matches };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { toKey } from "../_internal/toKey.mjs";
|
|
2
|
+
import { get } from "../object/get.mjs";
|
|
3
|
+
import { isMatch } from "./isMatch.mjs";
|
|
4
|
+
import { cloneDeep } from "../object/cloneDeep.mjs";
|
|
5
|
+
import { has } from "../object/has.mjs";
|
|
6
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/matchesProperty.mjs
|
|
7
|
+
/**
|
|
8
|
+
* Creates a function that checks if a given target object matches a specific property value.
|
|
9
|
+
*
|
|
10
|
+
* The returned function takes a target object and determines if the property at the
|
|
11
|
+
* specified path within the target object is equal to the given value.
|
|
12
|
+
*
|
|
13
|
+
* @param property - The property path to check within the target object.
|
|
14
|
+
* This can be a single property key or an array of property keys.
|
|
15
|
+
* @param source - The value to compare against the property value in the target object.
|
|
16
|
+
*
|
|
17
|
+
* @returns A function that takes a target object and returns
|
|
18
|
+
* `true` if the property value at the given path in the target object matches the provided value,
|
|
19
|
+
* otherwise returns `false`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Using a single property key
|
|
23
|
+
* const checkName = matchesProperty('name', 'Alice');
|
|
24
|
+
* console.log(checkName({ name: 'Alice' })); // true
|
|
25
|
+
* console.log(checkName({ name: 'Bob' })); // false
|
|
26
|
+
*
|
|
27
|
+
* // Using an array of property keys
|
|
28
|
+
* const checkNested = matchesProperty(['address', 'city'], 'New York');
|
|
29
|
+
* console.log(checkNested({ address: { city: 'New York' } })); // true
|
|
30
|
+
* console.log(checkNested({ address: { city: 'Los Angeles' } })); // false
|
|
31
|
+
*/
|
|
32
|
+
function matchesProperty(property, source) {
|
|
33
|
+
switch (typeof property) {
|
|
34
|
+
case "object":
|
|
35
|
+
if (Object.is(property === null || property === void 0 ? void 0 : property.valueOf(), -0)) property = "-0";
|
|
36
|
+
break;
|
|
37
|
+
case "number": property = toKey(property);
|
|
38
|
+
}
|
|
39
|
+
source = cloneDeep(source);
|
|
40
|
+
return function(target) {
|
|
41
|
+
const result = get(target, property);
|
|
42
|
+
if (result === void 0) return has(target, property);
|
|
43
|
+
if (source === void 0) return result === void 0;
|
|
44
|
+
return isMatch(result, source);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export { matchesProperty };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { isObject } from "../predicate/isObject.mjs";
|
|
2
|
+
import { regexMultiByte } from "../_internal/regexMultiByte.mjs";
|
|
3
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/string/truncate.mjs
|
|
4
|
+
/**
|
|
5
|
+
* This regex might more completely detect unicode, but it is slower and this project
|
|
6
|
+
* desires to mimic the behavior of lodash.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Truncates `string` if it's longer than the given maximum string length.
|
|
10
|
+
* The last characters of the truncated string are replaced with the omission
|
|
11
|
+
* string which defaults to "...".
|
|
12
|
+
*
|
|
13
|
+
* @param [string=''] The string to truncate.
|
|
14
|
+
* @param [options={}] The options object.
|
|
15
|
+
* @param [options.length=30] The maximum string length.
|
|
16
|
+
* @param [options.omission='...'] The string to indicate text is omitted.
|
|
17
|
+
* @param [options.separator] The separator pattern to truncate to.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const test = 'hi-diddly-ho there, neighborino';
|
|
21
|
+
* const truncatedStr1 = truncate(test) // returns 'hi-diddly-ho there, neighbo...'
|
|
22
|
+
* const truncatedStr2 = truncate(test, { length: 24, separator: ' ' }) // returns 'hi-diddly-ho there,...'
|
|
23
|
+
* const truncatedStr3 = truncate(test, { length: 24, separator: /,? +/ }) // returns 'hi-diddly-ho there...'
|
|
24
|
+
* const truncatedStr4 = truncate(test, { omission: ' [...]' }) // returns 'hi-diddly-ho there, neig [...]'
|
|
25
|
+
* const truncatedStr5 = truncate('ABC', { length: 3 }) // returns 'ABC'
|
|
26
|
+
* const truncatedStr6 = truncate('ABC', { length: 2 }) // returns '...'
|
|
27
|
+
* const truncatedStr7 = truncate('¥§✈✉🤓', { length: 5 }) // returns '¥§✈✉🤓'
|
|
28
|
+
* const truncatedStr8 = truncate('¥§✈✉🤓', { length: 4, omission: '…' }) // returns '¥§✈…'
|
|
29
|
+
*/
|
|
30
|
+
function truncate(string, options) {
|
|
31
|
+
string = string != null ? `${string}` : "";
|
|
32
|
+
let length = 30;
|
|
33
|
+
let omission = "...";
|
|
34
|
+
if (isObject(options)) {
|
|
35
|
+
length = parseLength(options.length);
|
|
36
|
+
omission = "omission" in options ? `${options.omission}` : "...";
|
|
37
|
+
}
|
|
38
|
+
let i = string.length;
|
|
39
|
+
const lengthOmission = Array.from(omission).length;
|
|
40
|
+
const lengthBase = Math.max(length - lengthOmission, 0);
|
|
41
|
+
let strArray = void 0;
|
|
42
|
+
if (regexMultiByte.test(string)) {
|
|
43
|
+
strArray = Array.from(string);
|
|
44
|
+
i = strArray.length;
|
|
45
|
+
}
|
|
46
|
+
if (length >= i) return string;
|
|
47
|
+
if (i <= lengthOmission) return omission;
|
|
48
|
+
let base = strArray === void 0 ? string.slice(0, lengthBase) : strArray === null || strArray === void 0 ? void 0 : strArray.slice(0, lengthBase).join("");
|
|
49
|
+
const separator = options === null || options === void 0 ? void 0 : options.separator;
|
|
50
|
+
if (!separator) {
|
|
51
|
+
base += omission;
|
|
52
|
+
return base;
|
|
53
|
+
}
|
|
54
|
+
if (separator instanceof RegExp ? string.slice(base.length).search(separator) === 0 : string.indexOf(separator, base.length) === base.length) return base + omission;
|
|
55
|
+
let lastSeparator = -1;
|
|
56
|
+
if (typeof separator === "string") lastSeparator = base.lastIndexOf(separator);
|
|
57
|
+
else {
|
|
58
|
+
const flags = separator.flags.includes("g") ? separator.flags : separator.flags + "g";
|
|
59
|
+
const pattern = new RegExp(separator.source, flags);
|
|
60
|
+
let match;
|
|
61
|
+
while ((match = pattern.exec(base)) !== null) {
|
|
62
|
+
lastSeparator = match.index;
|
|
63
|
+
if (match[0].length === 0) {
|
|
64
|
+
var _base$codePointAt;
|
|
65
|
+
const unicode = pattern.unicode || pattern.flags.includes("v");
|
|
66
|
+
pattern.lastIndex = match.index + (unicode && ((_base$codePointAt = base.codePointAt(match.index)) !== null && _base$codePointAt !== void 0 ? _base$codePointAt : 0) > 65535 ? 2 : 1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (lastSeparator !== -1) base = base.slice(0, lastSeparator);
|
|
71
|
+
return base + omission;
|
|
72
|
+
}
|
|
73
|
+
function parseLength(length) {
|
|
74
|
+
if (length == null) return 30;
|
|
75
|
+
if (length <= 0) return 0;
|
|
76
|
+
return length;
|
|
77
|
+
}
|
|
78
|
+
export { truncate };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/eq.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to compare.
|
|
6
|
+
* @param other The other value to compare.
|
|
7
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* eq(1, 1); // true
|
|
11
|
+
* eq(0, -0); // true
|
|
12
|
+
* eq(NaN, NaN); // true
|
|
13
|
+
* eq('a', Object('a')); // false
|
|
14
|
+
*/
|
|
15
|
+
function eq(value, other) {
|
|
16
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
17
|
+
}
|
|
18
|
+
export { eq };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { identity } from "../../function/identity.mjs";
|
|
2
|
+
import { property } from "../object/property.mjs";
|
|
3
|
+
import { matches } from "../predicate/matches.mjs";
|
|
4
|
+
import { matchesProperty } from "../predicate/matchesProperty.mjs";
|
|
5
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/iteratee.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Creates a function that returns a value from an element in a collection.
|
|
8
|
+
*
|
|
9
|
+
* You can call `iteratee` with the following types of arguments:
|
|
10
|
+
*
|
|
11
|
+
* - **Function**: Returns the function as-is, which will be called with the element from the collection.
|
|
12
|
+
* - **Property name**: Returns the value of the specified property from the element.
|
|
13
|
+
* - **Property-value pair**: Returns a boolean indicating whether the element's property matches the given value.
|
|
14
|
+
* - **Partial object**: Returns a boolean indicating whether the element matches the properties of the partial object.
|
|
15
|
+
*
|
|
16
|
+
* If you don't provide any arguments or pass `null`, this function will return a function that simply returns its input unchanged.
|
|
17
|
+
*
|
|
18
|
+
* @param value - The value to convert to an iteratee.
|
|
19
|
+
* @returns Returns the new iteratee function.
|
|
20
|
+
* @example
|
|
21
|
+
* const func = iteratee();
|
|
22
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [{ a: 1 }, { a: 2 }, { a: 3 }]
|
|
23
|
+
*
|
|
24
|
+
* const func = iteratee((object) => object.a);
|
|
25
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [1, 2, 3]
|
|
26
|
+
*
|
|
27
|
+
* const func = iteratee('a');
|
|
28
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].map(func) // => [1, 2, 3]
|
|
29
|
+
*
|
|
30
|
+
* const func = iteratee({ a: 1 });
|
|
31
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].find(func) // => { a: 1 }
|
|
32
|
+
*
|
|
33
|
+
* const func = iteratee(['a', 1]);
|
|
34
|
+
* [{ a: 1 }, { a: 2 }, { a: 3 }].find(func) // => { a: 1 }
|
|
35
|
+
*/
|
|
36
|
+
function iteratee(value) {
|
|
37
|
+
if (value == null) return identity;
|
|
38
|
+
switch (typeof value) {
|
|
39
|
+
case "function": return value;
|
|
40
|
+
case "object":
|
|
41
|
+
if (Array.isArray(value) && value.length === 2) return matchesProperty(value[0], value[1]);
|
|
42
|
+
return matches(value);
|
|
43
|
+
default: return property(value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export { iteratee };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { toKey } from "../_internal/toKey.mjs";
|
|
2
|
+
import { toString } from "./toString.mjs";
|
|
3
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/toPath.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Converts a deep key string into an array of path segments.
|
|
6
|
+
*
|
|
7
|
+
* This function takes a string representing a deep key (e.g., 'a.b.c' or 'a[b][c]') and breaks it down into an array of strings, each representing a segment of the path.
|
|
8
|
+
*
|
|
9
|
+
* @param deepKey - The deep key string to convert.
|
|
10
|
+
* @returns An array of strings, each representing a segment of the path.
|
|
11
|
+
*
|
|
12
|
+
* Examples:
|
|
13
|
+
*
|
|
14
|
+
* toPath('a.b.c') // Returns ['a', 'b', 'c']
|
|
15
|
+
* toPath('a[b][c]') // Returns ['a', 'b', 'c']
|
|
16
|
+
* toPath('.a.b.c') // Returns ['', 'a', 'b', 'c']
|
|
17
|
+
* toPath('a["b.c"].d') // Returns ['a', 'b.c', 'd']
|
|
18
|
+
* toPath('') // Returns []
|
|
19
|
+
* toPath('.a[b].c.d[e]["f.g"].h') // Returns ['', 'a', 'b', 'c', 'd', 'e', 'f.g', 'h']
|
|
20
|
+
*/
|
|
21
|
+
function toPath(deepKey) {
|
|
22
|
+
if (Array.isArray(deepKey)) return deepKey.map(toKey);
|
|
23
|
+
if (typeof deepKey === "symbol") return [deepKey];
|
|
24
|
+
deepKey = toString(deepKey);
|
|
25
|
+
const result = [];
|
|
26
|
+
const length = deepKey.length;
|
|
27
|
+
if (length === 0) return result;
|
|
28
|
+
let index = 0;
|
|
29
|
+
let key = "";
|
|
30
|
+
let quoteChar = "";
|
|
31
|
+
let bracket = false;
|
|
32
|
+
let bracketHadQuote = false;
|
|
33
|
+
const bracketNumberRegex = /^-?\d+(?:\.\d+)?$/;
|
|
34
|
+
if (deepKey.charCodeAt(0) === 46) result.push("");
|
|
35
|
+
while (index < length) {
|
|
36
|
+
const char = deepKey[index];
|
|
37
|
+
if (quoteChar) {
|
|
38
|
+
if (char === "\\" && index + 1 < length) {
|
|
39
|
+
index++;
|
|
40
|
+
key += deepKey[index];
|
|
41
|
+
} else if (char === quoteChar) quoteChar = "";
|
|
42
|
+
else key += char;
|
|
43
|
+
} else if (bracket) {
|
|
44
|
+
if (char === "\"" || char === "'") {
|
|
45
|
+
quoteChar = char;
|
|
46
|
+
bracketHadQuote = true;
|
|
47
|
+
} else if (char === "]") {
|
|
48
|
+
bracket = false;
|
|
49
|
+
if (!bracketHadQuote && key.includes(".") && !bracketNumberRegex.test(key)) {
|
|
50
|
+
const segments = key.split(".");
|
|
51
|
+
for (let i = 0; i < segments.length; i++) if (segments[i] !== "") result.push(segments[i]);
|
|
52
|
+
} else result.push(key);
|
|
53
|
+
key = "";
|
|
54
|
+
} else key += char;
|
|
55
|
+
} else if (char === "[") {
|
|
56
|
+
bracket = true;
|
|
57
|
+
bracketHadQuote = false;
|
|
58
|
+
if (key) {
|
|
59
|
+
result.push(key);
|
|
60
|
+
key = "";
|
|
61
|
+
}
|
|
62
|
+
} else if (char === ".") {
|
|
63
|
+
if (key) {
|
|
64
|
+
result.push(key);
|
|
65
|
+
key = "";
|
|
66
|
+
}
|
|
67
|
+
const next = deepKey[index + 1];
|
|
68
|
+
if (next === void 0 || next === ".") result.push("");
|
|
69
|
+
} else key += char;
|
|
70
|
+
index++;
|
|
71
|
+
}
|
|
72
|
+
if (key) result.push(key);
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
export { toPath };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { baseToString } from "../_internal/baseToString.mjs";
|
|
2
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/toString.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Converts `value` to a string.
|
|
5
|
+
*
|
|
6
|
+
* An empty string is returned for `null` and `undefined` values.
|
|
7
|
+
* The sign of `-0` is preserved.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The value to convert.
|
|
10
|
+
* @returns Returns the converted string.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* toString(null) // returns ''
|
|
14
|
+
* toString(undefined) // returns ''
|
|
15
|
+
* toString(-0) // returns '-0'
|
|
16
|
+
* toString([1, 2, -0]) // returns '1,2,-0'
|
|
17
|
+
* toString([Symbol('a'), Symbol('b')]) // returns 'Symbol(a),Symbol(b)'
|
|
18
|
+
*/
|
|
19
|
+
function toString(value) {
|
|
20
|
+
if (value == null) return "";
|
|
21
|
+
return baseToString(value);
|
|
22
|
+
}
|
|
23
|
+
export { toString };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/function/identity.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Returns the input value unchanged.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of the input value.
|
|
6
|
+
* @param x - The value to be returned.
|
|
7
|
+
* @returns The input value.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Returns 5
|
|
11
|
+
* identity(5);
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Returns 'hello'
|
|
15
|
+
* identity('hello');
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Returns { key: 'value' }
|
|
19
|
+
* identity({ key: 'value' });
|
|
20
|
+
*/
|
|
21
|
+
function identity(x) {
|
|
22
|
+
return x;
|
|
23
|
+
}
|
|
24
|
+
export { identity };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/function/noop.mjs
|
|
2
|
+
/**
|
|
3
|
+
* A no-operation function that does nothing.
|
|
4
|
+
* This can be used as a placeholder or default function.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* noop(); // Does nothing
|
|
8
|
+
*
|
|
9
|
+
* @returns This function does not return anything.
|
|
10
|
+
*/
|
|
11
|
+
function noop() {}
|
|
12
|
+
export { noop };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/math/clamp.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Clamps a number within the specified bounds.
|
|
4
|
+
*
|
|
5
|
+
* This function takes a number and one or two bounds, and returns the number clamped within the specified bounds.
|
|
6
|
+
* If only one bound is provided, it returns the minimum of the value and the bound.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The number to clamp.
|
|
9
|
+
* @param bound1 - The minimum bound to clamp the number, or the maximum bound if bound2 is not provided.
|
|
10
|
+
* @param [bound2] - The maximum bound to clamp the number. If not provided, the function will only consider bound1 as the upper limit.
|
|
11
|
+
* @returns The clamped number within the specified bounds.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5
|
|
15
|
+
* const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15
|
|
16
|
+
* const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5
|
|
17
|
+
* const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15
|
|
18
|
+
*/
|
|
19
|
+
function clamp(value, bound1, bound2) {
|
|
20
|
+
if (bound2 == null) return Math.min(value, bound1);
|
|
21
|
+
return Math.min(Math.max(value, bound1), bound2);
|
|
22
|
+
}
|
|
23
|
+
export { clamp };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { globalThis as globalThis_ } from "../_internal/globalThis.mjs";
|
|
2
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isBuffer.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Checks if the given value is a Buffer instance.
|
|
5
|
+
*
|
|
6
|
+
* This function tests whether the provided value is an instance of Buffer.
|
|
7
|
+
* It returns `true` if the value is a Buffer, and `false` otherwise.
|
|
8
|
+
*
|
|
9
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `Buffer`.
|
|
10
|
+
*
|
|
11
|
+
* @param x - The value to check if it is a Buffer.
|
|
12
|
+
* @returns Returns `true` if `x` is a Buffer, else `false`.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const buffer = Buffer.from("test");
|
|
16
|
+
* console.log(isBuffer(buffer)); // true
|
|
17
|
+
*
|
|
18
|
+
* const notBuffer = "not a buffer";
|
|
19
|
+
* console.log(isBuffer(notBuffer)); // false
|
|
20
|
+
*/
|
|
21
|
+
function isBuffer(x) {
|
|
22
|
+
return typeof globalThis_.Buffer !== "undefined" && globalThis_.Buffer.isBuffer(x);
|
|
23
|
+
}
|
|
24
|
+
export { isBuffer };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { noop } from "../function/noop.mjs";
|
|
2
|
+
import { isEqualWith } from "./isEqualWith.mjs";
|
|
3
|
+
// node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isEqual.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison.
|
|
6
|
+
*
|
|
7
|
+
* @param a - The first value to compare.
|
|
8
|
+
* @param b - The second value to compare.
|
|
9
|
+
* @returns `true` if the values are equal, otherwise `false`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* isEqual(1, 1); // true
|
|
13
|
+
* isEqual({ a: 1 }, { a: 1 }); // true
|
|
14
|
+
* isEqual(/abc/g, /abc/g); // true
|
|
15
|
+
* isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true
|
|
16
|
+
* isEqual([1, 2, 3], [1, 2, 3]); // true
|
|
17
|
+
*/
|
|
18
|
+
function isEqual(a, b) {
|
|
19
|
+
return isEqualWith(a, b, noop);
|
|
20
|
+
}
|
|
21
|
+
export { isEqual };
|