rambda 7.0.1 → 7.1.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 (202) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +5520 -6179
  3. package/dist/rambda.esm.js +1 -1
  4. package/dist/rambda.js +285 -79
  5. package/dist/rambda.mjs +271 -79
  6. package/dist/rambda.umd.js +1 -1
  7. package/immutable.d.ts +106 -24
  8. package/index.d.ts +97 -15
  9. package/package.json +119 -111
  10. package/src/F.js +1 -1
  11. package/src/T.js +1 -1
  12. package/src/_internals/_isInteger.js +1 -1
  13. package/src/_internals/_keys.js +0 -1
  14. package/src/_internals/_objectIs.js +2 -7
  15. package/src/_internals/baseSlice.js +8 -6
  16. package/src/_internals/cloneList.js +1 -3
  17. package/src/_internals/createPath.js +3 -0
  18. package/src/_internals/isFalsy.js +5 -5
  19. package/src/_internals/isObject.js +2 -2
  20. package/src/_internals/isTruthy.js +5 -5
  21. package/src/_internals/set.js +19 -13
  22. package/src/add.js +1 -1
  23. package/src/adjust.js +6 -4
  24. package/src/all.js +3 -3
  25. package/src/allPass.js +3 -3
  26. package/src/always.js +2 -2
  27. package/src/and.js +1 -1
  28. package/src/any.js +3 -3
  29. package/src/anyPass.js +3 -3
  30. package/src/append.js +2 -2
  31. package/src/apply.js +2 -2
  32. package/src/applySpec.js +59 -33
  33. package/src/assoc.js +7 -3
  34. package/src/assocPath.js +25 -21
  35. package/src/bind.js +3 -3
  36. package/src/both.js +1 -1
  37. package/src/chain.js +2 -2
  38. package/src/clamp.js +6 -6
  39. package/src/clone.js +10 -10
  40. package/src/complement.js +1 -1
  41. package/src/compose.js +5 -14
  42. package/src/concat.js +2 -2
  43. package/src/cond.js +3 -3
  44. package/src/converge.js +11 -11
  45. package/src/count.js +10 -0
  46. package/src/countBy.js +17 -0
  47. package/src/curry.js +2 -2
  48. package/src/curryN.js +81 -61
  49. package/src/defaultTo.js +3 -3
  50. package/src/difference.js +3 -3
  51. package/src/dissoc.js +4 -4
  52. package/src/divide.js +1 -1
  53. package/src/drop.js +1 -1
  54. package/src/dropLast.js +5 -5
  55. package/src/dropLastWhile.js +12 -12
  56. package/src/dropRepeats.js +6 -6
  57. package/src/dropRepeatsWith.js +7 -7
  58. package/src/dropWhile.js +9 -9
  59. package/src/either.js +2 -2
  60. package/src/endsWith.js +6 -5
  61. package/src/eqProps.js +6 -4
  62. package/src/equals.js +64 -65
  63. package/src/evolve.js +21 -23
  64. package/src/filter.js +21 -15
  65. package/src/find.js +4 -4
  66. package/src/findIndex.js +3 -3
  67. package/src/findLast.js +4 -4
  68. package/src/findLastIndex.js +3 -3
  69. package/src/flatten.js +6 -6
  70. package/src/flip.js +15 -11
  71. package/src/forEach.js +12 -10
  72. package/src/fromPairs.js +2 -2
  73. package/src/groupBy.js +6 -6
  74. package/src/groupWith.js +12 -10
  75. package/src/has.js +1 -1
  76. package/src/hasPath.js +3 -3
  77. package/src/head.js +3 -3
  78. package/src/identical.js +2 -2
  79. package/src/identity.js +1 -1
  80. package/src/ifElse.js +5 -3
  81. package/src/includes.js +6 -6
  82. package/src/indexBy.js +11 -11
  83. package/src/indexOf.js +3 -3
  84. package/src/init.js +7 -3
  85. package/src/intersection.js +3 -3
  86. package/src/intersperse.js +5 -5
  87. package/src/is.js +2 -2
  88. package/src/isEmpty.js +5 -5
  89. package/src/isNil.js +1 -1
  90. package/src/isPromise.js +3 -3
  91. package/src/join.js +1 -1
  92. package/src/juxt.js +3 -0
  93. package/src/keys.js +1 -1
  94. package/src/last.js +4 -4
  95. package/src/lastIndexOf.js +3 -3
  96. package/src/length.js +2 -2
  97. package/src/lens.js +3 -3
  98. package/src/lensIndex.js +4 -4
  99. package/src/lensPath.js +4 -4
  100. package/src/lensProp.js +4 -4
  101. package/src/map.js +15 -11
  102. package/src/match.js +1 -1
  103. package/src/mathMod.js +3 -3
  104. package/src/max.js +1 -1
  105. package/src/maxBy.js +4 -2
  106. package/src/maybe.js +4 -2
  107. package/src/mean.js +2 -2
  108. package/src/median.js +10 -12
  109. package/src/merge.js +1 -5
  110. package/src/mergeAll.js +4 -4
  111. package/src/mergeDeepRight.js +8 -8
  112. package/src/mergeLeft.js +3 -3
  113. package/src/mergeRight.js +7 -0
  114. package/src/mergeWith.js +29 -0
  115. package/src/min.js +1 -1
  116. package/src/minBy.js +4 -2
  117. package/src/modulo.js +1 -1
  118. package/src/move.js +8 -6
  119. package/src/multiply.js +1 -1
  120. package/src/negate.js +1 -1
  121. package/src/none.js +4 -4
  122. package/src/not.js +1 -1
  123. package/src/nth.js +6 -6
  124. package/src/objOf.js +3 -5
  125. package/src/of.js +2 -2
  126. package/src/omit.js +8 -8
  127. package/src/on.js +16 -0
  128. package/src/once.js +6 -6
  129. package/src/or.js +1 -1
  130. package/src/over.js +5 -3
  131. package/src/partial.js +3 -3
  132. package/src/partialObject.js +15 -0
  133. package/src/partition.js +18 -16
  134. package/src/path.js +9 -8
  135. package/src/pathEq.js +6 -4
  136. package/src/pathOr.js +6 -4
  137. package/src/paths.js +3 -3
  138. package/src/pick.js +8 -8
  139. package/src/pickAll.js +9 -9
  140. package/src/pipe.js +85 -13
  141. package/src/pluck.js +4 -4
  142. package/src/prepend.js +3 -3
  143. package/src/product.js +2 -2
  144. package/src/prop.js +2 -2
  145. package/src/propEq.js +5 -3
  146. package/src/propIs.js +6 -4
  147. package/src/propOr.js +6 -4
  148. package/src/propSatisfies.js +10 -0
  149. package/src/props.js +6 -6
  150. package/src/range.js +4 -4
  151. package/src/reduce.js +11 -7
  152. package/src/reject.js +2 -2
  153. package/src/repeat.js +2 -2
  154. package/src/replace.js +4 -2
  155. package/src/reverse.js +4 -3
  156. package/src/set.js +9 -5
  157. package/src/slice.js +4 -2
  158. package/src/sort.js +2 -2
  159. package/src/sortBy.js +2 -2
  160. package/src/split.js +1 -1
  161. package/src/splitAt.js +9 -9
  162. package/src/splitEvery.js +6 -8
  163. package/src/splitWhen.js +10 -10
  164. package/src/startsWith.js +6 -5
  165. package/src/subtract.js +1 -1
  166. package/src/sum.js +1 -1
  167. package/src/symmetricDifference.js +7 -9
  168. package/src/tail.js +2 -2
  169. package/src/take.js +5 -3
  170. package/src/takeLast.js +5 -3
  171. package/src/takeLastWhile.js +7 -7
  172. package/src/takeWhile.js +8 -8
  173. package/src/tap.js +1 -1
  174. package/src/test.js +3 -5
  175. package/src/times.js +4 -4
  176. package/src/toLower.js +1 -1
  177. package/src/toPairs.js +1 -1
  178. package/src/toString.js +1 -1
  179. package/src/toUpper.js +1 -1
  180. package/src/transpose.js +3 -4
  181. package/src/trim.js +1 -1
  182. package/src/tryCatch.js +7 -5
  183. package/src/type.js +5 -5
  184. package/src/unapply.js +2 -2
  185. package/src/union.js +3 -3
  186. package/src/uniq.js +3 -3
  187. package/src/uniqWith.js +12 -8
  188. package/src/unless.js +3 -3
  189. package/src/unwind.js +15 -0
  190. package/src/update.js +8 -4
  191. package/src/values.js +2 -2
  192. package/src/view.js +2 -2
  193. package/src/when.js +4 -2
  194. package/src/where.js +5 -5
  195. package/src/whereAny.js +12 -0
  196. package/src/whereEq.js +7 -9
  197. package/src/without.js +4 -4
  198. package/src/xor.js +2 -2
  199. package/src/zip.js +3 -3
  200. package/src/zipObj.js +6 -4
  201. package/src/zipWith.js +6 -6
  202. package/src/isFunction.js +0 -5
