es-toolkit 1.27.0-dev.895 → 1.27.0-dev.896

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.
@@ -136,6 +136,7 @@ export { rearg } from './function/rearg.mjs';
136
136
  export { rest } from './function/rest.mjs';
137
137
  export { spread } from './function/spread.mjs';
138
138
  export { throttle } from './function/throttle.mjs';
139
+ export { add } from './math/add.mjs';
139
140
  export { ceil } from './math/ceil.mjs';
140
141
  export { clamp } from './math/clamp.mjs';
141
142
  export { floor } from './math/floor.mjs';
@@ -136,6 +136,7 @@ export { rearg } from './function/rearg.js';
136
136
  export { rest } from './function/rest.js';
137
137
  export { spread } from './function/spread.js';
138
138
  export { throttle } from './function/throttle.js';
139
+ export { add } from './math/add.js';
139
140
  export { ceil } from './math/ceil.js';
140
141
  export { clamp } from './math/clamp.js';
141
142
  export { floor } from './math/floor.js';
@@ -1633,6 +1633,10 @@ function throttle(func, throttleMs = 0, options = {}) {
1633
1633
  return debounce(func, throttleMs, { leading, trailing, signal, maxWait: throttleMs });
1634
1634
  }
1635
1635
 
1636
+ function add(value, other) {
1637
+ return value + other;
1638
+ }
1639
+
1636
1640
  function decimalAdjust(type, number, precision = 0) {
1637
1641
  number = Number(number);
1638
1642
  if (Object.is(number, -0)) {
@@ -2717,6 +2721,7 @@ exports.unescape = upperFirst.unescape;
2717
2721
  exports.upperFirst = upperFirst.upperFirst;
2718
2722
  exports.words = upperFirst.words;
2719
2723
  exports.invariant = util_index.invariant;
2724
+ exports.add = add;
2720
2725
  exports.ary = ary;
2721
2726
  exports.assignIn = assignIn;
2722
2727
  exports.attempt = attempt;
@@ -138,6 +138,7 @@ export { rearg } from './function/rearg.mjs';
138
138
  export { rest } from './function/rest.mjs';
139
139
  export { spread } from './function/spread.mjs';
140
140
  export { throttle } from './function/throttle.mjs';
141
+ export { add } from './math/add.mjs';
141
142
  export { ceil } from './math/ceil.mjs';
142
143
  export { clamp } from './math/clamp.mjs';
143
144
  export { floor } from './math/floor.mjs';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Adds two numbers while safely handling `NaN` values.
3
+ *
4
+ * This function takes two numbers and returns their sum. If either of the numbers is `NaN`,
5
+ * the function returns `NaN`.
6
+ *
7
+ * @param {number} value - The first number to add.
8
+ * @param {number} other - The second number to add.
9
+ * @returns {number} The sum of the two numbers, or `NaN` if any input is `NaN`.
10
+ *
11
+ * @example
12
+ * const result1 = add(2, 3); // result1 will be 5
13
+ * const result2 = add(5, NaN); // result2 will be NaN
14
+ * const result3 = add(NaN, 10); // result3 will be NaN
15
+ */
16
+ declare function add(value: number, other: number): number;
17
+
18
+ export { add };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Adds two numbers while safely handling `NaN` values.
3
+ *
4
+ * This function takes two numbers and returns their sum. If either of the numbers is `NaN`,
5
+ * the function returns `NaN`.
6
+ *
7
+ * @param {number} value - The first number to add.
8
+ * @param {number} other - The second number to add.
9
+ * @returns {number} The sum of the two numbers, or `NaN` if any input is `NaN`.
10
+ *
11
+ * @example
12
+ * const result1 = add(2, 3); // result1 will be 5
13
+ * const result2 = add(5, NaN); // result2 will be NaN
14
+ * const result3 = add(NaN, 10); // result3 will be NaN
15
+ */
16
+ declare function add(value: number, other: number): number;
17
+
18
+ export { add };
@@ -0,0 +1,5 @@
1
+ function add(value, other) {
2
+ return value + other;
3
+ }
4
+
5
+ export { add };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
3
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
4
- "version": "1.27.0-dev.895+7210c5dc",
4
+ "version": "1.27.0-dev.896+4e096f8c",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {