es-toolkit 1.29.0-dev.936 → 1.29.0-dev.938

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.
@@ -219,6 +219,7 @@ export { snakeCase } from './string/snakeCase.mjs';
219
219
  export { startCase } from './string/startCase.mjs';
220
220
  export { startsWith } from './string/startsWith.mjs';
221
221
  export { template, templateSettings } from './string/template.mjs';
222
+ export { toLower } from './string/toLower.mjs';
222
223
  export { toUpper } from './string/toUpper.mjs';
223
224
  export { trim } from './string/trim.mjs';
224
225
  export { trimEnd } from './string/trimEnd.mjs';
@@ -232,6 +233,8 @@ export { gt } from './util/gt.mjs';
232
233
  export { gte } from './util/gte.mjs';
233
234
  export { invoke } from './util/invoke.mjs';
234
235
  export { iteratee } from './util/iteratee.mjs';
236
+ export { lt } from './util/lt.mjs';
237
+ export { lte } from './util/lte.mjs';
235
238
  export { method } from './util/method.mjs';
236
239
  export { now } from './util/now.mjs';
237
240
  export { stubArray } from './util/stubArray.mjs';
@@ -219,6 +219,7 @@ export { snakeCase } from './string/snakeCase.js';
219
219
  export { startCase } from './string/startCase.js';
220
220
  export { startsWith } from './string/startsWith.js';
221
221
  export { template, templateSettings } from './string/template.js';
222
+ export { toLower } from './string/toLower.js';
222
223
  export { toUpper } from './string/toUpper.js';
223
224
  export { trim } from './string/trim.js';
224
225
  export { trimEnd } from './string/trimEnd.js';
@@ -232,6 +233,8 @@ export { gt } from './util/gt.js';
232
233
  export { gte } from './util/gte.js';
233
234
  export { invoke } from './util/invoke.js';
234
235
  export { iteratee } from './util/iteratee.js';
236
+ export { lt } from './util/lt.js';
237
+ export { lte } from './util/lte.js';
235
238
  export { method } from './util/method.js';
236
239
  export { now } from './util/now.js';
237
240
  export { stubArray } from './util/stubArray.js';
@@ -2656,6 +2656,10 @@ function template(string, options, guard) {
2656
2656
  return result;
2657
2657
  }
2658
2658
 
2659
+ function toLower(value) {
2660
+ return toString(value).toLowerCase();
2661
+ }
2662
+
2659
2663
  function toUpper(value) {
2660
2664
  return toString(value).toUpperCase();
2661
2665
  }
@@ -2796,6 +2800,20 @@ function invokeImpl(object, path, args) {
2796
2800
  return func?.apply(parent, args);
2797
2801
  }
2798
2802
 
