package-json-scripts-portability 0.0.0 → 0.0.2

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.
Files changed (66) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +235 -45
  3. package/dist/analyze-script.d.mts +34 -0
  4. package/dist/analyze-script.mjs +48 -0
  5. package/dist/command-checker.mjs +295 -0
  6. package/dist/command-usage.mjs +364 -0
  7. package/dist/commands.mjs +520 -0
  8. package/dist/context.mjs +18 -0
  9. package/dist/fixes.d.mts +9 -0
  10. package/dist/fixes.mjs +210 -0
  11. package/dist/index.d.mts +6 -0
  12. package/dist/index.mjs +5 -0
  13. package/dist/line-break-checker.mjs +71 -0
  14. package/dist/messages.mjs +30 -0
  15. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-difference.mjs +11 -0
  16. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-includes.mjs +8 -0
  17. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-intersection.mjs +13 -0
  18. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/array-is-subset.mjs +16 -0
  19. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/array/arrayify.mjs +7 -0
  20. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/iterable/sliding-window.mjs +30 -0
  21. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/map/map-get-or-insert-computed.mjs +42 -0
  22. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/map/map-get-or-insert.mjs +40 -0
  23. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/math/clamp.mjs +7 -0
  24. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/path/to-forward-slashes.mjs +8 -0
  25. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/predicate/is-array.mjs +39 -0
  26. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/set/set-has.mjs +8 -0
  27. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/substring-after-last.mjs +24 -0
  28. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/substring-before.mjs +24 -0
  29. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/truncate.mjs +46 -0
  30. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/ts/all-union-members.mjs +45 -0
  31. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/types/maybe-readonly-array.d.mts +17 -0
  32. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/value/is-equal.mjs +37 -0
  33. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/@antfu/utils/dist/index.mjs +5 -0
  34. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/_internal/globalThis.mjs +5 -0
  35. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/differenceBy.mjs +40 -0
  36. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/differenceWith.mjs +37 -0
  37. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/intersectionWith.mjs +43 -0
  38. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/isSubsetWith.mjs +36 -0
  39. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/bigint/clamp.mjs +15 -0
  40. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/getSymbols.mjs +5 -0
  41. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/getTag.mjs +13 -0
  42. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/regexMultiByte.mjs +10 -0
  43. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/tags.mjs +27 -0
  44. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/predicate/isObject.mjs +28 -0
  45. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/string/truncate.mjs +78 -0
  46. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/util/eq.mjs +18 -0
  47. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/function/noop.mjs +12 -0
  48. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/math/clamp.mjs +23 -0
  49. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isBuffer.mjs +24 -0
  50. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isEqual.mjs +21 -0
  51. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isEqualWith.mjs +151 -0
  52. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/predicate/isPlainObject.mjs +50 -0
  53. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/remeda/dist/isArray.mjs +18 -0
  54. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/ts-extras/distribution/array-includes.mjs +5 -0
  55. package/dist/node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/ts-extras/distribution/set-has.mjs +5 -0
  56. package/dist/platforms.d.mts +8 -0
  57. package/dist/platforms.mjs +26 -0
  58. package/dist/redirection-checker.mjs +117 -0
  59. package/dist/reporter.d.mts +32 -0
  60. package/dist/reporter.mjs +98 -0
  61. package/dist/runners.d.mts +24 -0
  62. package/dist/runners.mjs +118 -0
  63. package/dist/script-analyzer.mjs +551 -0
  64. package/dist/word-checker.mjs +444 -0
  65. package/dist/words.mjs +43 -0
  66. package/package.json +118 -6
