rambda 10.0.0-beta.3 → 10.0.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
- 10.0.0
1
+ 10.0.1
2
+
3
+ - Fix issue with `R.unwind`/`R.pick` typings - [Issue #766](https://github.com/selfrefactor/rambda/issues/766)
2
4
 
3
- CHANGELOG - 10.0.0
5
+ 10.0.0
4
6
 
5
7
  This is major revamp of `Rambda` library:
6
8
 
@@ -124,6 +126,8 @@ _ Regarding using object as input with TypeScript in methods such as `R.map/filt
124
126
 
125
127
  - Change `R.range` to work with descending order.
126
128
 
129
+ - Remove `rambda/immutable` as import option as it is hard to support in the new context.
130
+
127
131
  - Sync with typing of `@types/ramda`:
128
132
 
129
133
  -- allPass
@@ -194,7 +198,7 @@ const result = piped(
194
198
 
195
199
  9.4.1
196
200
 
197
- - Fix bug with `R.differenceWith` when two arrays has same length - [Issue #750](https://github.com/selfrefactor/rambda/issues/757)
201
+ - Fix bug with `R.differenceWith` when two arrays has same length - [Issue #757](https://github.com/selfrefactor/rambda/issues/757)
198
202
 
199
203
  - Allow path input to not be transformed when string numbers are there - [Issue #750](https://github.com/selfrefactor/rambda/issues/750)
200
204
 
package/README.md CHANGED
@@ -101,14 +101,6 @@ Because of the focus on `R.pipe`, there is only one way to use each method. This
101
101
  - All methods that 2 inputs, will have to be called with `R.methodName(input1)(input2)`
102
102
  - All methods that 3 inputs, will have to be called with `R.methodName(input1, input2)(input3)`
103
103
 
104
- ### Immutable TS definitions
105
-
106
- You can use immutable version of Rambda definitions, which is linted with ESLint `functional/prefer-readonly-type` plugin.
107
-
108
- ```
109
- import {filter} from 'rambda/immutable'
110
- ```
111
-
112
104
  ### Deno support
113
105
 
114
106
  ```
@@ -4953,9 +4945,7 @@ const expected = 'foo is BAR even 1 more'
4953
4945
  interpolate(inputWithTags: string): (templateArguments: object) => string;
4954
4946
 
4955
4947
  // API_MARKER_END
4956
- // ============================================
4957
-
4958
- export as namespace R
4948
+ // ===========================================
4959
4949
  ```
4960
4950
 
4961
4951
  </details>
@@ -7818,10 +7808,7 @@ const expected = [
7818
7808
 
7819
7809
  ```typescript
7820
7810
  pick<K extends PropertyKey>(propsToPick: K[]): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
7821
- pick<
7822
- S extends string,
7823
- K extends PickStringToPickPath<K>
7824
- >(propsToPick: S): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
7811
+ pick<S extends string>(propsToPick: S): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, ElementOf<PickStringToPickPath<S>>>>>>;
7825
7812
  ```
7826
7813
 
7827
7814
  </details>
@@ -8232,6 +8219,7 @@ function assertType<T, U extends T>(fn: (x: T) => x is U) {
8232
8219
  function convertToType<T>() {
8233
8220
  return <U>(x: U) => x as unknown as T
8234
8221
  }
8222
+ const convertToType = <T>(x: unknown)=> x as unknown as T
8235
8223
 
8236
8224
  function tapFn<T, U>(
8237
8225
  transformFn: (x: T) => U,
@@ -9551,6 +9539,8 @@ shuffle<T>(list: T[]): T[];
9551
9539
  <summary><strong>R.shuffle</strong> source</summary>
9552
9540
 
9553
9541
  ```javascript
9542
+ import { cloneList } from './_internals/cloneList.js'
9543
+
9554
9544
  export function shuffle(listInput) {
9555
9545
  const list = cloneList(listInput)
9556
9546
  let counter = list.length
@@ -12164,7 +12154,7 @@ describe('R.unless', () => {
12164
12154
 
12165
12155
  ```typescript
12166
12156
 
12167
- unwind<S extends string>(prop: S): <T>(obj: T) => MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>
12157
+ unwind<S extends string>(prop: S): <T extends Record<S, readonly any[]>>(obj: T) => Array<MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>>
12168
12158
  ```
12169
12159
 
12170
12160
  It takes an object and a property name. The method will return a list of objects, where each object is a shallow copy of the input object, but with the property array unwound.
@@ -12186,7 +12176,7 @@ const expected = [{a:1, b:2}, {a:1, b:3}]
12186
12176
  <summary>All TypeScript definitions</summary>
12187
12177
 
12188
12178
  ```typescript
12189
- unwind<S extends string>(prop: S): <T>(obj: T) => MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>;
12179
+ unwind<S extends string>(prop: S): <T extends Record<S, readonly any[]>>(obj: T) => Array<MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>>;
12190
12180
  ```
12191
12181
 
12192
12182
  </details>
@@ -12254,12 +12244,12 @@ const obj = {
12254
12244
 
12255
12245
  describe('R.unwind', () => {
12256
12246
  it('happy', () => {
12257
- const result = unwind('b')(obj)
12247
+ const [result] = unwind('b')(obj)
12258
12248
  result.a // $ExpectType number
12259
12249
  result.b // $ExpectType number
12260
12250
  })
12261
12251
  it('inside pipe', () => {
12262
- const result = pipe(obj, unwind('b'))
12252
+ const [result] = pipe(obj, unwind('b'))
12263
12253
  result.a // $ExpectType number
12264
12254
  result.b // $ExpectType number
12265
12255
  })
@@ -12716,9 +12706,11 @@ describe('R.zipWith', () => {
12716
12706
 
12717
12707
  ## ❯ CHANGELOG
12718
12708
 
12719
- 10.0.0
12709
+ 10.0.1
12720
12710
 
12721
- CHANGELOG - 10.0.0
12711
+ - Fix issue with `R.unwind`/`R.pick` typings - [Issue #766](https://github.com/selfrefactor/rambda/issues/766)
12712
+
12713
+ 10.0.0
12722
12714
 
12723
12715
  This is major revamp of `Rambda` library:
12724
12716
 
@@ -12842,6 +12834,8 @@ _ Regarding using object as input with TypeScript in methods such as `R.map/filt
12842
12834
 
12843
12835
  - Change `R.range` to work with descending order.
12844
12836
 
12837
+ - Remove `rambda/immutable` as import option as it is hard to support in the new context.
12838
+
12845
12839
  - Sync with typing of `@types/ramda`:
12846
12840
 
12847
12841
  -- allPass
@@ -12912,7 +12906,7 @@ const result = piped(
12912
12906
 
12913
12907
  9.4.1
12914
12908
 
12915
- - Fix bug with `R.differenceWith` when two arrays has same length - [Issue #750](https://github.com/selfrefactor/rambda/issues/757)
12909
+ - Fix bug with `R.differenceWith` when two arrays has same length - [Issue #757](https://github.com/selfrefactor/rambda/issues/757)
12916
12910
 
12917
12911
  - Allow path input to not be transformed when string numbers are there - [Issue #750](https://github.com/selfrefactor/rambda/issues/750)
12918
12912
 
package/dist/rambda.cjs CHANGED
@@ -87,11 +87,11 @@ function anyPass(predicates) {
87
87
  }
88
88
  }
89
89
 
90
- const cloneList$1 = list => Array.prototype.slice.call(list);
90
+ const cloneList = list => Array.prototype.slice.call(list);
91
91
 
92
92
  function append(x) {
93
93
  return list => {
94
- const clone = cloneList$1(list);
94
+ const clone = cloneList(list);
95
95
  clone.push(x);
96
96
 
97
97
  return clone
@@ -990,7 +990,7 @@ function modifyItemAtIndex(index, replaceFn) {
990
990
  return list
991
991
  }
992
992
 
993
- const clone = cloneList$1(list);
993
+ const clone = cloneList(list);
994
994
  clone[actualIndex] = replaceFn(clone[actualIndex]);
995
995
 
996
996
  return clone
@@ -999,7 +999,7 @@ function modifyItemAtIndex(index, replaceFn) {
999
999
 
1000
1000
  function update(index, newValue) {
1001
1001
  return list => {
1002
- const clone = cloneList$1(list);
1002
+ const clone = cloneList(list);
1003
1003
  if (index === -1) {
1004
1004
  return clone.fill(newValue, index)
1005
1005
  }
@@ -1160,7 +1160,7 @@ function pathSatisfies(fn, pathInput) {
1160
1160
  */
1161
1161
  function permutations(inputArray) {
1162
1162
  const result = [];
1163
- const array = cloneList$1(inputArray);
1163
+ const array = cloneList(inputArray);
1164
1164
  const k = array.length;
1165
1165
  if (k === 0) {
1166
1166
  return result;
@@ -1420,7 +1420,7 @@ function shuffle(listInput) {
1420
1420
  }
1421
1421
 
1422
1422
  function sort(sortFn) {
1423
- return list => cloneList$1(list).sort(sortFn)
1423
+ return list => cloneList(list).sort(sortFn)
1424
1424
  }
1425
1425
 
1426
1426
  function sortByFn (
@@ -1428,7 +1428,7 @@ function sortByFn (
1428
1428
  list,
1429
1429
  descending
1430
1430
  ){
1431
- const clone = cloneList$1(list);
1431
+ const clone = cloneList(list);
1432
1432
 
1433
1433
  return clone.sort((a, b) => {
1434
1434
  const aSortResult = sortFn(a);
@@ -1623,7 +1623,7 @@ function tryCatch(fn, fallback) {
1623
1623
 
1624
1624
  function union(x) {
1625
1625
  return y => {
1626
- const toReturn = cloneList$1(x);
1626
+ const toReturn = cloneList(x);
1627
1627
 
1628
1628
  y.forEach(yInstance => {
1629
1629
  if (!includes(yInstance)(x)) {
package/dist/rambda.js CHANGED
@@ -85,11 +85,11 @@ function anyPass(predicates) {
85
85
  }
86
86
  }
87
87
 
88
- const cloneList$1 = list => Array.prototype.slice.call(list);
88
+ const cloneList = list => Array.prototype.slice.call(list);
89
89
 
90
90
  function append(x) {
91
91
  return list => {
92
- const clone = cloneList$1(list);
92
+ const clone = cloneList(list);
93
93
  clone.push(x);
94
94
 
95
95
  return clone
@@ -988,7 +988,7 @@ function modifyItemAtIndex(index, replaceFn) {
988
988
  return list
989
989
  }
990
990
 
991
- const clone = cloneList$1(list);
991
+ const clone = cloneList(list);
992
992
  clone[actualIndex] = replaceFn(clone[actualIndex]);
993
993
 
994
994
  return clone
@@ -997,7 +997,7 @@ function modifyItemAtIndex(index, replaceFn) {
997
997
 
998
998
  function update(index, newValue) {
999
999
  return list => {
1000
- const clone = cloneList$1(list);
1000
+ const clone = cloneList(list);
1001
1001
  if (index === -1) {
1002
1002
  return clone.fill(newValue, index)
1003
1003
  }
@@ -1158,7 +1158,7 @@ function pathSatisfies(fn, pathInput) {
1158
1158
  */
1159
1159
  function permutations(inputArray) {
1160
1160
  const result = [];
1161
- const array = cloneList$1(inputArray);
1161
+ const array = cloneList(inputArray);
1162
1162
  const k = array.length;
1163
1163
  if (k === 0) {
1164
1164
  return result;
@@ -1418,7 +1418,7 @@ function shuffle(listInput) {
1418
1418
  }
1419
1419
 
1420
1420
  function sort(sortFn) {
1421
- return list => cloneList$1(list).sort(sortFn)
1421
+ return list => cloneList(list).sort(sortFn)
1422
1422
  }
1423
1423
 
1424
1424
  function sortByFn (
@@ -1426,7 +1426,7 @@ function sortByFn (
1426
1426
  list,
1427
1427
  descending
1428
1428
  ){
1429
- const clone = cloneList$1(list);
1429
+ const clone = cloneList(list);
1430
1430
 
1431
1431
  return clone.sort((a, b) => {
1432
1432
  const aSortResult = sortFn(a);
@@ -1621,7 +1621,7 @@ function tryCatch(fn, fallback) {
1621
1621
 
1622
1622
  function union(x) {
1623
1623
  return y => {
1624
- const toReturn = cloneList$1(x);
1624
+ const toReturn = cloneList(x);
1625
1625
 
1626
1626
  y.forEach(yInstance => {
1627
1627
  if (!includes(yInstance)(x)) {
@@ -91,11 +91,11 @@
91
91
  }
92
92
  }
93
93
 
94
- const cloneList$1 = list => Array.prototype.slice.call(list);
94
+ const cloneList = list => Array.prototype.slice.call(list);
95
95
 
96
96
  function append(x) {
97
97
  return list => {
98
- const clone = cloneList$1(list);
98
+ const clone = cloneList(list);
99
99
  clone.push(x);
100
100
 
101
101
  return clone
@@ -994,7 +994,7 @@
994
994
  return list
995
995
  }
996
996
 
997
- const clone = cloneList$1(list);
997
+ const clone = cloneList(list);
998
998
  clone[actualIndex] = replaceFn(clone[actualIndex]);
999
999
 
1000
1000
  return clone
@@ -1003,7 +1003,7 @@
1003
1003
 
1004
1004
  function update(index, newValue) {
1005
1005
  return list => {
1006
- const clone = cloneList$1(list);
1006
+ const clone = cloneList(list);
1007
1007
  if (index === -1) {
1008
1008
  return clone.fill(newValue, index)
1009
1009
  }
@@ -1164,7 +1164,7 @@
1164
1164
  */
1165
1165
  function permutations(inputArray) {
1166
1166
  const result = [];
1167
- const array = cloneList$1(inputArray);
1167
+ const array = cloneList(inputArray);
1168
1168
  const k = array.length;
1169
1169
  if (k === 0) {
1170
1170
  return result;
@@ -1424,7 +1424,7 @@
1424
1424
  }
1425
1425
 
1426
1426
  function sort(sortFn) {
1427
- return list => cloneList$1(list).sort(sortFn)
1427
+ return list => cloneList(list).sort(sortFn)
1428
1428
  }
1429
1429
 
1430
1430
  function sortByFn (
@@ -1432,7 +1432,7 @@
1432
1432
  list,
1433
1433
  descending
1434
1434
  ){
1435
- const clone = cloneList$1(list);
1435
+ const clone = cloneList(list);
1436
1436
 
1437
1437
  return clone.sort((a, b) => {
1438
1438
  const aSortResult = sortFn(a);
@@ -1627,7 +1627,7 @@
1627
1627
 
1628
1628
  function union(x) {
1629
1629
  return y => {
1630
- const toReturn = cloneList$1(x);
1630
+ const toReturn = cloneList(x);
1631
1631
 
1632
1632
  y.forEach(yInstance => {
1633
1633
  if (!includes(yInstance)(x)) {
package/index.d.ts CHANGED
@@ -440,9 +440,7 @@ export function interpolate(inputWithTags: string): (templateArguments: object)
440
440
 
441
441
 
442
442
  // API_MARKER_END
443
- // ============================================
444
-
445
- export as namespace R
443
+ // ===========================================
446
444
 
447
445
  /**
448
446
  * It loops through `listA` and `listB` and returns the intersection of the two according to `R.equals`.
@@ -1096,10 +1094,7 @@ export function permutations<T>(list: T[]): T[][];
1096
1094
  * String annotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.
1097
1095
  */
1098
1096
  export function pick<K extends PropertyKey>(propsToPick: K[]): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
1099
- export function pick<
1100
- S extends string,
1101
- K extends PickStringToPickPath<K>
1102
- >(propsToPick: S): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
1097
+ export function pick<S extends string>(propsToPick: S): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, ElementOf<PickStringToPickPath<S>>>>>>;
1103
1098
 
1104
1099
  /**
1105
1100
  * It performs left-to-right function composition, where first argument is the input for the chain of functions.
@@ -2162,7 +2157,7 @@ export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T
2162
2157
  /**
2163
2158
  * It takes an object and a property name. The method will return a list of objects, where each object is a shallow copy of the input object, but with the property array unwound.
2164
2159
  */
2165
- export function unwind<S extends string>(prop: S): <T>(obj: T) => MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>;
2160
+ export function unwind<S extends string>(prop: S): <T extends Record<S, readonly any[]>>(obj: T) => Array<MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>>;
2166
2161
 
2167
2162
  /**
2168
2163
  * It returns a copy of `list` with updated element at `index` with `newValue`.
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "rambda",
3
- "version": "10.0.0-beta.3",
3
+ "version": "10.0.1",
4
4
  "scripts": {
5
- "out": "yarn populatedocs && yarn populatereadme && yarn immutable && yarn build && yarn create-docsify",
5
+ "out": "yarn populatedocs && yarn populatereadme && yarn build && yarn create-docsify",
6
6
  "build": "yarn build:main && yarn build:web && yarn build:esm",
7
7
  "build:main": "rollup rambda.js --file dist/rambda.cjs --format cjs",
8
8
  "build:esm": "rollup rambda.js --file dist/rambda.js --format es",
9
9
  "build:web": "rollup rambda.js --file dist/rambda.umd.js --format umd --name \"R\"",
10
- "immutable": "cd ../rambda-scripts && yarn immutable",
11
10
  "populatedocs": "cd ../rambda-scripts && yarn populate:docs",
12
11
  "populatereadme": "cd ../rambda-scripts && yarn populate:readme",
13
12
  "lint": "cd source && run lint:folder > lint-output.txt",
13
+ "lint:typings": "tsc",
14
14
  "test:file": "node scripts/tasks/run/run-test.js",
15
15
  "test:ci": "vitest run",
16
16
  "test": "vitest run --watch -u",
@@ -40,17 +40,18 @@
40
40
  "devDependencies": {
41
41
  "@definitelytyped/dtslint": "0.0.182",
42
42
  "@types/mocha": "10.0.10",
43
- "@vitest/coverage-v8": "3.1.0-beta.2",
43
+ "@types/node": "22.14.1",
44
+ "@vitest/coverage-v8": "3.1.1",
44
45
  "helpers-fn": "2.0.0",
45
46
  "lodash": "4.17.21",
46
- "radashi": "^12.4.0",
47
+ "radashi": "13.0.0-beta.ffa4778",
47
48
  "rambdax": "11.3.1",
48
49
  "ramda": "0.30.1",
49
- "remeda": "2.21.2",
50
- "rollup": "4.36.0",
50
+ "remeda": "2.21.3",
51
+ "rollup": "4.40.0",
51
52
  "types-ramda": "0.30.1",
52
- "typescript": "5.9.0-dev.20250321",
53
- "vitest": "3.1.0-beta.2"
53
+ "typescript": "5.9.0-dev.20250418",
54
+ "vitest": "3.1.1"
54
55
  },
55
56
  "jest": {
56
57
  "testEnvironment": "node",
@@ -94,9 +95,7 @@
94
95
  "src",
95
96
  "CHANGELOG.md",
96
97
  "index.d.ts",
97
- "immutable.d.ts",
98
- "rambda.js",
99
- "immutable.js"
98
+ "rambda.js"
100
99
  ],
101
100
  "sideEffects": false,
102
101
  "umd": "./dist/rambda.umd.js",
package/src/shuffle.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { cloneList } from './_internals/cloneList.js'
2
+
1
3
  export function shuffle(listInput) {
2
4
  const list = cloneList(listInput)
3
5
  let counter = list.length