2803
+ function lt(value, other) {
2804
+ if (typeof value === 'string' && typeof other === 'string') {
2805
+ return value < other;
2806
+ }
2807
+ return toNumber(value) < toNumber(other);
2808
+ }
2809
+
2810
+ function lte(value, other) {
2811
+ if (typeof value === 'string' && typeof other === 'string') {
2812
+ return value <= other;
2813
+ }
2814
+ return toNumber(value) <= toNumber(other);
2815
+ }
2816
+
2799
2817
  function method(path, ...args) {
2800
2818
  return function (object) {
2801
2819
  return invoke(object, path, args);
@@ -3039,6 +3057,8 @@ exports.keysIn = keysIn;
3039
3057
  exports.last = last;
3040
3058
  exports.lastIndexOf = lastIndexOf;
3041
3059
  exports.lowerCase = lowerCase;
3060
+ exports.lt = lt;
3061
+ exports.lte = lte;
3042
3062
  exports.map = map;
3043
3063
  exports.mapKeys = mapKeys;
3044
3064
  exports.mapValues = mapValues;
@@ -3095,6 +3115,7 @@ exports.toDefaulted = toDefaulted;
3095
3115
  exports.toFinite = toFinite;
3096
3116
  exports.toInteger = toInteger;
3097
3117
  exports.toLength = toLength;
3118
+ exports.toLower = toLower;
3098
3119
  exports.toNumber = toNumber;
3099
3120
  exports.toPath = toPath;
3100
3121
  exports.toSafeInteger = toSafeInteger;
@@ -219,6 +219,7 @@ export { snakeCase } from './string/snakeCase.mjs';
219
219
  export { startCase } from './string/startCase.mjs';
220
220
  export { startsWith } from './string/startsWith.mjs';
221
221
  export { template, templateSettings } from './string/template.mjs';
222
+ export { toLower } from './string/toLower.mjs';
222
223
  export { toUpper } from './string/toUpper.mjs';
223
224
  export { trim } from './string/trim.mjs';
224
225
  export { trimEnd } from './string/trimEnd.mjs';
@@ -231,6 +232,8 @@ export { gt } from './util/gt.mjs';
231
232
  export { gte } from './util/gte.mjs';
232
233
  export { invoke } from './util/invoke.mjs';
233
234
  export { iteratee } from './util/iteratee.mjs';
235
+ export { lt } from './util/lt.mjs';
236
+ export { lte } from './util/lte.mjs';
234
237
  export { method } from './util/method.mjs';
235
238
  export { now } from './util/now.mjs';
236
239
  export { stubArray } from './util/stubArray.mjs';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Converts the given value to a string and transforms it to lower case.
3
+ * The function can handle various input types by first converting them to strings.
4
+ *
5
+ * @param {unknown} [value=''] The value to convert.
6
+ * @returns {string} Returns the lower cased string.
7
+ * @example
8
+ *
9
+ * toLower('--FOO-BAR--');
10
+ * // => '--foo-bar--'
11
+ *
12
+ * toLower(null);
13
+ * // => ''
14
+ *
15
+ * toLower([1, 2, 3]);
16
+ * // => '1,2,3'
17
+ */
18
+ declare function toLower(value?: unknown): string;
19
+
20
+ export { toLower };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Converts the given value to a string and transforms it to lower case.
3
+ * The function can handle various input types by first converting them to strings.
4
+ *
5
+ * @param {unknown} [value=''] The value to convert.
6
+ * @returns {string} Returns the lower cased string.
7
+ * @example
8
+ *
9
+ * toLower('--FOO-BAR--');
10
+ * // => '--foo-bar--'
11
+ *
12
+ * toLower(null);
13
+ * // => ''
14
+ *
15
+ * toLower([1, 2, 3]);
16
+ * // => '1,2,3'
17
+ */
18
+ declare function toLower(value?: unknown): string;
19
+
20
+ export { toLower };
@@ -0,0 +1,7 @@
1
+ import { toString } from '../util/toString.mjs';
2
+
3
+ function toLower(value) {
4
+ return toString(value).toLowerCase();
5
+ }
6
+
7
+ export { toLower };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if value is less 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 less than other, else `false`.
7
+ *
8
+ * @example
9
+ * lt(1, 3); // true
10
+ * lt(3, 3); // false
11
+ * lt(3, 1); // false
12
+ */
13
+ declare function lt(value: unknown, other: unknown): boolean;
14
+
15
+ export { lt };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if value is less 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 less than other, else `false`.
7
+ *
8
+ * @example
9
+ * lt(1, 3); // true
10
+ * lt(3, 3); // false
11
+ * lt(3, 1); // false
12
+ */
13
+ declare function lt(value: unknown, other: unknown): boolean;
14
+
15
+ export { lt };
@@ -0,0 +1,10 @@
1
+ import { toNumber } from './toNumber.mjs';
2
+
3
+ function lt(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 { lt };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if value is less than or equal to 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 less than or equal to other, else `false`.
7
+ *
8
+ * @example
9
+ * lte(1, 3); // => true
10
+ * lte(3, 3); // => true
11
+ * lte(3, 1); // => false
12
+ */
13
+ declare function lte(value: unknown, other: unknown): boolean;
14
+
15
+ export { lte };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Checks if value is less than or equal to 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 less than or equal to other, else `false`.
7
+ *
8
+ * @example
9
+ * lte(1, 3); // => true
10
+ * lte(3, 3); // => true
11
+ * lte(3, 1); // => false
12
+ */
13
+ declare function lte(value: unknown, other: unknown): boolean;
14
+
15
+ export { lte };
@@ -0,0 +1,10 @@
1
+ import { toNumber } from './toNumber.mjs';
2
+
3
+ function lte(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 { lte };
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.29.0-dev.936+b411e9ea",
4
+ "version": "1.29.0-dev.938+d2efdbdd",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {