es-toolkit 1.22.0 → 1.23.0-dev.717

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 (86) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/_chunk/{flowRight-BzdOZX.js → flowRight-Dv8J0U.js} +21 -3
  3. package/dist/_chunk/{toMerged-2WPeoI.js → isObjectLike-aywuSF.js} +20 -10
  4. package/dist/_chunk/{isPlainObject-BIekvL.js → isPlainObject-DgrsU7.js} +11 -11
  5. package/dist/_chunk/{isWeakSet-clQklw.js → isWeakSet-BAMm2l.js} +85 -22
  6. package/dist/_chunk/noop-2IwLUk.js +5 -0
  7. package/dist/_chunk/{pad-Cw2pvt.js → pad-BWiShN.js} +21 -21
  8. package/dist/browser.global.js +1 -1
  9. package/dist/browser.global.js.map +1 -1
  10. package/dist/compat/array/dropWhile.d.mts +20 -0
  11. package/dist/compat/array/dropWhile.d.ts +20 -0
  12. package/dist/compat/array/every.d.mts +11 -11
  13. package/dist/compat/array/every.d.ts +11 -11
  14. package/dist/compat/array/filter.d.mts +10 -11
  15. package/dist/compat/array/filter.d.ts +10 -11
  16. package/dist/compat/array/filter.mjs +13 -0
  17. package/dist/compat/array/includes.mjs +1 -4
  18. package/dist/compat/function/flow.d.mts +133 -0
  19. package/dist/compat/function/flow.d.ts +133 -0
  20. package/dist/compat/function/flow.mjs +12 -0
  21. package/dist/compat/function/flowRight.d.mts +145 -0
  22. package/dist/compat/function/flowRight.d.ts +145 -0
  23. package/dist/compat/function/flowRight.mjs +12 -0
  24. package/dist/compat/index.d.mts +9 -2
  25. package/dist/compat/index.d.ts +9 -2
  26. package/dist/compat/index.js +109 -49
  27. package/dist/compat/index.mjs +10 -3
  28. package/dist/compat/math/random.mjs +1 -1
  29. package/dist/compat/object/has.mjs +2 -2
  30. package/dist/compat/object/invertBy.d.mts +27 -0
  31. package/dist/compat/object/invertBy.d.ts +27 -0
  32. package/dist/compat/object/invertBy.mjs +27 -0
  33. package/dist/compat/object/mapKeys.mjs +1 -1
  34. package/dist/compat/object/mapValues.mjs +1 -1
  35. package/dist/compat/object/merge.mjs +1 -1
  36. package/dist/compat/object/mergeWith.mjs +1 -1
  37. package/dist/compat/object/omit.mjs +1 -1
  38. package/dist/compat/object/pick.mjs +2 -2
  39. package/dist/compat/object/unset.mjs +1 -1
  40. package/dist/compat/predicate/isMatch.mjs +4 -0
  41. package/dist/compat/predicate/matches.mjs +1 -1
  42. package/dist/compat/predicate/matchesProperty.mjs +1 -1
  43. package/dist/function/curryRight.d.mts +140 -0
  44. package/dist/function/curryRight.d.ts +140 -0
  45. package/dist/function/curryRight.mjs +21 -0
  46. package/dist/function/index.d.mts +1 -0
  47. package/dist/function/index.d.ts +1 -0
  48. package/dist/function/index.js +4 -2
  49. package/dist/function/index.mjs +1 -0
  50. package/dist/index.d.mts +6 -0
  51. package/dist/index.d.ts +6 -0
  52. package/dist/index.js +23 -16
  53. package/dist/index.mjs +6 -0
  54. package/dist/object/clone.mjs +1 -1
  55. package/dist/object/cloneDeep.mjs +2 -2
  56. package/dist/object/index.js +13 -13
  57. package/dist/object/merge.mjs +14 -4
  58. package/dist/object/pick.mjs +1 -1
  59. package/dist/predicate/index.d.mts +5 -0
  60. package/dist/predicate/index.d.ts +5 -0
  61. package/dist/predicate/index.js +7 -2
  62. package/dist/predicate/index.mjs +5 -0
  63. package/dist/predicate/isArrayBuffer.d.mts +20 -0
  64. package/dist/predicate/isArrayBuffer.d.ts +20 -0
  65. package/dist/predicate/isArrayBuffer.mjs +5 -0
  66. package/dist/predicate/isEqual.mjs +3 -171
  67. package/dist/predicate/isEqualWith.d.mts +38 -0
  68. package/dist/predicate/isEqualWith.d.ts +38 -0
  69. package/dist/predicate/isEqualWith.mjs +184 -0
  70. package/dist/predicate/isJSONArray.d.mts +17 -0
  71. package/dist/predicate/isJSONArray.d.ts +17 -0
  72. package/dist/predicate/isJSONArray.mjs +10 -0
  73. package/dist/predicate/isJSONObject.d.mts +16 -0
  74. package/dist/predicate/isJSONObject.d.ts +16 -0
  75. package/dist/predicate/isJSONObject.mjs +22 -0
  76. package/dist/predicate/isJSONValue.d.mts +27 -0
  77. package/dist/predicate/isJSONValue.d.ts +27 -0
  78. package/dist/predicate/isJSONValue.mjs +20 -0
  79. package/dist/predicate/isPlainObject.d.mts +3 -3
  80. package/dist/predicate/isPlainObject.d.ts +3 -3
  81. package/dist/predicate/isPlainObject.mjs +7 -7
  82. package/dist/string/_internal/getWords.mjs +1 -1
  83. package/dist/string/camelCase.mjs +1 -1
  84. package/dist/string/index.js +1 -1
  85. package/dist/string/trim.mjs +1 -1
  86. package/package.json +11 -3
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
3
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
4
+ *
5
+ * Unlike `curry`, this function curries the function from right to left.
6
+ *
7
+ * @param {() => R} func - The function to curry.
8
+ * @returns {() => R} A curried function.
9
+ *
10
+ * @example
11
+ * function noArgFunc() {
12
+ * return 42;
13
+ * }
14
+ * const curriedNoArgFunc = curryRight(noArgFunc);
15
+ * console.log(curriedNoArgFunc()); // 42
16
+ */
17
+ declare function curryRight<R>(func: () => R): () => R;
18
+ /**
19
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
20
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
21
+ *
22
+ * Unlike `curry`, this function curries the function from right to left.
23
+ *
24
+ * @param {(p: P) => R} func - The function to curry.
25
+ * @returns {(p: P) => R} A curried function.
26
+ *
27
+ * @example
28
+ * function oneArgFunc(a: number) {
29
+ * return a * 2;
30
+ * }
31
+ * const curriedOneArgFunc = curryRight(oneArgFunc);
32
+ * console.log(curriedOneArgFunc(5)); // 10
33
+ */
34
+ declare function curryRight<P, R>(func: (p: P) => R): (p: P) => R;
35
+ /**
36
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
37
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
38
+ *
39
+ * Unlike `curry`, this function curries the function from right to left.
40
+ *
41
+ * @param {(p1: P1, p2: P2) => R} func - The function to curry.
42
+ * @returns {(p2: P2) => (p1: P1) => R} A curried function.
43
+ *
44
+ * @example
45
+ * function twoArgFunc(a: number, b: number) {
46
+ * return [a, b];
47
+ * }
48
+ * const curriedTwoArgFunc = curryRight(twoArgFunc);
49
+ * const func = curriedTwoArgFunc(1);
50
+ * console.log(func(2)); // [2, 1]
51
+ */
52
+ declare function curryRight<P1, P2, R>(func: (p1: P1, p2: P2) => R): (p2: P2) => (p1: P1) => R;
53
+ /**
54
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
55
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
56
+ *
57
+ * Unlike `curry`, this function curries the function from right to left.
58
+ *
59
+ * @param {(p1: P1, p2: P2, p3: P3) => R} func - The function to curry.
60
+ * @returns {(p3: P3) => (p2: P2) => (p1: P1) => R} A curried function.
61
+ *
62
+ * @example
63
+ * function threeArgFunc(a: number, b: number, c: number) {
64
+ * return [a, b, c];
65
+ * }
66
+ * const curriedThreeArgFunc = curryRight(threeArgFunc);
67
+ * const func = curriedThreeArgFunc(1);
68
+ * const func2 = func(2);
69
+ * console.log(func2(3)); // [3, 2, 1]
70
+ */
71
+ declare function curryRight<P1, P2, P3, R>(func: (p1: P1, p2: P2, p3: P3) => R): (p3: P3) => (p2: P2) => (p1: P1) => R;
72
+ /**
73
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
74
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
75
+ *
76
+ * Unlike `curry`, this function curries the function from right to left.
77
+ *
78
+ * @param {(p1: P1, p2: P2, p3: P3, p4: P4) => R} func - The function to curry.
79
+ * @returns {(p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R} A curried function.
80
+ *
81
+ * @example
82
+ * function fourArgFunc(a: number, b: number, c: number, d: number) {
83
+ * return [a, b, c, d];
84
+ * }
85
+ * const curriedFourArgFunc = curryRight(fourArgFunc);
86
+ * const func = curriedFourArgFunc(1);
87
+ * const func2 = func(2);
88
+ * const func3 = func2(3);
89
+ * console.log(func3(4)); // [4, 3, 2, 1]
90
+ */
91
+ declare function curryRight<P1, P2, P3, P4, R>(func: (p1: P1, p2: P2, p3: P3, p4: P4) => R): (p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R;
92
+ /**
93
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
94
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
95
+ *
96
+ * Unlike `curry`, this function curries the function from right to left.
97
+ *
98
+ * @param {(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => R} func - The function to curry.
99
+ * @returns {(p5: P5) => (p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R} A curried function.
100
+ *
101
+ * @example
102
+ * function fiveArgFunc(a: number, b: number, c: number, d: number, e: number) {
103
+ * return [a, b, c, d, e];
104
+ * }
105
+ * const curriedFiveArgFunc = curryRight(fiveArgFunc);
106
+ * const func = curriedFiveArgFunc(1);
107
+ * const func2 = func(2);
108
+ * const func3 = func2(3);
109
+ * const func4 = func3(4);
110
+ * console.log(func4(5)); // [5, 4, 3, 2, 1]
111
+ */
112
+ declare function curryRight<P1, P2, P3, P4, P5, R>(func: (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => R): (p5: P5) => (p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R;
113
+ /**
114
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
115
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
116
+ *
117
+ * Unlike `curry`, this function curries the function from right to left.
118
+ *
119
+ * @param {(...args: any[]) => any} func - The function to curry.
120
+ * @returns {(...args: any[]) => any} A curried function.
121
+ *
122
+ * @example
123
+ * function sum(a: number, b: number, c: number) {
124
+ * return a + b + c;
125
+ * }
126
+ *
127
+ * const curriedSum = curryRight(sum);
128
+ *
129
+ * // The parameter `c` should be given the value `10`.
130
+ * const add10 = curriedSum(10);
131
+ *
132
+ * // The parameter `b` should be given the value `15`.
133
+ * const add25 = add10(15);
134
+ *
135
+ * // The parameter `a` should be given the value `5`. The function 'sum' has received all its arguments and will now return a value.
136
+ * const result = add25(5); // 30
137
+ */
138
+ declare function curryRight(func: (...args: any[]) => any): (...args: any[]) => any;
139
+
140
+ export { curryRight };
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
3
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
4
+ *
5
+ * Unlike `curry`, this function curries the function from right to left.
6
+ *
7
+ * @param {() => R} func - The function to curry.
8
+ * @returns {() => R} A curried function.
9
+ *
10
+ * @example
11
+ * function noArgFunc() {
12
+ * return 42;
13
+ * }
14
+ * const curriedNoArgFunc = curryRight(noArgFunc);
15
+ * console.log(curriedNoArgFunc()); // 42
16
+ */
17
+ declare function curryRight<R>(func: () => R): () => R;
18
+ /**
19
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
20
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
21
+ *
22
+ * Unlike `curry`, this function curries the function from right to left.
23
+ *
24
+ * @param {(p: P) => R} func - The function to curry.
25
+ * @returns {(p: P) => R} A curried function.
26
+ *
27
+ * @example
28
+ * function oneArgFunc(a: number) {
29
+ * return a * 2;
30
+ * }
31
+ * const curriedOneArgFunc = curryRight(oneArgFunc);
32
+ * console.log(curriedOneArgFunc(5)); // 10
33
+ */
34
+ declare function curryRight<P, R>(func: (p: P) => R): (p: P) => R;
35
+ /**
36
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
37
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
38
+ *
39
+ * Unlike `curry`, this function curries the function from right to left.
40
+ *
41
+ * @param {(p1: P1, p2: P2) => R} func - The function to curry.
42
+ * @returns {(p2: P2) => (p1: P1) => R} A curried function.
43
+ *
44
+ * @example
45
+ * function twoArgFunc(a: number, b: number) {
46
+ * return [a, b];
47
+ * }
48
+ * const curriedTwoArgFunc = curryRight(twoArgFunc);
49
+ * const func = curriedTwoArgFunc(1);
50
+ * console.log(func(2)); // [2, 1]
51
+ */
52
+ declare function curryRight<P1, P2, R>(func: (p1: P1, p2: P2) => R): (p2: P2) => (p1: P1) => R;
53
+ /**
54
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
55
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
56
+ *
57
+ * Unlike `curry`, this function curries the function from right to left.
58
+ *
59
+ * @param {(p1: P1, p2: P2, p3: P3) => R} func - The function to curry.
60
+ * @returns {(p3: P3) => (p2: P2) => (p1: P1) => R} A curried function.
61
+ *
62
+ * @example
63
+ * function threeArgFunc(a: number, b: number, c: number) {
64
+ * return [a, b, c];
65
+ * }
66
+ * const curriedThreeArgFunc = curryRight(threeArgFunc);
67
+ * const func = curriedThreeArgFunc(1);
68
+ * const func2 = func(2);
69
+ * console.log(func2(3)); // [3, 2, 1]
70
+ */
71
+ declare function curryRight<P1, P2, P3, R>(func: (p1: P1, p2: P2, p3: P3) => R): (p3: P3) => (p2: P2) => (p1: P1) => R;
72
+ /**
73
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
74
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
75
+ *
76
+ * Unlike `curry`, this function curries the function from right to left.
77
+ *
78
+ * @param {(p1: P1, p2: P2, p3: P3, p4: P4) => R} func - The function to curry.
79
+ * @returns {(p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R} A curried function.
80
+ *
81
+ * @example
82
+ * function fourArgFunc(a: number, b: number, c: number, d: number) {
83
+ * return [a, b, c, d];
84
+ * }
85
+ * const curriedFourArgFunc = curryRight(fourArgFunc);
86
+ * const func = curriedFourArgFunc(1);
87
+ * const func2 = func(2);
88
+ * const func3 = func2(3);
89
+ * console.log(func3(4)); // [4, 3, 2, 1]
90
+ */
91
+ declare function curryRight<P1, P2, P3, P4, R>(func: (p1: P1, p2: P2, p3: P3, p4: P4) => R): (p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R;
92
+ /**
93
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
94
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
95
+ *
96
+ * Unlike `curry`, this function curries the function from right to left.
97
+ *
98
+ * @param {(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => R} func - The function to curry.
99
+ * @returns {(p5: P5) => (p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R} A curried function.
100
+ *
101
+ * @example
102
+ * function fiveArgFunc(a: number, b: number, c: number, d: number, e: number) {
103
+ * return [a, b, c, d, e];
104
+ * }
105
+ * const curriedFiveArgFunc = curryRight(fiveArgFunc);
106
+ * const func = curriedFiveArgFunc(1);
107
+ * const func2 = func(2);
108
+ * const func3 = func2(3);
109
+ * const func4 = func3(4);
110
+ * console.log(func4(5)); // [5, 4, 3, 2, 1]
111
+ */
112
+ declare function curryRight<P1, P2, P3, P4, P5, R>(func: (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => R): (p5: P5) => (p4: P4) => (p3: P3) => (p2: P2) => (p1: P1) => R;
113
+ /**
114
+ * Curries a function, allowing it to be called with a single argument at a time and returning a new function that takes the next argument.
115
+ * This process continues until all arguments have been provided, at which point the original function is called with all accumulated arguments.
116
+ *
117
+ * Unlike `curry`, this function curries the function from right to left.
118
+ *
119
+ * @param {(...args: any[]) => any} func - The function to curry.
120
+ * @returns {(...args: any[]) => any} A curried function.
121
+ *
122
+ * @example
123
+ * function sum(a: number, b: number, c: number) {
124
+ * return a + b + c;
125
+ * }
126
+ *
127
+ * const curriedSum = curryRight(sum);
128
+ *
129
+ * // The parameter `c` should be given the value `10`.
130
+ * const add10 = curriedSum(10);
131
+ *
132
+ * // The parameter `b` should be given the value `15`.
133
+ * const add25 = add10(15);
134
+ *
135
+ * // The parameter `a` should be given the value `5`. The function 'sum' has received all its arguments and will now return a value.
136
+ * const result = add25(5); // 30
137
+ */
138
+ declare function curryRight(func: (...args: any[]) => any): (...args: any[]) => any;
139
+
140
+ export { curryRight };
@@ -0,0 +1,21 @@
1
+ function curryRight(func) {
2
+ if (func.length === 0 || func.length === 1) {
3
+ return func;
4
+ }
5
+ return function (arg) {
6
+ return makeCurryRight(func, func.length, [arg]);
7
+ };
8
+ }
9
+ function makeCurryRight(origin, argsLength, args) {
10
+ if (args.length === argsLength) {
11
+ return origin(...args);
12
+ }
13
+ else {
14
+ const next = function (arg) {
15
+ return makeCurryRight(origin, argsLength, [arg, ...args]);
16
+ };
17
+ return next;
18
+ }
19
+ }
20
+
21
+ export { curryRight };
@@ -12,6 +12,7 @@ export { partial } from './partial.mjs';
12
12
  export { partialRight } from './partialRight.mjs';
13
13
  export { rest } from './rest.mjs';
14
14
  export { curry } from './curry.mjs';
15
+ export { curryRight } from './curryRight.mjs';
15
16
  export { spread } from './spread.mjs';
16
17
  export { flow } from './flow.mjs';
17
18
  export { flowRight } from './flowRight.mjs';
@@ -12,6 +12,7 @@ export { partial } from './partial.js';
12
12
  export { partialRight } from './partialRight.js';
13
13
  export { rest } from './rest.js';
14
14
  export { curry } from './curry.js';
15
+ export { curryRight } from './curryRight.js';
15
16
  export { spread } from './spread.js';
16
17
  export { flow } from './flow.js';
17
18
  export { flowRight } from './flowRight.js';
@@ -2,7 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const flowRight = require('../_chunk/flowRight-BzdOZX.js');
5
+ const flowRight = require('../_chunk/flowRight-Dv8J0U.js');
6
+ const noop = require('../_chunk/noop-2IwLUk.js');
6
7
 
7
8
  function throttle(func, throttleMs, { signal, edges = ['leading', 'trailing'] } = {}) {
8
9
  let pendingAt = null;
@@ -54,17 +55,18 @@ function spread(func) {
54
55
  exports.after = flowRight.after;
55
56
  exports.ary = flowRight.ary;
56
57
  exports.before = flowRight.before;
58
+ exports.curryRight = flowRight.curryRight;
57
59
  exports.debounce = flowRight.debounce;
58
60
  exports.flow = flowRight.flow;
59
61
  exports.flowRight = flowRight.flowRight;
60
62
  exports.memoize = flowRight.memoize;
61
63
  exports.negate = flowRight.negate;
62
- exports.noop = flowRight.noop;
63
64
  exports.once = flowRight.once;
64
65
  exports.partial = flowRight.partial;
65
66
  exports.partialRight = flowRight.partialRight;
66
67
  exports.rest = flowRight.rest;
67
68
  exports.unary = flowRight.unary;
69
+ exports.noop = noop.noop;
68
70
  exports.curry = curry;
69
71
  exports.spread = spread;
70
72
  exports.throttle = throttle;
@@ -12,6 +12,7 @@ export { partial } from './partial.mjs';
12
12
  export { partialRight } from './partialRight.mjs';
13
13
  export { rest } from './rest.mjs';
14
14
  export { curry } from './curry.mjs';
15
+ export { curryRight } from './curryRight.mjs';
15
16
  export { spread } from './spread.mjs';
16
17
  export { flow } from './flow.mjs';
17
18
  export { flowRight } from './flowRight.mjs';
package/dist/index.d.mts CHANGED
@@ -70,6 +70,7 @@ export { partial } from './function/partial.mjs';
70
70
  export { partialRight } from './function/partialRight.mjs';
71
71
  export { rest } from './function/rest.mjs';
72
72
  export { curry } from './function/curry.mjs';
73
+ export { curryRight } from './function/curryRight.mjs';
73
74
  export { spread } from './function/spread.mjs';
74
75
  export { flow } from './function/flow.mjs';
75
76
  export { flowRight } from './function/flowRight.mjs';
@@ -96,8 +97,10 @@ export { cloneDeep } from './object/cloneDeep.mjs';
96
97
  export { merge } from './object/merge.mjs';
97
98
  export { toMerged } from './object/toMerged.mjs';
98
99
  export { mergeWith } from './object/mergeWith.mjs';
100
+ export { isArrayBuffer } from './predicate/isArrayBuffer.mjs';
99
101
  export { isDate } from './predicate/isDate.mjs';
100
102
  export { isEqual } from './predicate/isEqual.mjs';
103
+ export { isEqualWith } from './predicate/isEqualWith.mjs';
101
104
  export { isError } from './predicate/isError.mjs';
102
105
  export { isMap } from './predicate/isMap.mjs';
103
106
  export { isNil } from './predicate/isNil.mjs';
@@ -113,6 +116,9 @@ export { isRegExp } from './predicate/isRegExp.mjs';
113
116
  export { isBoolean } from './predicate/isBoolean.mjs';
114
117
  export { isSymbol } from './predicate/isSymbol.mjs';
115
118
  export { isString } from './predicate/isString.mjs';
119
+ export { isJSONObject } from './predicate/isJSONObject.mjs';
120
+ export { isJSONValue } from './predicate/isJSONValue.mjs';
121
+ export { isJSONArray } from './predicate/isJSONArray.mjs';
116
122
  export { isSet } from './predicate/isSet.mjs';
117
123
  export { isWeakMap } from './predicate/isWeakMap.mjs';
118
124
  export { isWeakSet } from './predicate/isWeakSet.mjs';
package/dist/index.d.ts CHANGED
@@ -70,6 +70,7 @@ export { partial } from './function/partial.js';
70
70
  export { partialRight } from './function/partialRight.js';
71
71
  export { rest } from './function/rest.js';
72
72
  export { curry } from './function/curry.js';
73
+ export { curryRight } from './function/curryRight.js';
73
74
  export { spread } from './function/spread.js';
74
75
  export { flow } from './function/flow.js';
75
76
  export { flowRight } from './function/flowRight.js';
@@ -96,8 +97,10 @@ export { cloneDeep } from './object/cloneDeep.js';
96
97
  export { merge } from './object/merge.js';
97
98
  export { toMerged } from './object/toMerged.js';
98
99
  export { mergeWith } from './object/mergeWith.js';
100
+ export { isArrayBuffer } from './predicate/isArrayBuffer.js';
99
101
  export { isDate } from './predicate/isDate.js';
100
102
  export { isEqual } from './predicate/isEqual.js';
103
+ export { isEqualWith } from './predicate/isEqualWith.js';
101
104
  export { isError } from './predicate/isError.js';
102
105
  export { isMap } from './predicate/isMap.js';
103
106
  export { isNil } from './predicate/isNil.js';
@@ -113,6 +116,9 @@ export { isRegExp } from './predicate/isRegExp.js';
113
116
  export { isBoolean } from './predicate/isBoolean.js';
114
117
  export { isSymbol } from './predicate/isSymbol.js';
115
118
  export { isString } from './predicate/isString.js';
119
+ export { isJSONObject } from './predicate/isJSONObject.js';
120
+ export { isJSONValue } from './predicate/isJSONValue.js';
121
+ export { isJSONArray } from './predicate/isJSONArray.js';
116
122
  export { isSet } from './predicate/isSet.js';
117
123
  export { isWeakMap } from './predicate/isWeakMap.js';
118
124
  export { isWeakSet } from './predicate/isWeakSet.js';
package/dist/index.js CHANGED
@@ -5,17 +5,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const zipWith = require('./_chunk/zipWith-EOU_KZ.js');
6
6
  const array_index = require('./array/index.js');
7
7
  const promise_index = require('./_chunk/index-BGZDR9.js');
8
- const flowRight = require('./_chunk/flowRight-BzdOZX.js');
8
+ const flowRight = require('./_chunk/flowRight-Dv8J0U.js');
9
+ const noop = require('./_chunk/noop-2IwLUk.js');
9
10
  const function_index = require('./function/index.js');
10
11
  const range = require('./_chunk/range-BXlMmn.js');
11
12
  const randomInt = require('./_chunk/randomInt-CF7bZK.js');
12
13
  const math_index = require('./math/index.js');
13
14
  const object_index = require('./object/index.js');
14
- const toMerged = require('./_chunk/toMerged-2WPeoI.js');
15
- const isWeakSet = require('./_chunk/isWeakSet-clQklw.js');
15
+ const isObjectLike = require('./_chunk/isObjectLike-aywuSF.js');
16
+ const isWeakSet = require('./_chunk/isWeakSet-BAMm2l.js');
16
17
  const predicate_index = require('./predicate/index.js');
17
- const isPlainObject = require('./_chunk/isPlainObject-BIekvL.js');
18
- const pad = require('./_chunk/pad-Cw2pvt.js');
18
+ const isPlainObject = require('./_chunk/isPlainObject-DgrsU7.js');
19
+ const pad = require('./_chunk/pad-BWiShN.js');
19
20
  const string_index = require('./string/index.js');
20
21
 
21
22
 
@@ -84,17 +85,18 @@ exports.withTimeout = promise_index.withTimeout;
84
85
  exports.after = flowRight.after;
85
86
  exports.ary = flowRight.ary;
86
87
  exports.before = flowRight.before;
88
+ exports.curryRight = flowRight.curryRight;
87
89
  exports.debounce = flowRight.debounce;
88
90
  exports.flow = flowRight.flow;
89
91
  exports.flowRight = flowRight.flowRight;
90
92
  exports.memoize = flowRight.memoize;
91
93
  exports.negate = flowRight.negate;
92
- exports.noop = flowRight.noop;
93
94
  exports.once = flowRight.once;
94
95
  exports.partial = flowRight.partial;
95
96
  exports.partialRight = flowRight.partialRight;
96
97
  exports.rest = flowRight.rest;
97
98
  exports.unary = flowRight.unary;
99
+ exports.noop = noop.noop;
98
100
  exports.curry = function_index.curry;
99
101
  exports.spread = function_index.spread;
100
102
  exports.throttle = function_index.throttle;
@@ -111,19 +113,24 @@ exports.round = math_index.round;
111
113
  exports.mergeWith = object_index.mergeWith;
112
114
  exports.omit = object_index.omit;
113
115
  exports.pick = object_index.pick;
114
- exports.clone = toMerged.clone;
115
- exports.cloneDeep = toMerged.cloneDeep;
116
- exports.flattenObject = toMerged.flattenObject;
117
- exports.invert = toMerged.invert;
118
- exports.mapKeys = toMerged.mapKeys;
119
- exports.mapValues = toMerged.mapValues;
120
- exports.merge = toMerged.merge;
121
- exports.omitBy = toMerged.omitBy;
122
- exports.pickBy = toMerged.pickBy;
123
- exports.toMerged = toMerged.toMerged;
116
+ exports.clone = isObjectLike.clone;
117
+ exports.cloneDeep = isObjectLike.cloneDeep;
118
+ exports.flattenObject = isObjectLike.flattenObject;
119
+ exports.invert = isObjectLike.invert;
120
+ exports.mapKeys = isObjectLike.mapKeys;
121
+ exports.mapValues = isObjectLike.mapValues;
122
+ exports.merge = isObjectLike.merge;
123
+ exports.omitBy = isObjectLike.omitBy;
124
+ exports.pickBy = isObjectLike.pickBy;
125
+ exports.toMerged = isObjectLike.toMerged;
126
+ exports.isArrayBuffer = isWeakSet.isArrayBuffer;
124
127
  exports.isDate = isWeakSet.isDate;
125
128
  exports.isEqual = isWeakSet.isEqual;
129
+ exports.isEqualWith = isWeakSet.isEqualWith;
126
130
  exports.isFunction = isWeakSet.isFunction;
131
+ exports.isJSONArray = isWeakSet.isJSONArray;
132
+ exports.isJSONObject = isWeakSet.isJSONObject;
133
+ exports.isJSONValue = isWeakSet.isJSONValue;
127
134
  exports.isLength = isWeakSet.isLength;
128
135
  exports.isMap = isWeakSet.isMap;
129
136
  exports.isNil = isWeakSet.isNil;
package/dist/index.mjs CHANGED
@@ -70,6 +70,7 @@ export { partial } from './function/partial.mjs';
70
70
  export { partialRight } from './function/partialRight.mjs';
71
71
  export { rest } from './function/rest.mjs';
72
72
  export { curry } from './function/curry.mjs';
73
+ export { curryRight } from './function/curryRight.mjs';
73
74
  export { spread } from './function/spread.mjs';
74
75
  export { flow } from './function/flow.mjs';
75
76
  export { flowRight } from './function/flowRight.mjs';
@@ -96,8 +97,10 @@ export { cloneDeep } from './object/cloneDeep.mjs';
96
97
  export { merge } from './object/merge.mjs';
97
98
  export { toMerged } from './object/toMerged.mjs';
98
99
  export { mergeWith } from './object/mergeWith.mjs';
100
+ export { isArrayBuffer } from './predicate/isArrayBuffer.mjs';
99
101
  export { isDate } from './predicate/isDate.mjs';
100
102
  export { isEqual } from './predicate/isEqual.mjs';
103
+ export { isEqualWith } from './predicate/isEqualWith.mjs';
101
104
  export { isError } from './predicate/isError.mjs';
102
105
  export { isMap } from './predicate/isMap.mjs';
103
106
  export { isNil } from './predicate/isNil.mjs';
@@ -113,6 +116,9 @@ export { isRegExp } from './predicate/isRegExp.mjs';
113
116
  export { isBoolean } from './predicate/isBoolean.mjs';
114
117
  export { isSymbol } from './predicate/isSymbol.mjs';
115
118
  export { isString } from './predicate/isString.mjs';
119
+ export { isJSONObject } from './predicate/isJSONObject.mjs';
120
+ export { isJSONValue } from './predicate/isJSONValue.mjs';
121
+ export { isJSONArray } from './predicate/isJSONArray.mjs';
116
122
  export { isSet } from './predicate/isSet.mjs';
117
123
  export { isWeakMap } from './predicate/isWeakMap.mjs';
118
124
  export { isWeakSet } from './predicate/isWeakSet.mjs';
@@ -1,5 +1,5 @@
1
- import { isTypedArray } from '../predicate/isTypedArray.mjs';
2
1
  import { isPrimitive } from '../predicate/isPrimitive.mjs';
2
+ import { isTypedArray } from '../predicate/isTypedArray.mjs';
3
3
 
4
4
  function clone(obj) {
5
5
  if (isPrimitive(obj)) {
@@ -17,10 +17,10 @@ function cloneDeepImpl(obj, stack = new Map()) {
17
17
  for (let i = 0; i < obj.length; i++) {
18
18
  result[i] = cloneDeepImpl(obj[i], stack);
19
19
  }
20
- if (Object.prototype.hasOwnProperty.call(obj, 'index')) {
20
+ if (Object.hasOwn(obj, 'index')) {
21
21
  result.index = obj.index;
22
22
  }
23
- if (Object.prototype.hasOwnProperty.call(obj, 'input')) {
23
+ if (Object.hasOwn(obj, 'input')) {
24
24
  result.input = obj.input;
25
25
  }
26
26
  return result;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const toMerged = require('../_chunk/toMerged-2WPeoI.js');
5
+ const isObjectLike = require('../_chunk/isObjectLike-aywuSF.js');
6
6
 
7
7
  function omit(obj, keys) {
8
8
  const result = { ...obj };
@@ -17,7 +17,7 @@ function pick(obj, keys) {
17
17
  const result = {};
18
18
  for (let i = 0; i < keys.length; i++) {
19
19
  const key = keys[i];
20
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
20
+ if (Object.hasOwn(obj, key)) {
21
21
  result[key] = obj[key];
22
22
  }
23
23
  }
@@ -37,7 +37,7 @@ function mergeWith(target, source, merge) {
37
37
  else if (Array.isArray(sourceValue)) {
38
38
  target[key] = mergeWith(targetValue ?? [], sourceValue, merge);
39
39
  }
40
- else if (toMerged.isObjectLike(targetValue) && toMerged.isObjectLike(sourceValue)) {
40
+ else if (isObjectLike.isObjectLike(targetValue) && isObjectLike.isObjectLike(sourceValue)) {
41
41
  target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);
42
42
  }
43
43
  else if (targetValue === undefined || sourceValue !== undefined) {
@@ -47,16 +47,16 @@ function mergeWith(target, source, merge) {
47
47
  return target;
48
48
  }
49
49
 
50
- exports.clone = toMerged.clone;
51
- exports.cloneDeep = toMerged.cloneDeep;
52
- exports.flattenObject = toMerged.flattenObject;
53
- exports.invert = toMerged.invert;
54
- exports.mapKeys = toMerged.mapKeys;
55
- exports.mapValues = toMerged.mapValues;
56
- exports.merge = toMerged.merge;
57
- exports.omitBy = toMerged.omitBy;
58
- exports.pickBy = toMerged.pickBy;
59
- exports.toMerged = toMerged.toMerged;
50
+ exports.clone = isObjectLike.clone;
51
+ exports.cloneDeep = isObjectLike.cloneDeep;
52
+ exports.flattenObject = isObjectLike.flattenObject;
53
+ exports.invert = isObjectLike.invert;
54
+ exports.mapKeys = isObjectLike.mapKeys;
55
+ exports.mapValues = isObjectLike.mapValues;
56
+ exports.merge = isObjectLike.merge;
57
+ exports.omitBy = isObjectLike.omitBy;
58
+ exports.pickBy = isObjectLike.pickBy;
59
+ exports.toMerged = isObjectLike.toMerged;
60
60
  exports.mergeWith = mergeWith;
61
61
  exports.omit = omit;
62
62
  exports.pick = pick;
@@ -1,4 +1,4 @@
1
- import { isObjectLike } from '../compat/predicate/isObjectLike.mjs';
1
+ import { isPlainObject } from '../predicate/isPlainObject.mjs';
2
2
 
3
3
  function merge(target, source) {
4
4
  const sourceKeys = Object.keys(source);
@@ -7,10 +7,20 @@ function merge(target, source) {
7
7
  const sourceValue = source[key];
8
8
  const targetValue = target[key];
9
9
  if (Array.isArray(sourceValue)) {
10
- target[key] = merge(targetValue ?? [], sourceValue);
10
+ if (Array.isArray(targetValue)) {
11
+ target[key] = merge(targetValue, sourceValue);
12
+ }
13
+ else {
14
+ target[key] = merge([], sourceValue);
15
+ }
11
16
  }
12
- else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {
13
- target[key] = merge(targetValue ?? {}, sourceValue);
17
+ else if (isPlainObject(sourceValue)) {
18
+ if (isPlainObject(targetValue)) {
19
+ target[key] = merge(targetValue, sourceValue);
20
+ }
21
+ else {
22
+ target[key] = merge({}, sourceValue);
23
+ }
14
24
  }
15
25
  else if (targetValue === undefined || sourceValue !== undefined) {
16
26
  target[key] = sourceValue;
@@ -2,7 +2,7 @@ function pick(obj, keys) {
2
2
  const result = {};
3
3
  for (let i = 0; i < keys.length; i++) {
4
4
  const key = keys[i];
5
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
5
+ if (Object.hasOwn(obj, key)) {
6
6
  result[key] = obj[key];
7
7
  }
8
8
  }
@@ -1,5 +1,7 @@
1
+ export { isArrayBuffer } from './isArrayBuffer.mjs';
1
2
  export { isDate } from './isDate.mjs';
2
3
  export { isEqual } from './isEqual.mjs';
4
+ export { isEqualWith } from './isEqualWith.mjs';
3
5
  export { isError } from './isError.mjs';
4
6
  export { isMap } from './isMap.mjs';
5
7
  export { isNil } from './isNil.mjs';
@@ -15,6 +17,9 @@ export { isRegExp } from './isRegExp.mjs';
15
17
  export { isBoolean } from './isBoolean.mjs';
16
18
  export { isSymbol } from './isSymbol.mjs';
17
19
  export { isString } from './isString.mjs';
20
+ export { isJSONObject } from './isJSONObject.mjs';
21
+ export { isJSONValue } from './isJSONValue.mjs';
22
+ export { isJSONArray } from './isJSONArray.mjs';
18
23
  export { isSet } from './isSet.mjs';
19
24
  export { isWeakMap } from './isWeakMap.mjs';
20
25
  export { isWeakSet } from './isWeakSet.mjs';