diff --git a/NEXT_VERSION_CHECKLIST.md b/NEXT_VERSION_CHECKLIST.md index a3551ed8..62abd363 100644 --- a/NEXT_VERSION_CHECKLIST.md +++ b/NEXT_VERSION_CHECKLIST.md @@ -1,11 +1,13 @@ - insert - insertAll +- lt +- lte - -- invert -- invertObj -- invoker - isNotNil +- pickBy +- pathSatisfies +- swap +- mergeDeepLeft run immutable script @@ -74,59 +76,48 @@ group TS test for similar methods - construct - it is class helper and classes are not very functional oriented - constructN - into - no support for transducer as it is overly complex to implement, understand and read. - - - - -- keysIn +- invert - overly complicated and limited use case +- invertObj +- invoker +- keysIn - we shouldn't encourage extending object with `.prototype` - lift - liftN -- lt -- lte -- mapAccum +- mapAccum - `Ramda` example doesn't looks convincing - mapAccumRight -- memoizeWith -- mergeDeepLeft -- mergeDeepWith +- memoizeWith - hard to imagine its usage in context of `R.pipe`/`R.compose` +- mergeDeepWith - limited use case - mergeDeepWithKey - mergeWithKey - -- nAry -- nthArg -- o -- otherwise -- pair -- partialRight -- pathSatisfies -- pickBy +- nAry - hard to argument about and hard to create meaningful TypeScript definitions +- nthArg - limited use case +- o - enough TypeScript issues with `R.pipe`/`R.compose` to add more composition methods +- otherwise - naming is confusing +- pair - `left-pad` types of debacles happens partially because of such methods that should not be hidden, bur rather part of your code base even if they need to exist. +- partialRight - I dislike `R.partial`, so I don't want to add more methods that are based on it - pipeWith -- project +- project - naming is confusing, but also limited use case - promap - -- reduceRight -- reduceWhile +- reduceRight - I find `right/left` methods confusing so I added them only where it makes sense. +- reduceWhile - functions with 4 inputs - I think that even 3 is too much - reduced -- remove -- scan +- remove - nice name but it is too generic. Also, `Rambdax` has such method and there it works very differently +- scan - hard to explain - sequence - splitWhenever -- swap - symmetricDifferenceWith - - andThen - toPairsIn - transduce - traverse - unary - uncurryN -- unfold -- unionWith +- unfold - similar to `R.scan` and I find that it doesn't help with readability +- unionWith - why it has its usage, I want to limit number of methods that accept more than 2 arguments - until -- useWith +- useWith - hard to explain - valuesIn -- xprod +- xprod - limited use case - thunkify -- default --- Double check diff --git a/files/index.d.ts b/files/index.d.ts index d627a938..0d3325b1 100644 --- a/files/index.d.ts +++ b/files/index.d.ts @@ -5855,6 +5855,26 @@ Notes: // @SINGLE_MARKER export function gt(x: T): T; +/* +Method: lt + +Explanation: + +Example: + +``` +const result = [R.lt(2, 1), R.lt(2, 3)] +// => [false, true] +``` + +Categories: Number + +Notes: + +*/ +// @SINGLE_MARKER +export function lt(x: T): T; + /* Method: gte @@ -5871,6 +5891,26 @@ Categories: Number Notes: +*/ +// @SINGLE_MARKER + +export function lte(x: T): T; +/* +Method: lte + +Explanation: + +Example: + +``` +const result = [R.lte(2, 1), R.lte(2, 2), R.lte(2, 3)] +// => [false, true, true] +``` + +Categories: Number + +Notes: + */ // @SINGLE_MARKER export function gte(x: T): T; diff --git a/source/gt.spec.js b/source/gt.spec.js deleted file mode 100644 index 2f1d8c05..00000000 --- a/source/gt.spec.js +++ /dev/null @@ -1,9 +0,0 @@ -import { gt } from './gt.js' - -test('reports whether one item is greater than another', () => { - expect(gt(3, 5)).toBe(false) - expect(gt(6, 4)).toBe(true) - expect(gt(7.0, 7.0)).toBe(false) - expect(gt('abc', 'xyz')).toBe(false) - expect(gt('abcd', 'abc')).toBe(true) -}) diff --git a/source/gte.spec.js b/source/gte.spec.js deleted file mode 100644 index d7569874..00000000 --- a/source/gte.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -import { gte } from './gte.js' - -test('happy', () => { - expect(gte(3, 5)).toBe(false) - expect(gte(6, 4)).toBe(true) - expect(gte(5, 5)).toBe(true) - expect(gte(7.0, 7.0)).toBe(true) - expect(gte('abc', 'xyz')).toBe(false) - expect(gte('abc', 'abc')).toBe(true) -}) diff --git a/source/lt.js b/source/lt.js new file mode 100644 index 00000000..9dced7ce --- /dev/null +++ b/source/lt.js @@ -0,0 +1,6 @@ +export function gt(a, b){ + if (arguments.length === 1) + return _b => gt(a, _b) + + return a < b +} diff --git a/source/lte.js b/source/lte.js new file mode 100644 index 00000000..4f56ebea --- /dev/null +++ b/source/lte.js @@ -0,0 +1,6 @@ +export function lte(a, b){ + if (arguments.length === 1) + return _b => lte(a, _b) + + return a <= b +}