es-toolkit 1.49.0-dev.1956 → 1.49.0-dev.1959

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 (54) hide show
  1. package/dist/browser.global.js +2 -2
  2. package/dist/compat/_internal/assignValue.js +2 -3
  3. package/dist/compat/_internal/assignValue.mjs +2 -3
  4. package/dist/compat/_internal/isIterateeCall.js +2 -3
  5. package/dist/compat/_internal/isIterateeCall.mjs +2 -3
  6. package/dist/compat/array/includes.js +8 -3
  7. package/dist/compat/array/includes.mjs +8 -3
  8. package/dist/compat/array/intersectionWith.js +2 -3
  9. package/dist/compat/array/intersectionWith.mjs +2 -3
  10. package/dist/compat/array/pullAllWith.js +2 -3
  11. package/dist/compat/array/pullAllWith.mjs +2 -3
  12. package/dist/compat/array/sortedIndexOf.js +2 -3
  13. package/dist/compat/array/sortedIndexOf.mjs +2 -3
  14. package/dist/compat/array/sortedLastIndexOf.js +2 -3
  15. package/dist/compat/array/sortedLastIndexOf.mjs +2 -3
  16. package/dist/compat/compat.d.mts +4 -3
  17. package/dist/compat/compat.d.ts +4 -3
  18. package/dist/compat/compat.js +4 -5
  19. package/dist/compat/compat.mjs +4 -5
  20. package/dist/compat/index.d.mts +4 -3
  21. package/dist/compat/index.d.ts +4 -3
  22. package/dist/compat/index.js +4 -3
  23. package/dist/compat/index.mjs +4 -3
  24. package/dist/compat/object/assign.js +2 -3
  25. package/dist/compat/object/assign.mjs +2 -3
  26. package/dist/compat/object/assignIn.js +2 -3
  27. package/dist/compat/object/assignIn.mjs +2 -3
  28. package/dist/compat/object/assignInWith.js +2 -3
  29. package/dist/compat/object/assignInWith.mjs +2 -3
  30. package/dist/compat/object/assignWith.js +2 -3
  31. package/dist/compat/object/assignWith.mjs +2 -3
  32. package/dist/compat/object/defaults.js +2 -3
  33. package/dist/compat/object/defaults.mjs +2 -3
  34. package/dist/compat/predicate/isMatchWith.js +4 -5
  35. package/dist/compat/predicate/isMatchWith.mjs +4 -5
  36. package/dist/compat/string/template.d.mts +1 -1
  37. package/dist/compat/string/template.d.ts +1 -1
  38. package/dist/compat/string/templateSettings.d.mts +18 -1
  39. package/dist/compat/string/templateSettings.d.ts +18 -1
  40. package/dist/compat/string/templateSettings.js +4 -1
  41. package/dist/compat/string/templateSettings.mjs +5 -1
  42. package/dist/compat/util/eq.d.mts +17 -1
  43. package/dist/compat/util/eq.d.ts +17 -1
  44. package/dist/compat/util/eq.js +19 -1
  45. package/dist/compat/util/eq.mjs +19 -1
  46. package/dist/map/hasValue.js +2 -2
  47. package/dist/map/hasValue.mjs +2 -2
  48. package/dist/predicate/isEqualWith.js +2 -3
  49. package/dist/predicate/isEqualWith.mjs +2 -3
  50. package/package.json +1 -1
  51. package/dist/_internal/isEqualsSameValueZero.d.mts +0 -17
  52. package/dist/_internal/isEqualsSameValueZero.d.ts +0 -17
  53. package/dist/_internal/isEqualsSameValueZero.js +0 -19
  54. package/dist/_internal/isEqualsSameValueZero.mjs +0 -19
@@ -1 +1,17 @@
1
- import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs";
1
+ //#region src/compat/util/eq.d.ts
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
+ declare function eq(value: any, other: any): boolean;
16
+ //#endregion
17
+ export { eq };
@@ -1 +1,17 @@
1
- import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.js";
1
+ //#region src/compat/util/eq.d.ts
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
+ declare function eq(value: any, other: any): boolean;
16
+ //#endregion
17
+ export { eq };
@@ -1 +1,19 @@
1
- require("../../_internal/isEqualsSameValueZero.js");
1
+ //#region src/compat/util/eq.ts
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
+ //#endregion
19
+ exports.eq = eq;
@@ -1 +1,19 @@
1
- import "../../_internal/isEqualsSameValueZero.mjs";
1
+ //#region src/compat/util/eq.ts
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
+ //#endregion
19
+ export { eq };
@@ -1,4 +1,4 @@
1
- const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
1
+ const require_eq = require("../compat/util/eq.js");
2
2
  //#region src/map/hasValue.ts
3
3
  /**
4
4
  * Checks if a Map contains a specific value.
@@ -26,7 +26,7 @@ const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZer
26
26
  * // result2 will be: false
27
27
  */
28
28
  function hasValue(map, searchElement) {
29
- for (const value of map.values()) if (require_isEqualsSameValueZero.isEqualsSameValueZero(value, searchElement)) return true;
29
+ for (const value of map.values()) if (require_eq.eq(value, searchElement)) return true;
30
30
  return false;
31
31
  }
