rambda 10.3.0 → 10.3.2

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.
package/README.md CHANGED
@@ -76,7 +76,28 @@ it('within Ramda.pipe requires explicit types', () => {
76
76
  });
77
77
  ```
78
78
 
79
- IMPORTANT - all methods are tested to deliver correct types when they are part of `R.pipe/R.pipeAsync` chains. Using them outside(standalone) most likely will result in `unknown` type for inputs.
79
+ :exclamation: IMPORTANT - all methods are tested to deliver correct types when they are part of `R.pipe/R.pipeAsync` chains.
80
+
81
+ In other words:
82
+
83
+ ```typescript
84
+ R.filter(x => x > 1)([1,2,3])
85
+ ```
86
+
87
+ might trigger TS error as it not the same as
88
+
89
+ ```typescript
90
+
91
+ R.pipe([1,2,3], R.filter(x => x > 1)
92
+ ```
93
+
94
+ ### :exclamation: All methods are curried
95
+
96
+ There is one way to use `Rambda` methods and it is with currying, i.e. using `R.filter(fn, list)` will not work as it is inteded to be `R.filter(fn)(list)`.
97
+
98
+ The reason is that all methods are supposed to be used inside `R.pipe`. After all, building chains is the very base of functional programming.
99
+
100
+ Of course, there is value in supporting the case where you can pass all inputs at once, but I find that the price in terms of maintainability is not worth it.
80
101
 
81
102
  ### Keep only the most useful methods
82
103
 
@@ -813,13 +834,11 @@ append<T>(el: T): (list: T[]) => T[]
813
834
  It adds element `x` at the end of `iterable`.
814
835
 
815
836
  ```javascript
816
- const x = 'foo'
817
-
818
- const result = R.append(x, ['bar', 'baz'])
837
+ const result = R.append('foo')(['bar', 'baz'])
819
838
  // => ['bar', 'baz', 'foo']
820
839
  ```
821
840
 
822
- <a title="redirect to Rambda Repl site" href="https://rambda.now.sh?const%20x%20%3D%20'foo'%0A%0Aconst%20result%20%3D%20R.append(x%2C%20%5B'bar'%2C%20'baz'%5D)%0A%2F%2F%20%3D%3E%20%5B'bar'%2C%20'baz'%2C%20'foo'%5D">Try this <strong>R.append</strong> example in Rambda REPL</a>
841
+ <a title="redirect to Rambda Repl site" href="https://rambda.now.sh?const%20result%20%3D%20R.append('foo')(%5B'bar'%2C%20'baz'%5D)%0A%2F%2F%20%3D%3E%20%5B'bar'%2C%20'baz'%2C%20'foo'%5D">Try this <strong>R.append</strong> example in Rambda REPL</a>
823
842
 
824
843
  <details>
825
844
 
@@ -1784,8 +1803,8 @@ createObjectFromKeys<const K extends readonly PropertyKey[], V>(
1784
1803
  <summary><strong>R.createObjectFromKeys</strong> source</summary>
1785
1804
 
1786
1805
  ```javascript
1787
- export function createObjectFromKeys(keys) {
1788
- return fn => {
1806
+ export function createObjectFromKeys(fn) {
1807
+ return keys => {
1789
1808
  const result = {}
1790
1809
  keys.forEach((key, index) => {
1791
1810
  result[key] = fn(key, index)
@@ -1806,7 +1825,7 @@ export function createObjectFromKeys(keys) {
1806
1825
  import { createObjectFromKeys } from './createObjectFromKeys.js'
1807
1826
 
1808
1827
  test('happy', () => {
1809
- const result = createObjectFromKeys(['a', 'b'])((key, index) => key.toUpperCase() + index)
1828
+ const result = createObjectFromKeys((key, index) => key.toUpperCase() + index)(['a', 'b'])
1810
1829
  const expected = { a: 'A0', b: 'B1' }
1811
1830
 
1812
1831
  expect(result).toEqual(expected)
@@ -3096,14 +3115,14 @@ const input = {
3096
3115
  }
3097
3116
  const result = R.pipe(
3098
3117
  input,
3099
- evolve({
3118
+ R.evolve({
3100
3119
  foo: x => x + 1,
3101
3120
  })
3102
3121
  )
3103
3122
  // => result is { foo: 3, baz: 'baz' }
3104
3123
  ```
3105
3124
 
3106
- <a title="redirect to Rambda Repl site" href="https://rambda.now.sh?const%20input%20%3D%20%7B%0A%09foo%3A%202%2C%0A%09baz%3A%20'baz'%2C%0A%7D%0Aconst%20result%20%3D%20R.pipe(%0A%09input%2C%0A%09evolve(%7B%0A%09%09foo%3A%20x%20%3D%3E%20x%20%2B%201%2C%0A%09%7D)%0A)%0A%2F%2F%20%3D%3E%20result%20is%20%7B%20foo%3A%203%2C%20baz%3A%20'baz'%20%7D">Try this <strong>R.evolve</strong> example in Rambda REPL</a>
3125
+ <a title="redirect to Rambda Repl site" href="https://rambda.now.sh?const%20input%20%3D%20%7B%0A%09foo%3A%202%2C%0A%09baz%3A%20'baz'%2C%0A%7D%0Aconst%20result%20%3D%20R.pipe(%0A%09input%2C%0A%09R.evolve(%7B%0A%09%09foo%3A%20x%20%3D%3E%20x%20%2B%201%2C%0A%09%7D)%0A)%0A%2F%2F%20%3D%3E%20result%20is%20%7B%20foo%3A%203%2C%20baz%3A%20'baz'%20%7D">Try this <strong>R.evolve</strong> example in Rambda REPL</a>
3107
3126
 
3108
3127
  <details>
3109
3128
 
@@ -4761,7 +4780,7 @@ describe('R.head', () => {
4761
4780
 
4762
4781
  ```typescript
4763
4782
 
4764
- includes<T extends string>(valueToFind: T): (input: string) => boolean
4783
+ includes(s: string): (list: readonly string[] | string) => boolean
4765
4784
  ```
4766
4785
 
4767
4786
  If `input` is string, then this method work as native `String.includes`.
@@ -4783,8 +4802,8 @@ const result = [
4783
4802
  <summary>All TypeScript definitions</summary>
4784
4803
 
4785
4804
  ```typescript
4786
- includes<T extends string>(valueToFind: T): (input: string) => boolean;
4787
- includes<T>(valueToFind: T): (input: T[]) => boolean;
4805
+ includes(s: string): (list: readonly string[] | string) => boolean;
4806
+ includes<T>(target: T): (list: readonly T[]) => boolean;
4788
4807
  ```
4789
4808
 
4790
4809
  </details>
@@ -4861,7 +4880,7 @@ test('with wrong input that does not throw', () => {
4861
4880
  <summary><strong>TypeScript</strong> test</summary>
4862
4881
 
4863
4882
  ```typescript
4864
- import { includes, pipe } from 'rambda'
4883
+ import { pipe, includes } from 'rambda'
4865
4884
 
4866
4885
  describe('R.includes', () => {
4867
4886
  it('happy', () => {
@@ -4873,6 +4892,16 @@ describe('R.includes', () => {
4873
4892
  const result = pipe('foo', includes('bar'))
4874
4893
  result // $ExpectType boolean
4875
4894
  })
4895
+ it('with array of strings', () => {
4896
+ const result = pipe(['1','2'], includes('1'))
4897
+ result // $ExpectType boolean
4898
+ })
4899
+ it('without R.pipe', () => {
4900
+ const result1 = includes('1')(['1', '2'])
4901
+ const result2 = includes(1)([1, 2])
4902
+ result1 // $ExpectType boolean
4903
+ result2 // $ExpectType boolean
4904
+ })
4876
4905
  })
4877
4906
  ```
4878
4907
 
@@ -7156,10 +7185,17 @@ export function modifyPath(pathInput, fn) {
7156
7185
  ```javascript
7157
7186
  import { modifyPath } from './modifyPath.js'
7158
7187
 
7188
+ const obj = { a: { b: { c: 1 } } }
7189
+
7159
7190
  test('happy', () => {
7160
- const result = modifyPath('a.b.c', x => x + 1)({ a: { b: { c: 1 } } })
7191
+ const result = modifyPath('a.b.c', x => x + 1)(obj)
7161
7192
  expect(result).toEqual({ a: { b: { c: 2 } } })
7162
7193
  })
7194
+
7195
+ test('works only on existing paths', () => {
7196
+ const result = modifyPath('a.b.d', x => x + 1)(obj)
7197
+ expect(result).toEqual(obj)
7198
+ })
7163
7199
  ```
7164
7200
 
7165
7201
  </details>
@@ -9352,7 +9388,7 @@ test('returns false if called with a null or undefined object', () => {
9352
9388
 
9353
9389
  ```typescript
9354
9390
 
9355
- propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>>) => T
9391
+ propOr<T, P extends string>(property: P, defaultValue: T): (obj: Partial<Record<P, T>>) => T
9356
9392
  ```
9357
9393
 
9358
9394
  It returns either `defaultValue` or the value of `property` in `obj`.
@@ -9376,7 +9412,7 @@ const result = [
9376
9412
  <summary>All TypeScript definitions</summary>
9377
9413
 
9378
9414
  ```typescript
9379
- propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>>) => T;
9415
+ propOr<T, P extends string>(property: P, defaultValue: T): (obj: Partial<Record<P, T>>) => T;
9380
9416
  ```
9381
9417
 
9382
9418
  </details>
@@ -9388,7 +9424,7 @@ propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<
9388
9424
  ```javascript
9389
9425
  import { defaultTo } from './defaultTo.js'
9390
9426
 
9391
- export function propOr(defaultValue, property) {
9427
+ export function propOr(property, defaultValue) {
9392
9428
  return obj => {
9393
9429
  if (!obj) {
9394
9430
  return defaultValue
@@ -9410,9 +9446,9 @@ import { propOr } from './propOr.js'
9410
9446
 
9411
9447
  test('propOr', () => {
9412
9448
  const obj = { a: 1 }
9413
- expect(propOr('default', 'a')(obj)).toBe(1)
9414
- expect(propOr('default', 'notExist')(obj)).toBe('default')
9415
- expect(propOr('default', 'notExist')(null)).toBe('default')
9449
+ expect(propOr('a', 'default', )(obj)).toBe(1)
9450
+ expect(propOr('notExist', 'default')(obj)).toBe('default')
9451
+ expect(propOr('notExist', 'default')(null)).toBe('default')
9416
9452
  })
9417
9453
  ```
9418
9454
 
@@ -9429,11 +9465,9 @@ const obj = { foo: 'bar' }
9429
9465
  const property = 'foo'
9430
9466
  const fallback = 'fallback'
9431
9467
 
9432
- describe('R.propOr', () => {
9433
- it('happy', () => {
9434
- const result = propOr(fallback, property)(obj)
9435
- result // $ExpectType string
9436
- })
9468
+ it('R.propOr', () => {
9469
+ const result = propOr(property, fallback)(obj)
9470
+ result // $ExpectType string
9437
9471
  })
9438
9472
  ```
9439
9473
 
@@ -13507,6 +13541,16 @@ describe('R.zipWith', () => {
13507
13541
 
13508
13542
  ## ❯ CHANGELOG
13509
13543
 
13544
+ 10.3.1
13545
+
13546
+ - Fix issue with wrong order of inputs in `R.createObjectFromKeys` - [Issue #779](https://github.com/selfrefactor/rambda/issues/779)
13547
+
13548
+ 10.3.1
13549
+
13550
+ - Fix issue with wrong order of inputs in `R.propEq` - [Issue #779](https://github.com/selfrefactor/rambda/issues/779)
13551
+
13552
+ - Fix issue with TypeScript definitions for `R.includes`- [Issue #781](https://github.com/selfrefactor/rambda/issues/781)
13553
+
13510
13554
  10.3.0
13511
13555
 
13512
13556
  - Add `R.mapPropObject`
@@ -13521,6 +13565,9 @@ describe('R.zipWith', () => {
13521
13565
 
13522
13566
  - Remove option for `R.mapAsync` to be called outside of `R.pipeAsync`. This is done for consistency as all other methods follow this rule, i.e. they are all curried.
13523
13567
 
13568
+ - Fix `R.pluck` to work without `R.pipe`
13569
+ - Remove option for `R.mapAsync` to be called outside of `R.pipeAsync`. This is done for consistency as all other methods follow this rule, i.e. they are all curried.
13570
+
13524
13571
  - Fix `R.pluck` to work without `R.pipe`
13525
13572
 
13526
13573
  10.2.0
@@ -13984,258 +14031,6 @@ Add the following methods:
13984
14031
 
13985
14032
  - change order of `R.propEq` - [Ramda MR](https://github.com/ramda/ramda/pull/2938/files)
13986
14033
 
13987
- 7.5.0
13988
-
13989
- - IMPORTANT: Remove `export` property in `package.json` in order to allow `Rambda` support for projects with `"type": "module"` in `package.json` - [Issue #667](https://github.com/selfrefactor/rambda/issues/657)
13990
-
13991
- - Add `R.unnest` - [Rambdax issue 89](https://github.com/selfrefactor/rambdax/issues/89)
13992
-
13993
- - `R.uniq` is not using `R.equals` as Ramda does - [Issue #88](https://github.com/selfrefactor/rambdax/issues/88)
13994
-
13995
- - Fix `R.path(['non','existing','path'], obj)` TS definition as 7.4.0 release caused TS errors - [Issue #668](https://github.com/selfrefactor/rambda/issues/668)
13996
-
13997
- 7.4.0
13998
-
13999
- - Synchronize with `@types/ramda` - `R.prop`, `R.path`, `R.pickAll`
14000
-
14001
- - Remove `esm` Rollup output due to tree-shaking issues.
14002
-
14003
- - Upgrade all dev dependencies.
14004
-
14005
- 7.3.0
14006
-
14007
- - Important - changing import declaration in `package.json` in order to fix tree-shaking issue - [Issue #647](https://github.com/selfrefactor/rambda/issues/647)
14008
-
14009
- - Add `R.modify`
14010
-
14011
- - Allow multiple inputs in TypeScript versions of `R.anyPass` and `R.allPass` - [Issue #642](https://github.com/selfrefactor/rambda/issues/604)
14012
-
14013
- - Using wrong clone of object in `R.mergeDeepRight` - [Issue #650](https://github.com/selfrefactor/rambda/issues/650)
14014
-
14015
- - Missing early return in `R.where` - [Issue #648](https://github.com/selfrefactor/rambda/issues/648)
14016
-
14017
- - `R.allPass` doesn't accept more than 1 parameters for function predicates- [Issue #604](https://github.com/selfrefactor/rambda/issues/604)
14018
-
14019
- 7.2.1
14020
-
14021
- - Remove bad typings of `R.propIs` which caused the library to cannot be build with TypeScript.
14022
-
14023
- - Drop support for `Wallaby` as per [https://github.com/wallabyjs/public/issues/3037](https://github.com/wallabyjs/public/issues/3037)
14024
-
14025
- 7.2.0
14026
-
14027
- - Wrong `R.update` if index is `-1` - [PR #593](https://github.com/selfrefactor/rambda/pull/593)
14028
-
14029
- - Wrong curried typings in `R.anyPass` - [Issue #642](https://github.com/selfrefactor/rambda/issues/642)
14030
-
14031
- - `R.modifyPath` not exported - [Issue #640](https://github.com/selfrefactor/rambda/issues/640)
14032
-
14033
- - Add new method `R.uniqBy`. Implementation is coming from [Ramda MR#2641](https://github.com/ramda/ramda/pull/2641)
14034
-
14035
- - Apply the following changes from `@types/rambda`:
14036
-
14037
- -- [https://github.com/DefinitelyTyped/DefinitelyTyped/commit/bab47272d52fc7bb81e85da36dbe9c905a04d067](add `AnyFunction` and `AnyConstructor`)
14038
-
14039
- -- Improve `R.ifElse` typings - https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59291
14040
-
14041
- -- Make `R.propEq` safe for `null/undefined` arguments - https://github.com/ramda/ramda/pull/2594/files
14042
-
14043
- 7.1.4
14044
-
14045
- - `R.mergeRight` not found on `Deno` import - [Issue #633](https://github.com/selfrefactor/rambda/issues/633)
14046
-
14047
- 7.1.0
14048
-
14049
- - Add `R.mergeRight` - introduced by Ramda's latest release. While Ramda renames `R.merge`, Rambda will keep `R.merge`.
14050
-
14051
- - Rambda's `pipe/compose` doesn't return proper length of composed function which leads to issue with `R.applySpec`. It was fixed by using Ramda's `pipe/compose` logic - [Issue #627](https://github.com/selfrefactor/rambda/issues/627)
14052
-
14053
- - Replace `Async` with `Promise` as return type of `R.type`.
14054
-
14055
- - Add new types as TypeScript output for `R.type` - "Map", "WeakMap", "Generator", "GeneratorFunction", "BigInt", "ArrayBuffer"
14056
-
14057
- - Add `R.juxt` method
14058
-
14059
- - Add `R.propSatisfies` method
14060
-
14061
- - Add new methods after `Ramda` version upgrade to `0.28.0`:
14062
-
14063
- -- R.count
14064
- -- R.modifyPath
14065
- -- R.on
14066
- -- R.whereAny
14067
- -- R.partialObject
14068
-
14069
- 7.0.3
14070
-
14071
- Rambda.none has wrong logic introduced in version `7.0.0` - [Issue #625](https://github.com/selfrefactor/rambda/issues/625)
14072
-
14073
- 7.0.2
14074
-
14075
- Rambda doesn't work with `pnpm` due to wrong export configuration - [Issue #619](https://github.com/selfrefactor/rambda/issues/619)
14076
-
14077
- 7.0.1
14078
-
14079
- - Wrong ESM export configuration in `package.json` - [Issue #614](https://github.com/selfrefactor/rambda/issues/614)
14080
-
14081
- 7.0.0
14082
-
14083
- - Breaking change - sync `R.compose`/`R.pipe` with `@types/ramda`. That is significant change so as safeguard, it will lead a major bump. Important - this lead to raising required TypeScript version to `4.2.2`. In other words, to use `Rambda` you'll need TypeScript version `4.2.2` or newer.
14084
-
14085
- Related commit in `@types/ramda` - https://github.com/DefinitelyTyped/DefinitelyTyped/commit/286eff4f76d41eb8f091e7437eabd8a60d97fc1f#diff-4f74803fa83a81e47cb17a7d8a4e46a7e451f4d9e5ce2f1bd7a70a72d91f4bc1
14086
-
14087
- There are several other changes in `@types/ramda` as stated in [this comment](https://github.com/ramda/ramda/issues/2976#issuecomment-990408945). This leads to change of typings for the following methods in **Rambda**:
14088
-
14089
- -- R.unless
14090
-
14091
- -- R.toString
14092
-
14093
- -- R.ifElse
14094
-
14095
- -- R.always
14096
-
14097
- -- R.complement
14098
-
14099
- -- R.cond
14100
-
14101
- -- R.is
14102
-
14103
- -- R.sortBy
14104
-
14105
- -- R.dissoc
14106
-
14107
- -- R.toPairs
14108
-
14109
- -- R.assoc
14110
-
14111
- -- R.toLower
14112
-
14113
- -- R.toUpper
14114
-
14115
- - One more reason for the breaking change is changing of export declarations in `package.json` based on [this blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#packagejson-exports-imports-and-self-referencing) and [this merged Ramda's PR](https://github.com/ramda/ramda/pull/2999). This also led to renaming of `babel.config.js` to `babel.config.cjs`.
14116
-
14117
- - Add `R.apply`, `R.bind` and `R.unapply`
14118
-
14119
- - `R.startsWith/R.endsWith` now support lists as inputs. This way, it matches current Ramda behavior.
14120
-
14121
- - Remove unused typing for `R.chain`.
14122
-
14123
- - `R.map`/`R.filter` no longer accept bad inputs as iterable. This way, Rambda behaves more like Ramda, which also throws.
14124
-
14125
- - Make `R.lastIndexOf` follow the logic of `R.indexOf`.
14126
-
14127
- - Change `R.type` logic to Ramda logic. This way, `R.type` can return `Error` and `Set` as results.
14128
-
14129
- - Add missing logic in `R.equals` to compare sets - [Issue #599](https://github.com/selfrefactor/rambda/issues/599)
14130
-
14131
- - Improve list cloning - [Issue #595](https://github.com/selfrefactor/rambda/issues/595)
14132
-
14133
- - Handle multiple inputs with `R.allPass` and `R.anyPass` - [Issue #604](https://github.com/selfrefactor/rambda/issues/604)
14134
-
14135
- - Fix `R.length` wrong logic with inputs as `{length: 123}` - [Issue #606](https://github.com/selfrefactor/rambda/issues/606).
14136
-
14137
- - Improve non-curry typings of `R.merge` by using types from [mobily/ts-belt](https://github.com/mobily/ts-belt).
14138
-
14139
- - Improve performance of `R.uniqWith`.
14140
-
14141
- - Wrong `R.update` if index is `-1` - [PR #593](https://github.com/selfrefactor/rambda/pull/593)
14142
-
14143
- - Make `R.eqProps` safe for falsy inputs - based on [this opened Ramda PR](https://github.com/ramda/ramda/pull/2943).
14144
-
14145
- - Incorrect benchmarks for `R.pipe/R.compose` - [Issue #608](https://github.com/selfrefactor/rambda/issues/608)
14146
-
14147
- - Fix `R.last/R.head` typings - [Issue #609](https://github.com/selfrefactor/rambda/issues/609)
14148
-
14149
- 6.9.0
14150
-
14151
- - Fix slow `R.uniq` methods - [Issue #581](https://github.com/selfrefactor/rambda/issues/581)
14152
-
14153
- Fixing `R.uniq` was done by improving `R.indexOf` which has performance implication to all methods importing `R.indexOf`:
14154
-
14155
- - R.includes
14156
- - R.intersection
14157
- - R.difference
14158
- - R.excludes
14159
- - R.symmetricDifference
14160
- - R.union
14161
-
14162
- - R.without no longer support the following case - `without('0:1', ['0', '0:1']) // => ['0']`. Now it throws as the first argument should be a list, not a string. Ramda, on the other hand, returns an empty list - https://github.com/ramda/ramda/issues/3086.
14163
-
14164
- 6.8.3
14165
-
14166
- - Fix TypeScript build process with `rambda/immutable` - [Issue #572](https://github.com/selfrefactor/rambda/issues/572)
14167
-
14168
- - Add `R.objOf` method
14169
-
14170
- - Add `R.mapObjIndexed` method
14171
-
14172
- - Publish shorter README.md version to NPM
14173
-
14174
- 6.8.0
14175
-
14176
- - `R.has` use `Object.prototype.hasOwnProperty`- [Issue #572](https://github.com/selfrefactor/rambda/issues/572)
14177
-
14178
- - Expose `immutable.ts` typings which are Rambda typings with `readonly` statements - [Issue #565](https://github.com/selfrefactor/rambda/issues/565)
14179
-
14180
- - Fix `R.intersection` wrong order compared to Ramda.
14181
-
14182
- - `R.path` wrong return of `null` instead of `undefined` when path value is `null` - [PR #577](https://github.com/selfrefactor/rambda/pull/577)
14183
-
14184
- 6.7.0
14185
-
14186
- - Remove `ts-toolbelt` types from TypeScript definitions. Most affected are the following methods, which lose one of its curried definitions:
14187
-
14188
- 1. R.maxBy
14189
- 2. R.minBy
14190
- 3. R.pathEq
14191
- 4. R.viewOr
14192
- 5. R.when
14193
- 6. R.merge
14194
- 7. R.mergeDeepRight
14195
- 8. R.mergeLeft
14196
-
14197
- 6.6.0
14198
-
14199
- - Change `R.piped` typings to mimic that of `R.pipe`. Main difference is that `R.pipe` is focused on unary functions.
14200
-
14201
- - Fix wrong logic when `R.without` use `R.includes` while it should use array version of `R.includes`.
14202
-
14203
- - Use uglify plugin for UMD bundle.
14204
-
14205
- - Remove `dist` folder from `.gitignore` in order to fix `Deno` broken package. [Issue #570](https://github.com/selfrefactor/rambda/issues/570)
14206
-
14207
- - Improve `R.fromPairs` typings - [Issue #567](https://github.com/selfrefactor/rambda/issues/567)
14208
-
14209
- 6.5.3
14210
-
14211
- - Wrong logic where `R.without` use `R.includes` while it should use the array version of `R.includes`
14212
-
14213
- This is Ramda bug, that Rambda also has before this release - https://github.com/ramda/ramda/issues/3086
14214
-
14215
- 6.5.2
14216
-
14217
- - Wrong `R.defaultTo` typings - changes introduced in v6.5.0 are missing their TS equivalent.
14218
-
14219
- - Update dependencies
14220
-
14221
- 6.5.1
14222
-
14223
- Fix wrong versions in changelog
14224
-
14225
- 6.5.0
14226
-
14227
- - `R.defaultTo` no longer accepts infinite inputs, thus it follows Ramda implementation.
14228
-
14229
- - `R.equals` supports equality of functions.
14230
-
14231
- - `R.pipe` doesn't use `R.compose`.
14232
-
14233
- - Close [Issue #561](https://github.com/selfrefactor/rambda/issues/561) - export several internal TS interfaces and types
14234
-
14235
- - Close [Issue #559](https://github.com/selfrefactor/rambda/issues/559) - improve `R.propOr` typings
14236
-
14237
- - Add `CHANGELOG.md` file in release files list
14238
-
14239
14034
  > This is only part of the changelog. You can read the full text in [CHANGELOG.md](CHANGELOG.md) file.
14240
14035
 
14241
14036
  [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#-changelog)
package/dist/rambda.cjs CHANGED
@@ -230,8 +230,8 @@ function countBy(fn) {
230
230
  }
231
231
  }
232
232
 
233
- function createObjectFromKeys(keys) {
234
- return fn => {
233
+ function createObjectFromKeys(fn) {
234
+ return keys => {
235
235
  const result = {};
236
236
  keys.forEach((key, index) => {
237
237
  result[key] = fn(key, index);
@@ -1483,7 +1483,7 @@ function propEq(valueToMatch, propToFind) {
1483
1483
  }
1484
1484
  }
1485
1485
 
1486
- function propOr(defaultValue, property) {
1486
+ function propOr(property, defaultValue) {
1487
1487
  return obj => {
1488
1488
  if (!obj) {
1489
1489
  return defaultValue
package/dist/rambda.js CHANGED
@@ -228,8 +228,8 @@ function countBy(fn) {
228
228
  }
229
229
  }
230
230
 
231
- function createObjectFromKeys(keys) {
232
- return fn => {
231
+ function createObjectFromKeys(fn) {
232
+ return keys => {
233
233
  const result = {};
234
234
  keys.forEach((key, index) => {
235
235
  result[key] = fn(key, index);
@@ -1481,7 +1481,7 @@ function propEq(valueToMatch, propToFind) {
1481
1481
  }
1482
1482
  }
1483
1483
 
1484
- function propOr(defaultValue, property) {
1484
+ function propOr(property, defaultValue) {
1485
1485
  return obj => {
1486
1486
  if (!obj) {
1487
1487
  return defaultValue
@@ -234,8 +234,8 @@
234
234
  }
235
235
  }
236
236
 
237
- function createObjectFromKeys(keys) {
238
- return fn => {
237
+ function createObjectFromKeys(fn) {
238
+ return keys => {
239
239
  const result = {};
240
240
  keys.forEach((key, index) => {
241
241
  result[key] = fn(key, index);
@@ -1487,7 +1487,7 @@
1487
1487
  }
1488
1488
  }
1489
1489
 
1490
- function propOr(defaultValue, property) {
1490
+ function propOr(property, defaultValue) {
1491
1491
  return obj => {
1492
1492
  if (!obj) {
1493
1493
  return defaultValue
package/index.d.cts CHANGED
@@ -428,8 +428,8 @@ export function head<T>(listOrString: T): T extends string ? string :
428
428
  *
429
429
  * If `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.
430
430
  */
431
- export function includes<T extends string>(valueToFind: T): (input: string) => boolean;
432
- export function includes<T>(valueToFind: T): (input: T[]) => boolean;
431
+ export function includes(s: string): (list: readonly string[] | string) => boolean;
432
+ export function includes<T>(target: T): (list: readonly T[]) => boolean;
433
433
 
434
434
  /**
435
435
  * It transforms list of objects to object using specified property as the base for the returned object.
@@ -1773,7 +1773,7 @@ export function propEq<K extends keyof U, U>(val: U[K], name: K, obj: U): boolea
1773
1773
  /**
1774
1774
  * It returns either `defaultValue` or the value of `property` in `obj`.
1775
1775
  */
1776
- export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>>) => T;
1776
+ export function propOr<T, P extends string>(property: P, defaultValue: T): (obj: Partial<Record<P, T>>) => T;
1777
1777
 
1778
1778
  /**
1779
1779
  * It returns `true` if the object property satisfies a given predicate.
package/index.d.ts CHANGED
@@ -428,8 +428,8 @@ export function head<T>(listOrString: T): T extends string ? string :
428
428
  *
429
429
  * If `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.
430
430
  */
431
- export function includes<T extends string>(valueToFind: T): (input: string) => boolean;
432
- export function includes<T>(valueToFind: T): (input: T[]) => boolean;
431
+ export function includes(s: string): (list: readonly string[] | string) => boolean;
432
+ export function includes<T>(target: T): (list: readonly T[]) => boolean;
433
433
 
434
434
  /**
435
435
  * It transforms list of objects to object using specified property as the base for the returned object.
@@ -1773,7 +1773,7 @@ export function propEq<K extends keyof U, U>(val: U[K], name: K, obj: U): boolea
1773
1773
  /**
1774
1774
  * It returns either `defaultValue` or the value of `property` in `obj`.
1775
1775
  */
1776
- export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>>) => T;
1776
+ export function propOr<T, P extends string>(property: P, defaultValue: T): (obj: Partial<Record<P, T>>) => T;
1777
1777
 
1778
1778
  /**
1779
1779
  * It returns `true` if the object property satisfies a given predicate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rambda",
3
- "version": "10.3.0",
3
+ "version": "10.3.2",
4
4
  "scripts": {
5
5
  "out": "yarn populatedocs && yarn populatereadme && yarn build && yarn create-docsify",
6
6
  "build": "yarn build:main && yarn build:web && yarn build:esm",
@@ -1,5 +1,5 @@
1
- export function createObjectFromKeys(keys) {
2
- return fn => {
1
+ export function createObjectFromKeys(fn) {
2
+ return keys => {
3
3
  const result = {}
4
4
  keys.forEach((key, index) => {
5
5
  result[key] = fn(key, index)
package/src/propOr.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defaultTo } from './defaultTo.js'
2
2
 
3
- export function propOr(defaultValue, property) {
3
+ export function propOr(property, defaultValue) {
4
4
  return obj => {
5
5
  if (!obj) {
6
6
  return defaultValue