rambda 7.2.1 → 7.4.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1431 -3264
  3. package/dist/rambda.js +83 -422
  4. package/dist/rambda.mjs +89 -433
  5. package/dist/rambda.umd.js +1 -1
  6. package/immutable.d.ts +290 -229
  7. package/index.d.ts +290 -229
  8. package/package.json +38 -33
  9. package/rambda.js +187 -0
  10. package/src/_internals/constants.js +1 -0
  11. package/src/_internals/isArray.js +1 -0
  12. package/src/_internals/isFalsy.js +2 -2
  13. package/src/_internals/isInteger.js +5 -0
  14. package/src/_internals/isIterable.js +5 -0
  15. package/src/_internals/isObject.js +1 -1
  16. package/src/_internals/isTruthy.js +2 -2
  17. package/src/_internals/keys.js +1 -0
  18. package/src/_internals/{_objectIs.js → objectIs.js} +2 -2
  19. package/src/applySpec.js +3 -3
  20. package/src/assocPath.js +7 -7
  21. package/src/clone.js +2 -2
  22. package/src/count.js +2 -2
  23. package/src/dropLastWhile.js +2 -2
  24. package/src/dropRepeats.js +2 -2
  25. package/src/dropRepeatsWith.js +2 -2
  26. package/src/dropWhile.js +2 -2
  27. package/src/endsWith.js +2 -2
  28. package/src/equals.js +3 -15
  29. package/src/evolve.js +1 -1
  30. package/src/filter.js +2 -2
  31. package/src/flatten.js +2 -2
  32. package/src/forEach.js +6 -6
  33. package/src/groupWith.js +2 -2
  34. package/src/identical.js +2 -2
  35. package/src/includes.js +2 -2
  36. package/src/isPromise.js +1 -1
  37. package/src/length.js +2 -2
  38. package/src/map.js +8 -7
  39. package/src/mathMod.js +2 -2
  40. package/src/merge.js +1 -1
  41. package/src/mergeDeepRight.js +2 -1
  42. package/src/mergeRight.js +2 -1
  43. package/src/modify.js +23 -0
  44. package/src/modifyPath.js +2 -2
  45. package/src/nop.js +1 -0
  46. package/src/partialObject.js +1 -11
  47. package/src/partition.js +2 -2
  48. package/src/props.js +2 -2
  49. package/src/reduce.js +2 -3
  50. package/src/splitAt.js +2 -2
  51. package/src/startsWith.js +2 -2
  52. package/src/takeLastWhile.js +2 -2
  53. package/src/takeWhile.js +2 -2
  54. package/src/test.js +1 -1
  55. package/src/times.js +2 -1
  56. package/src/transpose.js +2 -2
  57. package/src/unwind.js +4 -3
  58. package/src/update.js +1 -1
  59. package/src/where.js +1 -0
  60. package/src/_internals/_isArray.js +0 -1
  61. package/src/_internals/_isInteger.js +0 -5
  62. package/src/_internals/_keys.js +0 -1
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "rambda",
3
- "version": "7.2.1",
3
+ "version": "7.4.0",
4
4
  "scripts": {
5
+ "publishx": "node files/publish",
5
6
  "populatedocs": "cd ../rambda-scripts && yarn populate:docs",
6
7
  "populatedocs:x": "cd ../rambda-scripts && yarn populate:docs:rambdax",
7
8
  "populatereadme": "cd ../rambda-scripts && yarn populate:readme",
@@ -13,63 +14,65 @@
13
14
  "github": "cd ../rambda-scripts && yarn github",
14
15
  "fix-docsify": "cd ../rambda-scripts && yarn fix-docsify:rambda",
15
16
  "immutable": "cd ../rambda-scripts && yarn immutable:rambda",
16
- "immutable:x": "cd ../rambda-scripts && yarn immutable:rambdax",
17
17
  "usedby": "cd ../rambda-scripts && yarn usedby",
18
18
  "lint:all": "cd ../rambda-scripts && yarn lint",
19
19
  "lint:staged": "cd ../rambda-scripts && yarn lint:staged",
20
20
  "lint": "yarn git:add && yarn lint:staged && yarn git:add",
21
21
  "git:add": "git add -A",
22
22
  "build": "yarn build:main && yarn build:web",
23
- "build:web": "cross-env NODE_ENV=build rollup -c files/rollup.web.config.js",
24
- "build:main": "cross-env NODE_ENV=build rollup -c files/rollup.config.js",
23
+ "build:web": "cross-env NODE_ENV=build rollup -c files/rollup.web.config.mjs",
24
+ "build:main": "cross-env NODE_ENV=build rollup -c files/rollup.config.mjs",
25
25
  "docs": "npx docsify-cli init ./docs && yarn fix-docsify",
26
26
  "new": "cd ../rambda-scripts && yarn new",
27
- "test:all": "jest source -u --bail=false",
28
- "test": "jest -o --watch",
29
- "cover:spec": "jest source --coverage --no-cache -w 1",
30
- "cover": "yarn typings && yarn cover:spec",
27
+ "run:ramda:test": "cd ../rambda-scripts && yarn run:ramda:test",
28
+ "consume-typings:clone": "cd .. && git clone --depth 1 https://github.com/selfrefactor/rambda-scripts.git rambda-scripts-clone",
29
+ "consume-typings:execute": "cd ../rambda-scripts-clone/scripts/consume-typings && yarn start",
30
+ "consume-typings": "yarn consume-typings:clone && yarn consume-typings:execute",
31
+ "test:consume-typings": "jest source/_consumeTypings.test.js",
32
+ "test:typings": "dtslint --localTs ./node_modules/typescript/lib --expectOnly ./source",
33
+ "t": "yarn test:typings",
34
+ "test:all": "jest source/*.spec.js -u --bail=false",
35
+ "test": "jest -o -u --watch",
36
+ "test:ci": "jest source/*.spec.js --coverage --no-cache -w 1",
31
37
  "build:step": "yarn populatedocs && yarn populatereadme && yarn build:main",
32
- "benchmark:check:apply": "cd ../rambda-scripts && yarn check-benchmark",
33
- "benchmark:check": "yarn build:step && METHOD=compose yarn benchmark:check:apply",
34
- "benchmark:single": "cd ../rambda-scripts && METHOD=uniqWith RAMBDA_RUN_ALL=ON RAMBDA_RUN_INDEXES=ON yarn benchmark",
35
38
  "benchmark:all": "yarn build:step && cd ../rambda-scripts && yarn benchmark:all",
36
- "benchmark": "yarn build:step && yarn benchmark:single",
37
- "typings": "dtslint --localTs ./node_modules/typescript/lib --expectOnly ./source",
39
+ "benchmark:check": "yarn build:step && METHOD=compose yarn benchmark:check:apply",
40
+ "benchmark:check:apply": "cd ../rambda-scripts && yarn check-benchmark",
41
+ "benchmark": "cd ../rambda-scripts && RAMBDA_RUN_ALL=ON RAMBDA_RUN_INDEXES=ON yarn benchmark",
38
42
  "d:rambda-scripts": "cd ../rambda-scripts && run d",
39
- "d": "yarn out && yarn lint && run d && yarn d:rambda-scripts",
40
- "fix": "mkdir $HOME/.dts/perf -p"
43
+ "d": "yarn out && yarn lint && run d && yarn d:rambda-scripts"
41
44
  },