32
32
  //#endregion
@@ -1,4 +1,4 @@
1
- import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
1
+ import { eq } from "../compat/util/eq.mjs";
2
2
  //#region src/map/hasValue.ts
3
3
  /**
4
4
  * Checks if a Map contains a specific value.
@@ -26,7 +26,7 @@ import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
26
26
  * // result2 will be: false
27
27
  */
28
28
  function hasValue(map, searchElement) {
29
- for (const value of map.values()) if (isEqualsSameValueZero(value, searchElement)) return true;
29
+ for (const value of map.values()) if (eq(value, searchElement)) return true;
30
30
  return false;
31
31
  }
32
32
  //#endregion
@@ -3,8 +3,7 @@ const require_getTag = require("../compat/_internal/getTag.js");
3
3
  const require_tags = require("../compat/_internal/tags.js");
4
4
  const require_isBuffer = require("./isBuffer.js");
5
5
  const require_isPlainObject = require("./isPlainObject.js");
6
- const require_isEqualsSameValueZero = require("../_internal/isEqualsSameValueZero.js");
7
- require("../compat/util/eq.js");
6
+ const require_eq = require("../compat/util/eq.js");
8
7
  //#region src/predicate/isEqualWith.ts
9
8
  /**
10
9
  * Compares two values for equality using a custom comparison function.
@@ -71,7 +70,7 @@ function areObjectsEqual(a, b, stack, areValuesEqual) {
71
70
  case require_tags.numberTag: {
72
71
  const x = a.valueOf();
73
72
  const y = b.valueOf();
74
- return require_isEqualsSameValueZero.isEqualsSameValueZero(x, y);
73
+ return require_eq.eq(x, y);
75
74
  }
76
75
  case require_tags.booleanTag:
77
76
  case require_tags.dateTag:
@@ -3,8 +3,7 @@ import { getTag } from "../compat/_internal/getTag.mjs";
3
3
  import { 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 } from "../compat/_internal/tags.mjs";
4
4
  import { isBuffer } from "./isBuffer.mjs";
5
5
  import { isPlainObject } from "./isPlainObject.mjs";
6
- import { isEqualsSameValueZero } from "../_internal/isEqualsSameValueZero.mjs";
7
- import "../compat/util/eq.mjs";
6
+ import { eq } from "../compat/util/eq.mjs";
8
7
  //#region src/predicate/isEqualWith.ts
9
8
  /**
10
9
  * Compares two values for equality using a custom comparison function.
@@ -68,7 +67,7 @@ function areObjectsEqual(a, b, stack, areValuesEqual) {
68
67
  if (aTag !== bTag) return false;
69
68
  switch (aTag) {
70
69
  case stringTag: return a.toString() === b.toString();
71
- case numberTag: return isEqualsSameValueZero(a.valueOf(), b.valueOf());
70
+ case numberTag: return eq(a.valueOf(), b.valueOf());
72
71
  case booleanTag:
73
72
  case dateTag:
74
73
  case symbolTag: return Object.is(a.valueOf(), b.valueOf());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.49.0-dev.1956+47510706",
3
+ "version": "1.49.0-dev.1959+517d2998",
4
4
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
5
5
  "homepage": "https://es-toolkit.dev",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
@@ -1,17 +0,0 @@
1
- //#region src/_internal/isEqualsSameValueZero.d.ts
2
- /**
3
- * Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
4
- *
5
- * @param {any} value - The value to compare.
6
- * @param {any} other - The other value to compare.
7
- * @returns {boolean} 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
- declare function isEqualsSameValueZero(value: any, other: any): boolean;
16
- //#endregion
17
- export { isEqualsSameValueZero };
@@ -1,17 +0,0 @@
1
- //#region src/_internal/isEqualsSameValueZero.d.ts
2
- /**
3
- * Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
4
- *
5
- * @param {any} value - The value to compare.
6
- * @param {any} other - The other value to compare.
7
- * @returns {boolean} 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
- declare function isEqualsSameValueZero(value: any, other: any): boolean;
16
- //#endregion
17
- export { isEqualsSameValueZero };
@@ -1,19 +0,0 @@
1
- //#region src/_internal/isEqualsSameValueZero.ts
2
- /**
3
- * Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
4
- *
5
- * @param {any} value - The value to compare.
6
- * @param {any} other - The other value to compare.
7
- * @returns {boolean} 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 isEqualsSameValueZero(value, other) {
16
- return value === other || Number.isNaN(value) && Number.isNaN(other);
17
- }
18
- //#endregion
19
- exports.isEqualsSameValueZero = isEqualsSameValueZero;
@@ -1,19 +0,0 @@
1
- //#region src/_internal/isEqualsSameValueZero.ts
2
- /**
3
- * Performs a `SameValueZero` comparison between two values to determine if they are equivalent.
4
- *
5
- * @param {any} value - The value to compare.
6
- * @param {any} other - The other value to compare.
7
- * @returns {boolean} 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 isEqualsSameValueZero(value, other) {
16
- return value === other || Number.isNaN(value) && Number.isNaN(other);
17
- }
18
- //#endregion
19
- export { isEqualsSameValueZero };