package/src/flatten.js CHANGED
@@ -1,13 +1,13 @@
1
- import {_isArray} from './_internals/_isArray'
1
+ import { _isArray } from './_internals/_isArray.js'
2
2
 
3
- export function flatten(list, input) {
3
+ export function flatten(list, input){
4
4
  const willReturn = input === undefined ? [] : input
5
5
 
6
- for (let i = 0; i < list.length; i++) {
7
- if (_isArray(list[i])) {
8
- flatten(list[i], willReturn)
6
+ for (let i = 0; i < list.length; i++){
7
+ if (_isArray(list[ i ])){
8
+ flatten(list[ i ], willReturn)
9
9
  } else {
10
- willReturn.push(list[i])
10
+ willReturn.push(list[ i ])
11
11
  }
12
12
  }
13
13
 
package/src/flip.js CHANGED
@@ -1,19 +1,23 @@
1
- function flipFn(fn) {
1
+ function flipFn(fn){
2
2
  return (...input) => {
3
- if (input.length === 1) {
4
- return holder => fn(holder, input[0])
5
- } else if (input.length === 2) {
6
- return fn(input[1], input[0])
7
- } else if (input.length === 3) {
8
- return fn(input[1], input[0], input[2])
9
- } else if (input.length === 4) {
10
- return fn(input[1], input[0], input[2], input[3])
3
+ if (input.length === 1){
4
+ return holder => fn(holder, input[ 0 ])
5
+ } else if (input.length === 2){
6
+ return fn(input[ 1 ], input[ 0 ])
7
+ } else if (input.length === 3){
8
+ return fn(
9
+ input[ 1 ], input[ 0 ], input[ 2 ]
10
+ )
11
+ } else if (input.length === 4){
12
+ return fn(
13
+ input[ 1 ], input[ 0 ], input[ 2 ], input[ 3 ]
14
+ )
11
15
  }
12
16
 
13
- throw new Error("R.flip doesn't work with arity > 4")
17
+ throw new Error('R.flip doesn\'t work with arity > 4')
14
18
  }
15
19
  }
16
20
 
17
- export function flip(fn) {
21
+ export function flip(fn){
18
22
  return flipFn(fn)
19
23
  }
package/src/forEach.js CHANGED
@@ -1,19 +1,19 @@
1
- import {_isArray} from './_internals/_isArray'
2
- import {_keys} from './_internals/_keys'
1
+ import { _isArray } from './_internals/_isArray.js'
2
+ import { _keys } from './_internals/_keys.js'
3
3
 
4
- export function forEach(fn, list) {
4
+ export function forEach(fn, list){
5
5
  if (arguments.length === 1) return _list => forEach(fn, _list)
6
6
 
7
- if (list === undefined) {
7
+ if (list === undefined){
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
 
15
- while (index < len) {
16
- fn(list[index])
15
+ while (index < len){
16
+ fn(list[ index ])
17
17
  index++
18
18
  }
19
19
  } else {
@@ -21,9 +21,11 @@ export function forEach(fn, list) {
21
21
  const keys = _keys(list)
22
22
  const len = keys.length
23
23
 
24
- while (index < len) {
25
- const key = keys[index]
26
- fn(list[key], key, list)
24
+ while (index < len){
25
+ const key = keys[ index ]
26
+ fn(
27
+ list[ key ], key, list
28
+ )
27
29
  index++
28
30
  }
29
31
  }
package/src/fromPairs.js CHANGED
@@ -1,6 +1,6 @@
1
- export function fromPairs(listOfPairs) {
1
+ export function fromPairs(listOfPairs){
2
2
  const toReturn = {}
3
- listOfPairs.forEach(([prop, value]) => (toReturn[prop] = value))
3
+ listOfPairs.forEach(([ prop, value ]) => toReturn[ prop ] = value)
4
4
 
5
5
  return toReturn
6
6
  }
package/src/groupBy.js CHANGED
@@ -1,16 +1,16 @@
1
- export function groupBy(groupFn, list) {
1
+ export function groupBy(groupFn, list){
2
2
  if (arguments.length === 1) return _list => groupBy(groupFn, _list)
3
3
 
4
4
  const result = {}
5
- for (let i = 0; i < list.length; i++) {
6
- const item = list[i]
5
+ for (let i = 0; i < list.length; i++){
6
+ const item = list[ i ]
7
7
  const key = groupFn(item)
8
8
 
9
- if (!result[key]) {
10
- result[key] = []
9
+ if (!result[ key ]){
10
+ result[ key ] = []
11
11
  }
12
12
 
13
- result[key].push(item)
13
+ result[ key ].push(item)
14
14
  }
15
15
 
16
16
  return result
package/src/groupWith.js CHANGED
@@ -1,24 +1,26 @@
1
- import {_isArray} from './_internals/_isArray'
2
- import {cloneList} from './_internals/cloneList'
1
+ import { _isArray } from './_internals/_isArray.js'
2
+ import { cloneList } from './_internals/cloneList.js'
3
3
 
4
- export function groupWith(compareFn, list) {
4
+ export function groupWith(compareFn, list){
5
5
  if (!_isArray(list)) throw new TypeError('list.reduce is not a function')
6
6
 
7
7
  const clone = cloneList(list)
8
8
 
9
- if (list.length === 1) return [clone]
9
+ if (list.length === 1) return [ clone ]
10
10
 
11
11
  const toReturn = []
12
12
  let holder = []
13
13
 
14
- clone.reduce((prev, current, i) => {
14
+ clone.reduce((
15
+ prev, current, i
16
+ ) => {
15
17
  if (i === 0) return current
16
18
 
17
19
  const okCompare = compareFn(prev, current)
18
20
  const holderIsEmpty = holder.length === 0
19
21
  const lastCall = i === list.length - 1
20
22
 
21
- if (okCompare) {
23
+ if (okCompare){
22
24
  if (holderIsEmpty) holder.push(prev)
23
25
  holder.push(current)
24
26
  if (lastCall) toReturn.push(holder)
@@ -26,15 +28,15 @@ export function groupWith(compareFn, list) {
26
28
  return current
27
29
  }
28
30
 
29
- if (holderIsEmpty) {
30
- toReturn.push([prev])
31
- if (lastCall) toReturn.push([current])
31
+ if (holderIsEmpty){
32
+ toReturn.push([ prev ])
33
+ if (lastCall) toReturn.push([ current ])
32
34
 
33
35
  return current
34
36
  }
35
37
 
36
38
  toReturn.push(holder)
37
- if (lastCall) toReturn.push([current])
39
+ if (lastCall) toReturn.push([ current ])
38
40
  holder = []
39
41
 
40
42
  return current
package/src/has.js CHANGED
@@ -1,4 +1,4 @@
1
- export function has(prop, obj) {
1
+ export function has(prop, obj){
2
2
  if (arguments.length === 1) return _obj => has(prop, _obj)
3
3
 
4
4
  if (!obj) return false
package/src/hasPath.js CHANGED
@@ -1,7 +1,7 @@
1
- import {path} from './path'
1
+ import { path } from './path.js'
2
2
 
3
- export function hasPath(pathInput, obj) {
4
- if (arguments.length === 1) {
3
+ export function hasPath(pathInput, obj){
4
+ if (arguments.length === 1){
5
5
  return objHolder => hasPath(pathInput, objHolder)
6
6
  }
7
7
 
package/src/head.js CHANGED
@@ -1,5 +1,5 @@
1
- export function head(listOrString) {
2
- if (typeof listOrString === 'string') return listOrString[0] || ''
1
+ export function head(listOrString){
2
+ if (typeof listOrString === 'string') return listOrString[ 0 ] || ''
3
3
 
4
- return listOrString[0]
4
+ return listOrString[ 0 ]
5
5
  }
package/src/identical.js CHANGED
@@ -1,6 +1,6 @@
1
- import _objectIs from './_internals/_objectIs'
1
+ import _objectIs from './_internals/_objectIs.js'
2
2
 
3
- export function identical(a, b) {
3
+ export function identical(a, b){
4
4
  if (arguments.length === 1) return _b => identical(a, _b)
5
5
 
6
6
  return _objectIs(a, b)
package/src/identity.js CHANGED
@@ -1,3 +1,3 @@
1
- export function identity(x) {
1
+ export function identity(x){
2
2
  return x
3
3
  }
package/src/ifElse.js CHANGED
@@ -1,11 +1,13 @@
1
- import {curry} from './curry'
1
+ import { curry } from './curry.js'
2
2
 
3
- function ifElseFn(condition, onTrue, onFalse) {
3
+ function ifElseFn(
4
+ condition, onTrue, onFalse
5
+ ){
4
6
  return (...input) => {
5
7
  const conditionResult =
6
8
  typeof condition === 'boolean' ? condition : condition(...input)
7
9
 
8
- if (conditionResult === true) {
10
+ if (conditionResult === true){
9
11
  return onTrue(...input)
10
12
  }
11
13
 
package/src/includes.js CHANGED
@@ -1,14 +1,14 @@
1
- import {_isArray} from './_internals/_isArray'
2
- import {_indexOf} from './equals'
1
+ import { _isArray } from './_internals/_isArray.js'
2
+ import { _indexOf } from './equals.js'
3
3
 
4
- export function includes(valueToFind, iterable) {
4
+ export function includes(valueToFind, iterable){
5
5
  if (arguments.length === 1)
6
6
  return _iterable => includes(valueToFind, _iterable)
7
- if (typeof iterable === 'string') {
7
+ if (typeof iterable === 'string'){
8
8
  return iterable.includes(valueToFind)
9
9
  }
10
- if (!iterable) {
11
- throw new TypeError(`Cannot read property \'indexOf\' of ${iterable}`)
10
+ if (!iterable){
11
+ throw new TypeError(`Cannot read property \'indexOf\' of ${ iterable }`)
12
12
  }
13
13
  if (!_isArray(iterable)) return false
14
14
 
package/src/indexBy.js CHANGED
@@ -1,28 +1,28 @@
1
- import {path} from './path'
1
+ import { path } from './path.js'
2
2
 
3
- function indexByPath(pathInput, list) {
3
+ function indexByPath(pathInput, list){
4
4
  const toReturn = {}
5
- for (let i = 0; i < list.length; i++) {
6
- const item = list[i]
7
- toReturn[path(pathInput, item)] = item
5
+ for (let i = 0; i < list.length; i++){
6
+ const item = list[ i ]
7
+ toReturn[ path(pathInput, item) ] = item
8
8
  }
9
9
 
10
10
  return toReturn
11
11
  }
12
12
 
13
- export function indexBy(condition, list) {
14
- if (arguments.length === 1) {
13
+ export function indexBy(condition, list){
14
+ if (arguments.length === 1){
15
15
  return _list => indexBy(condition, _list)
16
16
  }
17
17
 
18
- if (typeof condition === 'string') {
18
+ if (typeof condition === 'string'){
19
19
  return indexByPath(condition, list)
20
20
  }
21
21
 
22
22
  const toReturn = {}
23
- for (let i = 0; i < list.length; i++) {
24
- const item = list[i]
25
- toReturn[condition(item)] = item
23
+ for (let i = 0; i < list.length; i++){
24
+ const item = list[ i ]
25
+ toReturn[ condition(item) ] = item
26
26
  }
27
27
 
28
28
  return toReturn
package/src/indexOf.js CHANGED
@@ -1,7 +1,7 @@
1
- import {_indexOf} from './equals'
1
+ import { _indexOf } from './equals.js'
2
2
 
3
- export function indexOf(valueToFind, list) {
4
- if (arguments.length === 1) {
3
+ export function indexOf(valueToFind, list){
4
+ if (arguments.length === 1){
5
5
  return _list => _indexOf(valueToFind, _list)
6
6
  }
7
7
 
package/src/init.js CHANGED
@@ -1,7 +1,11 @@
1
- import baseSlice from './_internals/baseSlice'
1
+ import baseSlice from './_internals/baseSlice.js'
2
2
 
3
- export function init(listOrString) {
3
+ export function init(listOrString){
4
4
  if (typeof listOrString === 'string') return listOrString.slice(0, -1)
5
5
 
6
- return listOrString.length ? baseSlice(listOrString, 0, -1) : []
6
+ return listOrString.length ?
7
+ baseSlice(
8
+ listOrString, 0, -1
9
+ ) :
10
+ []
7
11
  }
@@ -1,7 +1,7 @@
1
- import {filter} from './filter'
2
- import {includes} from './includes'
1
+ import { filter } from './filter.js'
2
+ import { includes } from './includes.js'
3
3
 
4
- export function intersection(listA, listB) {
4
+ export function intersection(listA, listB){
5
5
  if (arguments.length === 1) return _list => intersection(listA, _list)
6
6
 
7
7
  return filter(x => includes(x, listA), listB)
@@ -1,15 +1,15 @@
1
- export function intersperse(separator, list) {
1
+ export function intersperse(separator, list){
2
2
  if (arguments.length === 1) return _list => intersperse(separator, _list)
3
3
 
4
4
  let index = -1
5
5
  const len = list.length
6
6
  const willReturn = []
7
7
 
8
- while (++index < len) {
9
- if (index === len - 1) {
10
- willReturn.push(list[index])
8
+ while (++index < len){
9
+ if (index === len - 1){
10
+ willReturn.push(list[ index ])
11
11
  } else {
12
- willReturn.push(list[index], separator)
12
+ willReturn.push(list[ index ], separator)
13
13
  }
14
14
  }
15
15
 
package/src/is.js CHANGED
@@ -1,8 +1,8 @@
1
- export function is(targetPrototype, x) {
1
+ export function is(targetPrototype, x){
2
2
  if (arguments.length === 1) return _x => is(targetPrototype, _x)
3
3
 
4
4
  return (
5
- (x != null && x.constructor === targetPrototype) ||
5
+ x != null && x.constructor === targetPrototype ||
6
6
  x instanceof targetPrototype
7
7
  )
8
8
  }
package/src/isEmpty.js CHANGED
@@ -1,16 +1,16 @@
1
- import {type} from './type'
1
+ import { type } from './type.js'
2
2
 
3
- export function isEmpty(input) {
3
+ export function isEmpty(input){
4
4
  const inputType = type(input)
5
- if (['Undefined', 'NaN', 'Number', 'Null'].includes(inputType))
5
+ if ([ 'Undefined', 'NaN', 'Number', 'Null' ].includes(inputType))
6
6
  return false
7
7
  if (!input) return true
8
8
 
9
- if (inputType === 'Object') {
9
+ if (inputType === 'Object'){
10
10
  return Object.keys(input).length === 0
11
11
  }
12
12
 
13
- if (inputType === 'Array') {
13
+ if (inputType === 'Array'){
14
14
  return input.length === 0
15
15
  }
16
16
 
package/src/isNil.js CHANGED
@@ -1,3 +1,3 @@
1
- export function isNil(x) {
1
+ export function isNil(x){
2
2
  return x === undefined || x === null
3
3
  }
package/src/isPromise.js CHANGED
@@ -1,5 +1,5 @@
1
- import {type} from './type'
1
+ import { type } from './type.js'
2
2
 
3
- export function isPromise(x) {
4
- return ['Async', 'Promise'].includes(type(x))
3
+ export function isPromise(x){
4
+ return [ 'Async', 'Promise' ].includes(type(x))
5
5
  }
package/src/join.js CHANGED
@@ -1,4 +1,4 @@
1
- export function join(glue, list) {
1
+ export function join(glue, list){
2
2
  if (arguments.length === 1) return _list => join(glue, _list)
3
3
 
4
4
  return list.join(glue)
package/src/juxt.js ADDED
@@ -0,0 +1,3 @@
1
+ export function juxt(listOfFunctions){
2
+ return (...args) => listOfFunctions.map(fn => fn(...args))
3
+ }
package/src/keys.js CHANGED
@@ -1,3 +1,3 @@
1
- export function keys(x) {
1
+ export function keys(x){
2
2
  return Object.keys(x)
3
3
  }
package/src/last.js CHANGED
@@ -1,7 +1,7 @@
1
- export function last(listOrString) {
2
- if (typeof listOrString === 'string') {
3
- return listOrString[listOrString.length - 1] || ''
1
+ export function last(listOrString){
2
+ if (typeof listOrString === 'string'){
3
+ return listOrString[ listOrString.length - 1 ] || ''
4
4
  }
5
5
 
6
- return listOrString[listOrString.length - 1]
6
+ return listOrString[ listOrString.length - 1 ]
7
7
  }
@@ -1,7 +1,7 @@
1
- import {_lastIndexOf} from './equals'
1
+ import { _lastIndexOf } from './equals.js'
2
2
 
3
- export function lastIndexOf(valueToFind, list) {
4
- if (arguments.length === 1) {
3
+ export function lastIndexOf(valueToFind, list){
4
+ if (arguments.length === 1){
5
5
  return _list => _lastIndexOf(valueToFind, _list)
6
6
  }
7
7
 
package/src/length.js CHANGED
@@ -1,6 +1,6 @@
1
- import {_isArray} from './_internals/_isArray'
1
+ import { _isArray } from './_internals/_isArray.js'
2
2
 
3
- export function length(x) {
3
+ export function length(x){
4
4
  if (_isArray(x)) return x.length
5
5
  if (typeof x === 'string') return x.length
6
6
 
package/src/lens.js CHANGED
@@ -1,6 +1,6 @@
1
- export function lens(getter, setter) {
2
- return function (functor) {
3
- return function (target) {
1
+ export function lens(getter, setter){
2
+ return function (functor){
3
+ return function (target){
4
4
  return functor(getter(target)).map(focus => setter(focus, target))
5
5
  }
6
6
  }
package/src/lensIndex.js CHANGED
@@ -1,7 +1,7 @@
1
- import {lens} from './lens'
2
- import {nth} from './nth'
3
- import {update} from './update'
1
+ import { lens } from './lens.js'
2
+ import { nth } from './nth.js'
3
+ import { update } from './update.js'
4
4
 
5
- export function lensIndex(index) {
5
+ export function lensIndex(index){
6
6
  return lens(nth(index), update(index))
7
7
  }
package/src/lensPath.js CHANGED
@@ -1,7 +1,7 @@
1
- import {assocPath} from './assocPath'
2
- import {lens} from './lens'
3
- import {path} from './path'
1
+ import { assocPath } from './assocPath.js'
2
+ import { lens } from './lens.js'
3
+ import { path } from './path.js'
4
4
 
5
- export function lensPath(key) {
5
+ export function lensPath(key){
6
6
  return lens(path(key), assocPath(key))
7
7
  }
package/src/lensProp.js CHANGED
@@ -1,7 +1,7 @@
1
- import {assoc} from './assoc'
2
- import {lens} from './lens'
3
- import {prop} from './prop'
1
+ import { assoc } from './assoc.js'
2
+ import { lens } from './lens.js'
3
+ import { prop } from './prop.js'
4
4
 
5
- export function lensProp(key) {
5
+ export function lensProp(key){
6
6
  return lens(prop(key), assoc(key))
7
7
  }
package/src/map.js CHANGED
@@ -1,12 +1,14 @@
1
- import {_isArray} from './_internals/_isArray'
2
- import {_keys} from './_internals/_keys'
1
+ import { _isArray } from './_internals/_isArray.js'
2
+ import { _keys } from './_internals/_keys.js'
3
3
 
4
- export function mapArray(fn, list, isIndexed = false) {
4
+ export function mapArray(
5
+ fn, list, isIndexed = false
6
+ ){
5
7
  let index = 0
6
8
  const willReturn = Array(list.length)
7
9
 
8
- while (index < list.length) {
9
- willReturn[index] = isIndexed ? fn(list[index], index) : fn(list[index])
10
+ while (index < list.length){
11
+ willReturn[ index ] = isIndexed ? fn(list[ index ], index) : fn(list[ index ])
10
12
 
11
13
  index++
12
14
  }
@@ -14,15 +16,17 @@ export function mapArray(fn, list, isIndexed = false) {
14
16
  return willReturn
15
17
  }
16
18
 
17
- export function mapObject(fn, obj) {
19
+ export function mapObject(fn, obj){
18
20
  let index = 0
19
21
  const keys = _keys(obj)
20
22
  const len = keys.length
21
23
  const willReturn = {}
22
24
 
23
- while (index < len) {
24
- const key = keys[index]
25
- willReturn[key] = fn(obj[key], key, obj)
25
+ while (index < len){
26
+ const key = keys[ index ]
27
+ willReturn[ key ] = fn(
28
+ obj[ key ], key, obj
29
+ )
26
30
  index++
27
31
  }
28
32
 
@@ -31,9 +35,9 @@ export function mapObject(fn, obj) {
31
35
 
32
36
  export const mapObjIndexed = mapObject
33
37
 
34
- export function map(fn, iterable) {
38
+ export function map(fn, iterable){
35
39
  if (arguments.length === 1) return _iterable => map(fn, _iterable)
36
- if (!iterable) {
40
+ if (!iterable){
37
41
  throw new Error('Incorrect iterable input')
38
42
  }
39
43
 
package/src/match.js CHANGED
@@ -1,4 +1,4 @@
1
- export function match(pattern, input) {
1
+ export function match(pattern, input){
2
2
  if (arguments.length === 1) return _input => match(pattern, _input)
3
3
 
4
4
  const willReturn = input.match(pattern)
package/src/mathMod.js CHANGED
@@ -1,8 +1,8 @@
1
- import _isInteger from './_internals/_isInteger'
1
+ import _isInteger from './_internals/_isInteger.js'
2
2
 
3
- export function mathMod(x, y) {
3
+ export function mathMod(x, y){
4
4
  if (arguments.length === 1) return _y => mathMod(x, _y)
5
5
  if (!_isInteger(x) || !_isInteger(y) || y < 1) return NaN
6
6
 
7
- return ((x % y) + y) % y
7
+ return (x % y + y) % y
8
8
  }
package/src/max.js CHANGED
@@ -1,4 +1,4 @@
1
- export function max(x, y) {
1
+ export function max(x, y){
2
2
  if (arguments.length === 1) return _y => max(x, _y)
3
3
 
4
4
  return y > x ? y : x
package/src/maxBy.js CHANGED
@@ -1,6 +1,8 @@
1
- import {curry} from './curry'
1
+ import { curry } from './curry.js'
2
2
 
3
- export function maxByFn(compareFn, x, y) {
3
+ export function maxByFn(
4
+ compareFn, x, y
5
+ ){
4
6
  return compareFn(y) > compareFn(x) ? y : x
5
7
  }
6
8
 
package/src/maybe.js CHANGED
@@ -1,6 +1,8 @@
1
- import {type} from './type'
1
+ import { type } from './type.js'
2
2
 
3
- export function maybe(ifRule, whenIf, whenElse) {
3
+ export function maybe(
4
+ ifRule, whenIf, whenElse
5
+ ){
4
6
  const whenIfInput =
5
7
  ifRule && type(whenIf) === 'Function' ? whenIf() : whenIf
6
8
 
package/src/mean.js CHANGED
@@ -1,5 +1,5 @@
1
- import {sum} from './sum'
1
+ import { sum } from './sum.js'
2
2
 
3
- export function mean(list) {
3
+ export function mean(list){
4
4
  return sum(list) / list.length
5
5
  }