42
45
  "dependencies": {},
43
46
  "devDependencies": {
44
- "@babel/core": "7.18.9",
45
- "@babel/plugin-proposal-object-rest-spread": "7.18.9",
46
- "@babel/preset-env": "7.18.9",
47
- "@rollup/plugin-babel": "5.3.1",
48
- "@rollup/plugin-commonjs": "22.0.1",
49
- "@rollup/plugin-json": "4.1.0",
50
- "@rollup/plugin-node-resolve": "13.3.0",
51
- "@rollup/plugin-replace": "4.0.0",
52
- "@types/jest": "28.1.6",
53
- "@types/ramda": "0.28.15",
47
+ "@babel/core": "7.20.2",
48
+ "@babel/plugin-proposal-object-rest-spread": "7.20.2",
49
+ "@babel/preset-env": "7.20.2",
50
+ "@rollup/plugin-babel": "6.0.2",
51
+ "@rollup/plugin-commonjs": "23.0.2",
52
+ "@rollup/plugin-node-resolve": "15.0.1",
53
+ "@rollup/plugin-replace": "5.0.1",
54
+ "@types/jest": "29.2.2",
55
+ "@types/ramda": "0.28.18",
54
56
  "combinate": "1.1.11",
55
57
  "cross-env": "7.0.3",
56
58
  "dtslint": "4.2.1",
57
59
  "helpers-fn": "1.6.0",
58
60
  "is-ci": "3.0.1",
59
- "jest": "28.1.3",
60
- "jest-extended": "3.0.1",
61
+ "jest": "29.2.2",
62
+ "jest-extended": "3.1.0",
61
63
  "lodash": "4.17.21",
62
- "rambdax": "8.0.1",
64
+ "rambdax": "8.1.0",
63
65
  "ramda": "0.28.0",
64
- "rollup": "2.77.2",
66
+ "remeda": "1.2.0",
67
+ "rollup": "3.2.5",
65
68
  "rollup-plugin-cleanup": "3.2.1",
66
69
  "rollup-plugin-sourcemaps": "0.6.3",
67
70
  "rollup-plugin-uglify": "6.0.4",
68
- "typescript": "4.7.4"
71
+ "typescript": "4.8.4"
69
72
  },
