File tree Expand file tree Collapse file tree 7 files changed +32
-58
lines changed
Expand file tree Collapse file tree 7 files changed +32
-58
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import baseGt from './.internal/baseGt.js' ;
2- import createRelationalOperation from './.internal/createRelationalOperation.js' ;
1+ import toNumber from './toNumber.js' ;
32
43/**
54 * Checks if `value` is greater than `other`.
@@ -22,6 +21,12 @@ import createRelationalOperation from './.internal/createRelationalOperation.js'
2221 * gt(1, 3);
2322 * // => false
2423 */
25- const gt = createRelationalOperation ( baseGt ) ;
24+ function gt ( value , other ) {
25+ if ( ! ( typeof value == 'string' && typeof other == 'string' ) ) {
26+ value = toNumber ( value ) ;
27+ other = toNumber ( other ) ;
28+ }
29+ return value > other ;
30+ }
2631
2732export default gt ;
Original file line number Diff line number Diff line change 1- import createRelationalOperation from './.internal/createRelationalOperation .js' ;
1+ import toNumber from './toNumber .js' ;
22
33/**
44 * Checks if `value` is greater than or equal to `other`.
@@ -21,6 +21,12 @@ import createRelationalOperation from './.internal/createRelationalOperation.js'
2121 * gte(1, 3);
2222 * // => false
2323 */
24- const gte = createRelationalOperation ( ( value , other ) => value >= other ) ;
24+ function gte ( value , other ) {
25+ if ( ! ( typeof value == 'string' && typeof other == 'string' ) ) {
26+ value = toNumber ( value ) ;
27+ other = toNumber ( other ) ;
28+ }
29+ return value >= other ;
30+ }
2531
2632export default gte ;
Original file line number Diff line number Diff line change 1- import baseLt from './.internal/baseLt.js' ;
2- import createRelationalOperation from './.internal/createRelationalOperation.js' ;
1+ import toNumber from './toNumber.js' ;
32
43/**
54 * Checks if `value` is less than `other`.
@@ -22,6 +21,12 @@ import createRelationalOperation from './.internal/createRelationalOperation.js'
2221 * lt(3, 1);
2322 * // => false
2423 */
25- const lt = createRelationalOperation ( baseLt ) ;
24+ function lt ( value , other ) {
25+ if ( ! ( typeof value == 'string' && typeof other == 'string' ) ) {
26+ value = toNumber ( value ) ;
27+ other = toNumber ( other ) ;
28+ }
29+ return value < other ;
30+ }
2631
2732export default lt ;
Original file line number Diff line number Diff line change 1- import createRelationalOperation from './.internal/createRelationalOperation .js' ;
1+ import toNumber from './toNumber .js' ;
22
33/**
44 * Checks if `value` is less than or equal to `other`.
@@ -21,6 +21,12 @@ import createRelationalOperation from './.internal/createRelationalOperation.js'
2121 * lte(3, 1);
2222 * // => false
2323 */
24- const lte = createRelationalOperation ( ( value , other ) => value <= other ) ;
24+ function lte ( value , other ) {
25+ if ( ! ( typeof value == 'string' && typeof other == 'string' ) ) {
26+ value = toNumber ( value ) ;
27+ other = toNumber ( other ) ;
28+ }
29+ return value <= other ;
30+ }
2531
2632export default lte ;
You can’t perform that action at this time.
0 commit comments