@@ -0,0 +1,46 @@
1
+ import { truncate as truncate$1 } from "../vendor/es-toolkit/dist/compat/string/truncate.mjs";
2
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/string/truncate.mjs
3
+ /**
4
+ * Shortens a string to a maximum length, replacing the removed part with an
5
+ * omission (`'...'` by default).
6
+ * Strings that fit are returned as is.
7
+ * The length is counted in code points, so emoji are never split in half.
8
+ *
9
+ * The removed part is at the end by default; pass `position: 'start'` to keep
10
+ * the end (like the end of a long path), or `'middle'` to keep both ends (like
11
+ * a file name with its extension).
12
+ * With the default `'end'` position, a `separator` makes the cut happen before
13
+ * its last match within the limit, to avoid cutting a word in half.
14
+ * When a match starts right at the limit, the string is cut there.
15
+ * When `length` is shorter than the omission, a string that doesn't fit becomes
16
+ * the omission alone, which is longer than `length`.
17
+ * @param text - The string to truncate.
18
+ * @param options - `length` (`30` by default), `omission` (`'...'` by default), `position` (`'end'`
19
+ * by default) and `separator`.
20
+ * @returns The string, shortened if needed.
21
+ * @example
22
+ * truncate('hi-diddly-ho there, neighborino');
23
+ * // 'hi-diddly-ho there, neighbo...'
24
+ * truncate('hi-diddly-ho there, neighborino', {length: 24, separator: ' '});
25
+ * // 'hi-diddly-ho there,...'
26
+ * @example
27
+ * // Keep the end or both ends
28
+ * truncate('/home/user/projects/utilery/src/index.ts', {length: 20, position: 'start'});
29
+ * // '...lery/src/index.ts'
30
+ * truncate('a-very-long-file-name.tar.gz', {length: 16, position: 'middle'});
31
+ * // 'a-very-...tar.gz'
32
+ */
33
+ const truncate = (text, options = {}) => {
34
+ const { length = 30, omission = "...", position = "end", separator } = options;
35
+ if (position === "end") return truncate$1(text, {
36
+ length,
37
+ omission,
38
+ ...separator != null && { separator }
39
+ });
40
+ const characters = [...text];
41
+ if (characters.length <= length) return text;
42
+ const keptLength = Math.max(Math.floor(length) - [...omission].length, 0) || 0;
43
+ const headLength = position === "middle" ? Math.ceil(keptLength / 2) : 0;
44
+ return characters.slice(0, headLength).join("") + omission + characters.slice(characters.length - (keptLength - headLength)).join("");
45
+ };
46
+ export { truncate };
@@ -0,0 +1,45 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/ts/all-union-members.mjs
2
+ /**
3
+ * Builds a compile-time guard that a tuple lists every member of `Union`
4
+ * exactly once: no missing members, no extras and no duplicates.
5
+ * It is meant to keep a runtime list in sync with a union type: whenever the
6
+ * union changes, the tuple stops type-checking until it is updated to match.
7
+ *
8
+ * Because TypeScript cannot infer one type argument while another is given
9
+ * explicitly, the union is passed to the outer call and the tuple is inferred
10
+ * by the returned function.
11
+ * At runtime the returned function is the identity function: all of the work
12
+ * happens in the type system.
13
+ * An invalid tuple fails to type-check with a message that names the missing,
14
+ * extra or duplicated members (see {@link AllUnionMembers}).
15
+ *
16
+ * By default the result is widened to a mutable tuple; pass `{readonly: true}`
17
+ * as the second type argument to preserve the `readonly` tuple type instead.
18
+ * @returns A function that accepts the tuple and returns it unchanged, typed as
19
+ * the tuple of `Union`'s members (mutable by default, `readonly` on request).
20
+ * @example
21
+ * type Fruit = 'apple' | 'banana' | 'cherry';
22
+ *
23
+ * // OK: lists every member exactly once
24
+ * const fruits = allUnionMembers<Fruit>()(['apple', 'banana', 'cherry']);
25
+ * // type: ['apple', 'banana', 'cherry']
26
+ * @example
27
+ * // Error: "...is missing these union members": "cherry"
28
+ * allUnionMembers<Fruit>()(['apple', 'banana']);
29
+ * @example
30
+ * // Error: 'apple' is duplicated
31
+ * allUnionMembers<Fruit>()(['apple', 'banana', 'cherry', 'apple']);
32
+ * @example
33
+ * // Error: 'date' is not a member of `Fruit`
34
+ * allUnionMembers<Fruit>()(['apple', 'banana', 'cherry', 'date']);
35
+ * @example
36
+ * // Keep the tuple `readonly`
37
+ * const readonlyFruits = allUnionMembers<Fruit, {readonly: true}>()([
38
+ * 'apple',
39
+ * 'banana',
40
+ * 'cherry',
41
+ * ]);
42
+ * // type: readonly ['apple', 'banana', 'cherry']
43
+ */
44
+ const allUnionMembers = () => (members) => members;
45
+ export { allUnionMembers };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A value or a readonly array of such values: `T | readonly T[]`.
3
+ *
4
+ * Unlike `MaybeArray`, it also accepts readonly arrays and tuples (like `as const` literals), so
5
+ * it fits parameters and options that only read the array.
6
+ * To tell the two cases apart, use `isArray`: unlike `Array.isArray`, it narrows this type in
7
+ * both branches.
8
+ * @example
9
+ * const watch = (paths: MaybeReadonlyArray<string>) => {
10
+ * const list = isArray(paths) ? paths : [paths]; // readonly string[]
11
+ * // ...
12
+ * };
13
+ *
14
+ * watch('src');
15
+ * watch(['src', 'test'] as const); // an error with `MaybeArray<string>`
16
+ */
17
+ export type MaybeReadonlyArray<T> = T | readonly T[];
@@ -0,0 +1,37 @@
1
+ import { isEqual as isEqual$1 } from "../vendor/es-toolkit/dist/predicate/isEqual.mjs";
2
+ import { isEqualWith } from "../vendor/es-toolkit/dist/predicate/isEqualWith.mjs";
3
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/value/is-equal.mjs
4
+ /**
5
+ * Performs a deep equality comparison between two values.
6
+ * Handles `Date`, `RegExp`, nested objects, arrays, `Map`, `Set`, and circular
7
+ * references.
8
+ *
9
+ * When the third argument is omitted, the values are compared with the default
10
+ * strategy.
11
+ * When a `customizer` is provided, it is invoked for every visited value-pair
12
+ * and may return `true` or `false` to override the default; returning
13
+ * `undefined` falls back to the default strategy.
14
+ * @param a - The first value to compare.
15
+ * @param b - The second value to compare.
16
+ * @param customizer - Optional comparator invoked as
17
+ * `(x, y, property, xParent, yParent, stack)` for each visited value-pair.
18
+ * @returns `true` if the values are deeply equal, otherwise `false`.
19
+ * @example
20
+ * // Basic deep equality
21
+ * isEqual({a: 1, b: [2, 3]}, {a: 1, b: [2, 3]});
22
+ * // true
23
+ * @example
24
+ * // Built-in types
25
+ * isEqual(new Date('2020-01-01'), new Date('2020-01-01'));
26
+ * // true
27
+ * @example
28
+ * // With a customizer: case-insensitive string comparison
29
+ * isEqual('Hello', 'hello', (x, y) => {
30
+ * if (typeof x === 'string' && typeof y === 'string') {
31
+ * return x.toLowerCase() === y.toLowerCase();
32
+ * }
33
+ * });
34
+ * // true
35
+ */
36
+ const isEqual = (a, b, customizer) => customizer ? isEqualWith(a, b, customizer) : isEqual$1(a, b);
37
+ export { isEqual };
@@ -0,0 +1,5 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/@antfu/utils/dist/index.mjs
2
+ function slash(str) {
3
+ return str.replace(/\\/g, "/");
4
+ }
5
+ export { slash };
@@ -0,0 +1,5 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/_internal/globalThis.mjs
2
+ const globalThis_ = typeof globalThis === "object" && globalThis || typeof window === "object" && window || typeof self === "object" && self || typeof global === "object" && global || (function() {
3
+ return this;
4
+ })();
5
+ export { globalThis_ as globalThis };
@@ -0,0 +1,40 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/differenceBy.mjs
2
+ /**
3
+ * Computes the difference between two arrays after mapping their elements through a provided function.
4
+ *
5
+ * This function takes two arrays and a mapper function. It returns a new array containing the elements
6
+ * that are present in the first array but not in the second array, based on the identity calculated
7
+ * by the mapper function.
8
+ *
9
+ * Essentially, it filters out any elements from the first array that, when
10
+ * mapped, match an element in the mapped version of the second array.
11
+ *
12
+ * @template T, U
13
+ * @param firstArr - The primary array from which to derive the difference.
14
+ * @param secondArr - The array containing elements to be excluded from the first array.
15
+ * @param mapper - The function to map the elements of both arrays. This function
16
+ * is applied to each element in both arrays, and the comparison is made based on the mapped values.
17
+ * @returns A new array containing the elements from the first array that do not have a corresponding
18
+ * mapped identity in the second array.
19
+ *
20
+ * @example
21
+ * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
22
+ * const array2 = [{ id: 2 }, { id: 4 }];
23
+ * const mapper = item => item.id;
24
+ * const result = differenceBy(array1, array2, mapper);
25
+ * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.
26
+ *
27
+ * @example
28
+ * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
29
+ * const array2 = [2, 4];
30
+ * const mapper = item => (typeof item === 'object' ? item.id : item);
31
+ * const result = differenceBy(array1, array2, mapper);
32
+ * // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result.
33
+ */
34
+ function differenceBy(firstArr, secondArr, mapper) {
35
+ const mappedSecondSet = new Set(secondArr.map((item) => mapper(item)));
36
+ return firstArr.filter((item) => {
37
+ return !mappedSecondSet.has(mapper(item));
38
+ });
39
+ }
40
+ export { differenceBy };
@@ -0,0 +1,37 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/differenceWith.mjs
2
+ /**
3
+ * Computes the difference between two arrays based on a custom equality function.
4
+ *
5
+ * This function takes two arrays and a custom comparison function. It returns a new array containing
6
+ * the elements that are present in the first array but not in the second array. The comparison to determine
7
+ * if elements are equal is made using the provided custom function.
8
+ *
9
+ * @template T, U
10
+ * @param firstArr - The array from which to get the difference.
11
+ * @param secondArr - The array containing elements to exclude from the first array.
12
+ * @param areItemsEqual - A function to determine if two items are equal.
13
+ * @returns A new array containing the elements from the first array that do not match any elements in the second array
14
+ * according to the custom equality function.
15
+ *
16
+ * @example
17
+ * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
18
+ * const array2 = [{ id: 2 }, { id: 4 }];
19
+ * const areItemsEqual = (a, b) => a.id === b.id;
20
+ * const result = differenceWith(array1, array2, areItemsEqual);
21
+ * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result.
22
+ *
23
+ * @example
24
+ * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
25
+ * const array2 = [2, 4];
26
+ * const areItemsEqual = (a, b) => a.id === b;
27
+ * const result = differenceWith(array1, array2, areItemsEqual);
28
+ * // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result.
29
+ */
30
+ function differenceWith(firstArr, secondArr, areItemsEqual) {
31
+ return firstArr.filter((firstItem) => {
32
+ return secondArr.every((secondItem) => {
33
+ return !areItemsEqual(firstItem, secondItem);
34
+ });
35
+ });
36
+ }
37
+ export { differenceWith };
@@ -0,0 +1,43 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/intersectionWith.mjs
2
+ /**
3
+ * Returns the intersection of two arrays based on a custom equality function.
4
+ *
5
+ * This function takes two arrays and a custom equality function. It returns a new array containing
6
+ * the elements from the first array that have matching elements in the second array, as determined
7
+ * by the custom equality function. It effectively filters out any elements from the first array that
8
+ * do not have corresponding matches in the second array according to the equality function.
9
+ *
10
+ * @template T - The type of elements in the first array.
11
+ * @template U - The type of elements in the second array.
12
+ * @param firstArr - The first array to compare.
13
+ * @param secondArr - The second array to compare.
14
+ * @param areItemsEqual - A custom function to determine if two elements are equal.
15
+ * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise.
16
+ * @returns A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function.
17
+ *
18
+ * @example
19
+ * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
20
+ * const array2 = [{ id: 2 }, { id: 4 }];
21
+ * const areItemsEqual = (a, b) => a.id === b.id;
22
+ * const result = intersectionWith(array1, array2, areItemsEqual);
23
+ * // result will be [{ id: 2 }] since this element has a matching id in both arrays.
24
+ *
25
+ * @example
26
+ * const array1 = [
27
+ * { id: 1, name: 'jane' },
28
+ * { id: 2, name: 'amy' },
29
+ * { id: 3, name: 'michael' },
30
+ * ];
31
+ * const array2 = [2, 4];
32
+ * const areItemsEqual = (a, b) => a.id === b;
33
+ * const result = intersectionWith(array1, array2, areItemsEqual);
34
+ * // result will be [{ id: 2, name: 'amy' }] since this element has a matching id that is equal to seconds array's element.
35
+ */
36
+ function intersectionWith(firstArr, secondArr, areItemsEqual) {
37
+ return firstArr.filter((firstItem) => {
38
+ return secondArr.some((secondItem) => {
39
+ return areItemsEqual(firstItem, secondItem);
40
+ });
41
+ });
42
+ }
43
+ export { intersectionWith };
@@ -0,0 +1,36 @@
1
+ import { differenceWith } from "./differenceWith.mjs";
2
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/array/isSubsetWith.mjs
3
+ /**
4
+ * Checks if the `subset` array is entirely contained within the `superset` array based on a custom equality function.
5
+ *
6
+ * This function takes two arrays and a custom comparison function. It returns a boolean indicating
7
+ * whether all elements in the subset array are present in the superset array, as determined by the provided
8
+ * custom equality function.
9
+ *
10
+ * @template T - The type of elements contained in the arrays.
11
+ * @param superset - The array that may contain all elements of the subset.
12
+ * @param subset - The array to check against the superset.
13
+ * @param areItemsEqual - A function to determine if two items are equal.
14
+ * @returns Returns `true` if all elements of the subset are present in the superset
15
+ * according to the custom equality function, otherwise returns `false`.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const superset = [{ id: 1 }, { id: 2 }, { id: 3 }];
20
+ * const subset = [{ id: 2 }, { id: 1 }];
21
+ * const areItemsEqual = (a, b) => a.id === b.id;
22
+ * isSubsetWith(superset, subset, areItemsEqual); // true
23
+ * ```
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * const superset = [{ id: 1 }, { id: 2 }, { id: 3 }];
28
+ * const subset = [{ id: 4 }];
29
+ * const areItemsEqual = (a, b) => a.id === b.id;
30
+ * isSubsetWith(superset, subset, areItemsEqual); // false
31
+ * ```
32
+ */
33
+ function isSubsetWith(superset, subset, areItemsEqual) {
34
+ return differenceWith(subset, superset, areItemsEqual).length === 0;
35
+ }
36
+ export { isSubsetWith };
@@ -0,0 +1,15 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/bigint/clamp.mjs
2
+ /**
3
+ * Clamps a bigint within the inclusive lower and upper bounds.
4
+ *
5
+ * @param value - The bigint to clamp.
6
+ * @param bound1 - The upper bound when called with two arguments, otherwise the lower bound.
7
+ * @param bound2 - The upper bound when called with three arguments.
8
+ * @returns The clamped bigint.
9
+ */
10
+ function clamp(value, bound1, bound2) {
11
+ if (bound2 == null) return value < bound1 ? value : bound1;
12
+ const lowerClamped = value > bound1 ? value : bound1;
13
+ return lowerClamped < bound2 ? lowerClamped : bound2;
14
+ }
15
+ export { clamp };
@@ -0,0 +1,5 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/getSymbols.mjs
2
+ function getSymbols(object) {
3
+ return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
4
+ }
5
+ export { getSymbols };
@@ -0,0 +1,13 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/getTag.mjs
2
+ /**
3
+ * Gets the `toStringTag` of `value`.
4
+ *
5
+ * @private
6
+ * @param {T} value The value to query.
7
+ * @returns {string} Returns the `Object.prototype.toString.call` result.
8
+ */
9
+ function getTag(value) {
10
+ if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
11
+ return Object.prototype.toString.call(value);
12
+ }
13
+ export { getTag };
@@ -0,0 +1,10 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/regexMultiByte.mjs
2
+ /**
3
+ * Used to compose unicode character classes.
4
+ * @link https://github.com/lodash/lodash/blob/4.17.21-es/_hasUnicode.js
5
+ *
6
+ * Used to detect strings with zero-width joiners or code points from the astral planes.
7
+ * @link http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/
8
+ */
9
+ const regexMultiByte = /* @__PURE__ */ new RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
10
+ export { regexMultiByte };
@@ -0,0 +1,27 @@
1
+ // node_modules/.pnpm/utilery@0.4.0/node_modules/utilery/dist/vendor/es-toolkit/dist/compat/_internal/tags.mjs
2
+ const regexpTag = "[object RegExp]";
3
+ const stringTag = "[object String]";
4
+ const numberTag = "[object Number]";
5
+ const booleanTag = "[object Boolean]";
6
+ const symbolTag = "[object Symbol]";
7
+ const dateTag = "[object Date]";
8
+ const mapTag = "[object Map]";
9
+ const setTag = "[object Set]";
10
+ const arrayTag = "[object Array]";
11
+ const functionTag = "[object Function]";
12
+ const arrayBufferTag = "[object ArrayBuffer]";
13
+ const objectTag = "[object Object]";
14
+ const errorTag = "[object Error]";
15
+ const dataViewTag = "[object DataView]";
16
+ const uint8ArrayTag = "[object Uint8Array]";
17
+ const uint8ClampedArrayTag = "[object Uint8ClampedArray]";
18
+ const uint16ArrayTag = "[object Uint16Array]";
19
+ const uint32ArrayTag = "[object Uint32Array]";
20
+ const bigUint64ArrayTag = "[object BigUint64Array]";
21
+ const int8ArrayTag = "[object Int8Array]";
22
+ const int16ArrayTag = "[object Int16Array]";
23
+ const int32ArrayTag = "[object Int32Array]";
24
+ const bigInt64ArrayTag = "[object BigInt64Array]";
25
+ const float32ArrayTag = "[object Float32Array]";
26
+ const float64ArrayTag = "[object Float64Array]";
27
+ export { arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };
@@ -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,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,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 };