70
73
  "jest": {
71
74
  "testEnvironment": "node",
72
- "testRegex": ".*\\.spec\\.js$",
75
+ "testRegex": ".*\\.(spec|test)\\.js$",
73
76
  "setupFilesAfterEnv": [
74
77
  "./files/testSetup.js"
75
78
  ],
@@ -86,6 +89,8 @@
86
89
  "CHANGELOG.md",
87
90
  "index.d.ts",
88
91
  "immutable.d.ts",
92
+ "rambda.js",
93
+ "rambda.js",
89
94
  "immutable.js"
90
95
  ],
91
96
  "repository": {
@@ -98,11 +103,11 @@
98
103
  "sideEffects": false,
99
104
  "main": "./dist/rambda.js",
100
105
  "umd": "./dist/rambda.umd.js",
101
- "module": "./dist/rambda.mjs",
106
+ "module": "./rambda.js",
102
107
  "types": "./index.d.ts",
103
108
  "exports": {
104
109
  ".": {
105
- "import": "./dist/rambda.mjs",
110
+ "import": "./rambda.js",
106
111
  "require": "./dist/rambda.js",
107
112
  "default": "./dist/rambda.js",
108
113
  "types": "./index.d.ts"
package/rambda.js ADDED
@@ -0,0 +1,187 @@
1
+ /// <reference types="./index.d.ts" />
2
+ export * from './src/F.js'
3
+ export * from './src/T.js'
4
+ export * from './src/add.js'
5
+ export * from './src/adjust.js'
6
+ export * from './src/all.js'
7
+ export * from './src/allPass.js'
8
+ export * from './src/always.js'
9
+ export * from './src/and.js'
10
+ export * from './src/any.js'
11
+ export * from './src/anyPass.js'
12
+ export * from './src/append.js'
13
+ export * from './src/apply.js'
14
+ export * from './src/applySpec.js'
15
+ export * from './src/assoc.js'
16
+ export * from './src/assocPath.js'
17
+ export * from './src/bind.js'
18
+ export * from './src/both.js'
19
+ export * from './src/chain.js'
20
+ export * from './src/clamp.js'
21
+ export * from './src/clone.js'
22
+ export * from './src/complement.js'
23
+ export * from './src/compose.js'
24
+ export * from './src/concat.js'
25
+ export * from './src/cond.js'
26
+ export * from './src/converge.js'
27
+ export * from './src/count.js'
28
+ export * from './src/countBy.js'
29
+ export * from './src/curry.js'
30
+ export * from './src/curryN.js'
31
+ export * from './src/dec.js'
32
+ export * from './src/defaultTo.js'
33
+ export * from './src/difference.js'
34
+ export * from './src/dissoc.js'
35
+ export * from './src/divide.js'
36
+ export * from './src/drop.js'
37
+ export * from './src/dropLast.js'
38
+ export * from './src/dropLastWhile.js'
39
+ export * from './src/dropRepeats.js'
40
+ export * from './src/dropRepeatsWith.js'
41
+ export * from './src/dropWhile.js'
42
+ export * from './src/either.js'
43
+ export * from './src/endsWith.js'
44
+ export * from './src/eqProps.js'
45
+ export * from './src/equals.js'
46
+ export * from './src/evolve.js'
47
+ export * from './src/filter.js'
48
+ export * from './src/find.js'
49
+ export * from './src/findIndex.js'
50
+ export * from './src/findLast.js'
51
+ export * from './src/findLastIndex.js'
52
+ export * from './src/flatten.js'
53
+ export * from './src/flip.js'
54
+ export * from './src/forEach.js'
55
+ export * from './src/fromPairs.js'
56
+ export * from './src/groupBy.js'
57
+ export * from './src/groupWith.js'
58
+ export * from './src/has.js'
59
+ export * from './src/hasPath.js'
60
+ export * from './src/head.js'
61
+ export * from './src/identical.js'
62
+ export * from './src/identity.js'
63
+ export * from './src/ifElse.js'
64
+ export * from './src/inc.js'
65
+ export * from './src/includes.js'
66
+ export * from './src/indexBy.js'
67
+ export * from './src/indexOf.js'
68
+ export * from './src/init.js'
69
+ export * from './src/intersection.js'
70
+ export * from './src/intersperse.js'
71
+ export * from './src/is.js'
72
+ export * from './src/isEmpty.js'
73
+ export * from './src/isNil.js'
74
+ export * from './src/join.js'
75
+ export * from './src/juxt.js'
76
+ export * from './src/keys.js'
77
+ export * from './src/last.js'
78
+ export * from './src/lastIndexOf.js'
79
+ export * from './src/length.js'
80
+ export * from './src/lens.js'
81
+ export * from './src/lensIndex.js'
82
+ export * from './src/lensPath.js'
83
+ export * from './src/lensProp.js'
84
+ export * from './src/map.js'
85
+ export * from './src/match.js'
86
+ export * from './src/mathMod.js'
87
+ export * from './src/max.js'
88
+ export * from './src/maxBy.js'
89
+ export * from './src/mean.js'
90
+ export * from './src/median.js'
91
+ export * from './src/merge.js'
92
+ export * from './src/mergeAll.js'
93
+ export * from './src/mergeDeepRight.js'
94
+ export * from './src/mergeLeft.js'
95
+ export * from './src/mergeRight.js'
96
+ export * from './src/mergeWith.js'
97
+ export * from './src/min.js'
98
+ export * from './src/minBy.js'
99
+ export * from './src/modify.js'
100
+ export * from './src/modifyPath.js'
101
+ export * from './src/modulo.js'
102
+ export * from './src/move.js'
103
+ export * from './src/multiply.js'
104
+ export * from './src/negate.js'
105
+ export * from './src/none.js'
106
+ export * from './src/nop.js'
107
+ export * from './src/not.js'
108
+ export * from './src/nth.js'
109
+ export * from './src/objOf.js'
110
+ export * from './src/of.js'
111
+ export * from './src/omit.js'
112
+ export * from './src/on.js'
113
+ export * from './src/once.js'
114
+ export * from './src/or.js'
115
+ export * from './src/over.js'
116
+ export * from './src/partial.js'
117
+ export * from './src/partialObject.js'
118
+ export * from './src/partition.js'
119
+ export * from './src/path.js'
120
+ export * from './src/pathEq.js'
121
+ export * from './src/pathOr.js'
122
+ export * from './src/paths.js'
123
+ export * from './src/pick.js'
124
+ export * from './src/pickAll.js'
125
+ export * from './src/pipe.js'
126
+ export * from './src/pluck.js'
127
+ export * from './src/prepend.js'
128
+ export * from './src/product.js'
129
+ export * from './src/prop.js'
130
+ export * from './src/propEq.js'
131
+ export * from './src/propIs.js'
132
+ export * from './src/propOr.js'
133
+ export * from './src/propSatisfies.js'
134
+ export * from './src/props.js'
135
+ export * from './src/range.js'
136
+ export * from './src/reduce.js'
137
+ export * from './src/reject.js'
138
+ export * from './src/repeat.js'
139
+ export * from './src/replace.js'
140
+ export * from './src/reverse.js'
141
+ export * from './src/set.js'
142
+ export * from './src/slice.js'
143
+ export * from './src/sort.js'
144
+ export * from './src/sortBy.js'
145
+ export * from './src/split.js'
146
+ export * from './src/splitAt.js'
147
+ export * from './src/splitEvery.js'
148
+ export * from './src/splitWhen.js'
149
+ export * from './src/startsWith.js'
150
+ export * from './src/subtract.js'
151
+ export * from './src/sum.js'
152
+ export * from './src/symmetricDifference.js'
153
+ export * from './src/tail.js'
154
+ export * from './src/take.js'
155
+ export * from './src/takeLast.js'
156
+ export * from './src/takeLastWhile.js'
157
+ export * from './src/takeWhile.js'
158
+ export * from './src/tap.js'
159
+ export * from './src/test.js'
160
+ export * from './src/times.js'
161
+ export * from './src/toLower.js'
162
+ export * from './src/toPairs.js'
163
+ export * from './src/toString.js'
164
+ export * from './src/toUpper.js'
165
+ export * from './src/transpose.js'
166
+ export * from './src/trim.js'
167
+ export * from './src/tryCatch.js'
168
+ export * from './src/type.js'
169
+ export * from './src/unapply.js'
170
+ export * from './src/union.js'
171
+ export * from './src/uniq.js'
172
+ export * from './src/uniqBy.js'
173
+ export * from './src/uniqWith.js'
174
+ export * from './src/unless.js'
175
+ export * from './src/unwind.js'
176
+ export * from './src/update.js'
177
+ export * from './src/values.js'
178
+ export * from './src/view.js'
179
+ export * from './src/when.js'
180
+ export * from './src/where.js'
181
+ export * from './src/whereAny.js'
182
+ export * from './src/whereEq.js'
183
+ export * from './src/without.js'
184
+ export * from './src/xor.js'
185
+ export * from './src/zip.js'
186
+ export * from './src/zipObj.js'
187
+ export * from './src/zipWith.js'
@@ -0,0 +1 @@
1
+ export const INCORRECT_ITERABLE_INPUT = 'Incorrect iterable input'
@@ -0,0 +1 @@
1
+ export const { isArray } = Array
@@ -1,8 +1,8 @@
1
1
  import { type } from '../type.js'
2
- import { _isArray } from './_isArray.js'
2
+ import { isArray } from './isArray.js'
3
3
 
4
4
  export function isFalsy(x){
5
- if (_isArray(x)){
5
+ if (isArray(x)){
6
6
  return x.length === 0
7
7
  }
8
8
  if (type(x) === 'Object'){
@@ -0,0 +1,5 @@
1
+ function _isInteger(n){
2
+ return n << 0 === n
3
+ }
4
+
5
+ export const isInteger = Number.isInteger || _isInteger
@@ -0,0 +1,5 @@
1
+ import { type } from '../type.js'
2
+
3
+ export function isIterable(input){
4
+ return Array.isArray(input) || type(input) === 'Object'
5
+ }
@@ -1,5 +1,5 @@
1
1
  import { type } from '../type.js'
2
2
 
3
- export function _isObject(input){
3
+ export function isObject(input){
4
4
  return type(input) === 'Object'
5
5
  }
@@ -1,8 +1,8 @@
1
1
  import { type } from '../type.js'
2
- import { _isArray } from './_isArray.js'
2
+ import { isArray } from './isArray.js'
3
3
 
4
4
  export function isTruthy(x){
5
- if (_isArray(x)){
5
+ if (isArray(x)){
6
6
  return x.length > 0
7
7
  }
8
8
  if (type(x) === 'Object'){
@@ -0,0 +1 @@
1
+ export const { keys } = Object
@@ -1,4 +1,4 @@
1
- export function _objectIs(a, b){
1
+ function _objectIs(a, b){
2
2
  if (a === b){
3
3
  return a !== 0 || 1 / a === 1 / b
4
4
  }
@@ -6,4 +6,4 @@ export function _objectIs(a, b){
6
6
  return a !== a && b !== b
7
7
  }
8
8
 
9
- export default Object.is || _objectIs
9
+ export const objectIs = Object.is || _objectIs
package/src/applySpec.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
 
3
3
  // recursively traverse the given spec object to find the highest arity function
4
4
  export function __findHighestArity(spec, max = 0){
@@ -74,13 +74,13 @@ function __applySpecWithArity(
74
74
  )
75
75
 
76
76
  // handle spec as Array
77
- if (_isArray(spec)){
77
+ if (isArray(spec)){
78
78
  const ret = []
79
79
  let i = 0
80
80
  const l = spec.length
81
81
  for (; i < l; i++){
82
82
  // handle recursive spec inside array
83
- if (typeof spec[ i ] === 'object' || _isArray(spec[ i ])){
83
+ if (typeof spec[ i ] === 'object' || isArray(spec[ i ])){
84
84
  ret[ i ] = __applySpecWithArity(
85
85
  spec[ i ], arity, cache
86
86
  )
package/src/assocPath.js CHANGED
@@ -1,6 +1,6 @@
1
- import { _isArray } from './_internals/_isArray.js'
2
- import { _isInteger } from './_internals/_isInteger.js'
3
1
  import { cloneList } from './_internals/cloneList.js'
2
+ import { isArray } from './_internals/isArray.js'
3
+ import { isInteger } from './_internals/isInteger.js'
4
4
  import { assoc } from './assoc.js'
5
5
  import { curry } from './curry.js'
6
6
 
@@ -9,7 +9,7 @@ function assocPathFn(
9
9
  ){
10
10
  const pathArrValue =
11
11
  typeof path === 'string' ?
12
- path.split('.').map(x => _isInteger(Number(x)) ? Number(x) : x) :
12
+ path.split('.').map(x => isInteger(Number(x)) ? Number(x) : x) :
13
13
  path
14
14
  if (pathArrValue.length === 0){
15
15
  return newValue
@@ -22,8 +22,8 @@ function assocPathFn(
22
22
  input === null ||
23
23
  !input.hasOwnProperty(index)
24
24
 
25
- const nextinput = condition ?
26
- _isInteger(pathArrValue[ 1 ]) ?
25
+ const nextInput = condition ?
26
+ isInteger(pathArrValue[ 1 ]) ?
27
27
  [] :
28
28
  {} :
29
29
  input[ index ]
@@ -31,11 +31,11 @@ function assocPathFn(
31
31
  newValue = assocPathFn(
32
32
  Array.prototype.slice.call(pathArrValue, 1),
33
33
  newValue,
34
- nextinput
34
+ nextInput
35
35
  )
36
36
  }
37
37
 
38
- if (_isInteger(index) && _isArray(input)){
38
+ if (isInteger(index) && isArray(input)){
39
39
  const arr = cloneList(input)
40
40
  arr[ index ] = newValue
41
41
 
package/src/clone.js CHANGED
@@ -1,7 +1,7 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
 
3
3
  export function clone(input){
4
- const out = _isArray(input) ? Array(input.length) : {}
4
+ const out = isArray(input) ? Array(input.length) : {}
5
5
  if (input && input.getTime) return new Date(input.getTime())
6
6
 
7
7
  for (const key in input){
package/src/count.js CHANGED
@@ -1,10 +1,10 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
 
3
3
  export function count(predicate, list){
4
4
  if (arguments.length === 1){
5
5
  return _list => count(predicate, _list)
6
6
  }
7
- if (!_isArray(list)) return 0
7
+ if (!isArray(list)) return 0
8
8
 
9
9
  return list.filter(x => predicate(x)).length
10
10
  }
@@ -1,11 +1,11 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray as isArrayMethod } from './_internals/isArray.js'
2
2
 
3
3
  export function dropLastWhile(predicate, iterable){
4
4
  if (arguments.length === 1){
5
5
  return _iterable => dropLastWhile(predicate, _iterable)
6
6
  }
7
7
  if (iterable.length === 0) return iterable
8
- const isArray = _isArray(iterable)
8
+ const isArray = isArrayMethod(iterable)
9
9
 
10
10
  if (typeof predicate !== 'function'){
11
11
  throw new Error(`'predicate' is from wrong type ${ typeof predicate }`)
@@ -1,8 +1,8 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
  import { equals } from './equals.js'
3
3
 
4
4
  export function dropRepeats(list){
5
- if (!_isArray(list)){
5
+ if (!isArray(list)){
6
6
  throw new Error(`${ list } is not a list`)
7
7
  }
8
8
 
@@ -1,11 +1,11 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
 
3
3
  export function dropRepeatsWith(predicate, list){
4
4
  if (arguments.length === 1){
5
5
  return _iterable => dropRepeatsWith(predicate, _iterable)
6
6
  }
7
7
 
8
- if (!_isArray(list)){
8
+ if (!isArray(list)){
9
9
  throw new Error(`${ list } is not a list`)
10
10
  }
11
11
 
package/src/dropWhile.js CHANGED
@@ -1,10 +1,10 @@
1
- import { _isArray } from '../src/_internals/_isArray.js'
1
+ import { isArray as isArrayMethod } from './_internals/isArray.js'
2
2
 
3
3
  export function dropWhile(predicate, iterable){
4
4
  if (arguments.length === 1){
5
5
  return _iterable => dropWhile(predicate, _iterable)
6
6
  }
7
- const isArray = _isArray(iterable)
7
+ const isArray = isArrayMethod(iterable)
8
8
  if (!isArray && typeof iterable !== 'string'){
9
9
  throw new Error('`iterable` is neither list nor a string')
10
10
  }
package/src/endsWith.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
  import { equals } from './equals.js'
3
3
 
4
4
  export function endsWith(target, iterable){
@@ -7,7 +7,7 @@ export function endsWith(target, iterable){
7
7
  if (typeof iterable === 'string'){
8
8
  return iterable.endsWith(target)
9
9
  }
10
- if (!_isArray(target)) return false
10
+ if (!isArray(target)) return false
11
11
 
12
12
  const diff = iterable.length - target.length
13
13
  let correct = true
package/src/equals.js CHANGED
@@ -1,8 +1,8 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
  import { type } from './type.js'
3
3
 
4
4
  export function _lastIndexOf(valueToFind, list){
5
- if (!_isArray(list)){
5
+ if (!isArray(list)){
6
6
  throw new Error(`Cannot read property 'indexOf' of ${ list }`)
7
7
  }
8
8
  const typeOfValue = type(valueToFind)
@@ -23,7 +23,7 @@ export function _lastIndexOf(valueToFind, list){
23
23
  }
24
24
 
25
25
  export function _indexOf(valueToFind, list){
26
- if (!_isArray(list)){
26
+ if (!isArray(list)){
27
27
  throw new Error(`Cannot read property 'indexOf' of ${ list }`)
28
28
  }
29
29
  const typeOfValue = type(valueToFind)
@@ -84,18 +84,6 @@ function parseRegex(maybeRegex){
84
84
  return [ true, maybeRegex.toString() ]
85
85
  }
86
86
 
87
- function equalsSets(a, b){
88
- if (a.size !== b.size){
89
- return false
90
- }
91
- const aList = _arrayFromIterator(a.values())
92
- const bList = _arrayFromIterator(b.values())
93
-
94
- const filtered = aList.filter(aInstance => _indexOf(aInstance, bList) === -1)
95
-
96
- return filtered.length === 0
97
- }
98
-
99
87
  export function equals(a, b){
100
88
  if (arguments.length === 1) return _b => equals(a, _b)
101
89
 
package/src/evolve.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
  import { mapArray, mapObject } from './map.js'
3
3
  import { type } from './type.js'
4
4
 
package/src/filter.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
 
3
3
  export function filterObject(predicate, obj){
4
4
  const willReturn = {}
@@ -42,7 +42,7 @@ export function filter(predicate, iterable){
42
42
  throw new Error('Incorrect iterable input')
43
43
  }
44
44
 
45
- if (_isArray(iterable)) return filterArray(
45
+ if (isArray(iterable)) return filterArray(
46
46
  predicate, iterable, false
47
47
  )
48
48
 
package/src/flatten.js CHANGED
@@ -1,10 +1,10 @@
1
- import { _isArray } from './_internals/_isArray.js'
1
+ import { isArray } from './_internals/isArray.js'
2
2
 
3
3
  export function flatten(list, input){
4
4
  const willReturn = input === undefined ? [] : input
5
5
 
6
6
  for (let i = 0; i < list.length; i++){
7
- if (_isArray(list[ i ])){
7
+ if (isArray(list[ i ])){
8
8
  flatten(list[ i ], willReturn)
9
9
  } else {
10
10
  willReturn.push(list[ i ])
package/src/forEach.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _isArray } from './_internals/_isArray.js'
2
- import { _keys } from './_internals/_keys.js'
1
+ import { isArray } from './_internals/isArray.js'
2
+ import { keys } from './_internals/keys.js'
3
3
 
4
4
  export function forEach(fn, list){
5
5
  if (arguments.length === 1) return _list => forEach(fn, _list)
@@ -8,7 +8,7 @@ export function forEach(fn, list){
8
8
  return
9
9
  }
10
10
 
11
- if (_isArray(list)){
11
+ if (isArray(list)){
12
12
  let index = 0
13
13
  const len = list.length
14
14
 
@@ -18,11 +18,11 @@ export function forEach(fn, list){
18
18
  }
19
19
  } else {
20
20
  let index = 0
21
- const keys = _keys(list)
22
- const len = keys.length
21
+ const listKeys = keys(list)
22
+ const len = listKeys.length
23
23
 
24
24
  while (index < len){
25
- const key = keys[ index ]
25
+ const key = listKeys[ index ]
26
26
  fn(
27
27
  list[ key ], key, list
28
28
  )