es-toolkit 1.27.0-dev.898 → 1.27.0-dev.899

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.
@@ -221,6 +221,7 @@ export { words } from './string/words.mjs';
221
221
  export { constant } from './util/constant.mjs';
222
222
  export { defaultTo } from './util/defaultTo.mjs';
223
223
  export { eq } from './util/eq.mjs';
224
+ export { gt } from './util/gt.mjs';
224
225
  export { iteratee } from './util/iteratee.mjs';
225
226
  export { times } from './util/times.mjs';
226
227
  export { toFinite } from './util/toFinite.mjs';
@@ -221,6 +221,7 @@ export { words } from './string/words.js';
221
221
  export { constant } from './util/constant.js';
222
222
  export { defaultTo } from './util/defaultTo.js';
223
223
  export { eq } from './util/eq.js';
224
+ export { gt } from './util/gt.js';
224
225
  export { iteratee } from './util/iteratee.js';
225
226
  export { times } from './util/times.js';
226
227
  export { toFinite } from './util/toFinite.js';
@@ -2624,6 +2624,13 @@ function defaultTo(value, defaultValue) {
2624
2624
  return value;
2625
2625
  }
2626
2626
 
2627
+ function gt(value, other) {
2628
+ if (typeof value === 'string' && typeof other === 'string') {
2629
+ return value > other;
2630
+ }
2631
+ return toNumber(value) > toNumber(other);
2632
+ }
2633
+
2627
2634
  const MAX_ARRAY_LENGTH = 4_294_967_295;
2628
2635
 
2629
2636
  function toLength(value) {
@@ -2782,6 +2789,7 @@ exports.flowRight = flowRight;
2782
2789
  exports.forEach = forEach;
2783
2790
  exports.fromPairs = fromPairs;
2784
2791
  exports.get = get;
2792
+ exports.gt = gt;
2785
2793
  exports.has = has;
2786
2794
  exports.head = head;
2787
2795
  exports.inRange = inRange;
@@ -220,6 +220,7 @@ export { upperCase } from './string/upperCase.mjs';
220
220
  export { words } from './string/words.mjs';
221
221
  export { constant } from './util/constant.mjs';
222
222
  export { defaultTo } from './util/defaultTo.mjs';
223
+ export { gt } from './util/gt.mjs';
223
224
  export { iteratee } from './util/iteratee.mjs';
224
225
  export { times } from './util/times.mjs';
225
226
  export { toFinite } from './util/toFinite.mjs';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if value is greater than other.
3
+ *
4
+ * @param {unknown} value The value to compare.
5
+ * @param {unknown} other The other value to compare.
6
+ * @returns {boolean} Returns `true` if value is greater than other, else `false`.
7
+ *
8
+ * @example
9
+ * gt(3, 1); // true
10
+ * gt(3, 3); // false
11
+ * gt(1, 3); // false
12
+ */
13
+ declare function gt(value: unknown, other: unknown): boolean;
14
+
15
+ export { gt };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if value is greater than other.
3
+ *
4
+ * @param {unknown} value The value to compare.
5
+ * @param {unknown} other The other value to compare.
6
+ * @returns {boolean} Returns `true` if value is greater than other, else `false`.
7
+ *
8
+ * @example
9
+ * gt(3, 1); // true
10
+ * gt(3, 3); // false
11
+ * gt(1, 3); // false
12
+ */
13
+ declare function gt(value: unknown, other: unknown): boolean;
14
+
15
+ export { gt };
@@ -0,0 +1,10 @@
1
+ import { toNumber } from './toNumber.mjs';
2
+
3
+ function gt(value, other) {
4
+ if (typeof value === 'string' && typeof other === 'string') {
5
+ return value > other;
6
+ }
7
+ return toNumber(value) > toNumber(other);
8
+ }
9
+
10
+ export { gt };
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.898+578c0000",
4
+ "version": "1.27.0-dev.899+ec0181d9",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {