@asd14/m 7.4.0 → 7.7.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 (380) hide show
  1. package/README.md +38 -28
  2. package/dist/all/all.js +15 -21
  3. package/dist/all/all.js.map +1 -1
  4. package/dist/all/all.test.js +58 -36
  5. package/dist/all/all.test.js.map +1 -1
  6. package/dist/any/any.js +16 -22
  7. package/dist/any/any.js.map +1 -1
  8. package/dist/any/any.test.js +54 -33
  9. package/dist/any/any.test.js.map +1 -1
  10. package/dist/append/append.js +9 -11
  11. package/dist/append/append.js.map +1 -1
  12. package/dist/append/append.test.js +37 -7
  13. package/dist/append/append.test.js.map +1 -1
  14. package/dist/bottom/bottom.js +23 -29
  15. package/dist/bottom/bottom.js.map +1 -1
  16. package/dist/bottom/bottom.test.js +53 -13
  17. package/dist/bottom/bottom.test.js.map +1 -1
  18. package/dist/cases/cases.js +5 -13
  19. package/dist/cases/cases.js.map +1 -1
  20. package/dist/cases/cases.test.js +67 -35
  21. package/dist/cases/cases.test.js.map +1 -1
  22. package/dist/clone/clone.js +21 -30
  23. package/dist/clone/clone.js.map +1 -1
  24. package/dist/clone/clone.test.js +38 -37
  25. package/dist/clone/clone.test.js.map +1 -1
  26. package/dist/compact/compact.js +39 -39
  27. package/dist/compact/compact.js.map +1 -1
  28. package/dist/compact/compact.test.js +83 -43
  29. package/dist/compact/compact.test.js.map +1 -1
  30. package/dist/contains/contains.js +6 -10
  31. package/dist/contains/contains.js.map +1 -1
  32. package/dist/contains/contains.test.js +7 -6
  33. package/dist/contains/contains.test.js.map +1 -1
  34. package/dist/converge/converge.js +34 -37
  35. package/dist/converge/converge.js.map +1 -1
  36. package/dist/converge/converge.test.js +62 -25
  37. package/dist/converge/converge.test.js.map +1 -1
  38. package/dist/count/count.js +36 -51
  39. package/dist/count/count.js.map +1 -1
  40. package/dist/count/count.test.js +97 -67
  41. package/dist/count/count.test.js.map +1 -1
  42. package/dist/curry/curry.js +20 -18
  43. package/dist/curry/curry.js.map +1 -1
  44. package/dist/curry/curry.test.js +8 -9
  45. package/dist/curry/curry.test.js.map +1 -1
  46. package/dist/debounce/debounce.js +15 -19
  47. package/dist/debounce/debounce.js.map +1 -1
  48. package/dist/debounce/debounce.test.js +43 -46
  49. package/dist/debounce/debounce.test.js.map +1 -1
  50. package/dist/dec/dec.js +3 -3
  51. package/dist/dec/dec.js.map +1 -1
  52. package/dist/dec/dec.test.js +4 -3
  53. package/dist/dec/dec.test.js.map +1 -1
  54. package/dist/deep-equal/deep-equal.bench.js +100 -64
  55. package/dist/deep-equal/deep-equal.bench.js.map +1 -1
  56. package/dist/deep-equal/deep-equal.js +14 -16
  57. package/dist/deep-equal/deep-equal.js.map +1 -1
  58. package/dist/deep-equal/deep-equal.own.js +57 -78
  59. package/dist/deep-equal/deep-equal.own.js.map +1 -1
  60. package/dist/deep-equal/deep-equal.test.js +127 -82
  61. package/dist/deep-equal/deep-equal.test.js.map +1 -1
  62. package/dist/distinct/distinct.bench.js +46 -31
  63. package/dist/distinct/distinct.bench.js.map +1 -1
  64. package/dist/distinct/distinct.js +15 -24
  65. package/dist/distinct/distinct.js.map +1 -1
  66. package/dist/distinct/distinct.test.js +37 -14
  67. package/dist/distinct/distinct.test.js.map +1 -1
  68. package/dist/drop-last/drop-last.js +8 -12
  69. package/dist/drop-last/drop-last.js.map +1 -1
  70. package/dist/drop-last/drop-last.test.js +34 -8
  71. package/dist/drop-last/drop-last.test.js.map +1 -1
  72. package/dist/elapsed-time/elapsed-time.js +17 -18
  73. package/dist/elapsed-time/elapsed-time.js.map +1 -1
  74. package/dist/elapsed-time/elapsed-time.test.js +9 -8
  75. package/dist/elapsed-time/elapsed-time.test.js.map +1 -1
  76. package/dist/ends-with/ends-with.js +10 -16
  77. package/dist/ends-with/ends-with.js.map +1 -1
  78. package/dist/ends-with/ends-with.test.js +8 -7
  79. package/dist/ends-with/ends-with.test.js.map +1 -1
  80. package/dist/escape/escape.js +3 -4
  81. package/dist/escape/escape.js.map +1 -1
  82. package/dist/escape-html/escape-html.js +12 -11
  83. package/dist/escape-html/escape-html.js.map +1 -1
  84. package/dist/escape-html/escape-html.test.js +6 -5
  85. package/dist/escape-html/escape-html.test.js.map +1 -1
  86. package/dist/escape-reg-exp/escape-reg-exp.js +1 -2
  87. package/dist/escape-reg-exp/escape-reg-exp.js.map +1 -1
  88. package/dist/escape-reg-exp/escape-reg-exp.test.js +9 -8
  89. package/dist/escape-reg-exp/escape-reg-exp.test.js.map +1 -1
  90. package/dist/filter/filter.js +16 -21
  91. package/dist/filter/filter.js.map +1 -1
  92. package/dist/filter/filter.test.js +94 -57
  93. package/dist/filter/filter.test.js.map +1 -1
  94. package/dist/find/find.js +38 -50
  95. package/dist/find/find.js.map +1 -1
  96. package/dist/find/find.test.js +73 -64
  97. package/dist/find/find.test.js.map +1 -1
  98. package/dist/find-index/find-index.js +16 -20
  99. package/dist/find-index/find-index.js.map +1 -1
  100. package/dist/find-index/find-index.test.js +48 -38
  101. package/dist/find-index/find-index.test.js.map +1 -1
  102. package/dist/first/first.js +3 -3
  103. package/dist/first/first.js.map +1 -1
  104. package/dist/first/first.test.js +13 -8
  105. package/dist/first/first.test.js.map +1 -1
  106. package/dist/flatten/flatten.js +19 -34
  107. package/dist/flatten/flatten.js.map +1 -1
  108. package/dist/flatten/flatten.test.js +59 -24
  109. package/dist/flatten/flatten.test.js.map +1 -1
  110. package/dist/for-each/for-each.js +10 -12
  111. package/dist/for-each/for-each.js.map +1 -1
  112. package/dist/for-each/for-each.test.js +36 -16
  113. package/dist/for-each/for-each.test.js.map +1 -1
  114. package/dist/group-by/group-by.js +13 -17
  115. package/dist/group-by/group-by.js.map +1 -1
  116. package/dist/group-by/group-by.test.js +83 -49
  117. package/dist/group-by/group-by.test.js.map +1 -1
  118. package/dist/gt/gt.js +3 -6
  119. package/dist/gt/gt.js.map +1 -1
  120. package/dist/gt/gt.test.js +7 -6
  121. package/dist/gt/gt.test.js.map +1 -1
  122. package/dist/has-key/has-key.js +3 -4
  123. package/dist/has-key/has-key.js.map +1 -1
  124. package/dist/has-key/has-key.test.js +10 -9
  125. package/dist/has-key/has-key.test.js.map +1 -1
  126. package/dist/hist/hist.js +22 -34
  127. package/dist/hist/hist.js.map +1 -1
  128. package/dist/hist/hist.test.js +43 -28
  129. package/dist/hist/hist.test.js.map +1 -1
  130. package/dist/i/i.js +3 -3
  131. package/dist/i/i.js.map +1 -1
  132. package/dist/i/i.test.js +17 -12
  133. package/dist/i/i.test.js.map +1 -1
  134. package/dist/inc/inc.js +3 -3
  135. package/dist/inc/inc.js.map +1 -1
  136. package/dist/inc/inc.test.js +4 -3
  137. package/dist/inc/inc.test.js.map +1 -1
  138. package/dist/index-by/index-by.js +12 -17
  139. package/dist/index-by/index-by.js.map +1 -1
  140. package/dist/index-by/index-by.test.js +44 -36
  141. package/dist/index-by/index-by.test.js.map +1 -1
  142. package/dist/index.js +13 -12
  143. package/dist/index.js.map +1 -1
  144. package/dist/index.test.js +7 -7
  145. package/dist/index.test.js.map +1 -1
  146. package/dist/intersect/intersect.js +41 -54
  147. package/dist/intersect/intersect.js.map +1 -1
  148. package/dist/intersect/intersect.test.js +74 -38
  149. package/dist/intersect/intersect.test.js.map +1 -1
  150. package/dist/is/is.js +13 -20
  151. package/dist/is/is.js.map +1 -1
  152. package/dist/is/is.test.js +25 -25
  153. package/dist/is/is.test.js.map +1 -1
  154. package/dist/is-between/is-between.js +9 -13
  155. package/dist/is-between/is-between.js.map +1 -1
  156. package/dist/is-between/is-between.test.js +14 -13
  157. package/dist/is-between/is-between.test.js.map +1 -1
  158. package/dist/is-empty/is-empty.js +23 -44
  159. package/dist/is-empty/is-empty.js.map +1 -1
  160. package/dist/is-empty/is-empty.test.js +31 -27
  161. package/dist/is-empty/is-empty.test.js.map +1 -1
  162. package/dist/is-equal/is-equal.js +3 -6
  163. package/dist/is-equal/is-equal.js.map +1 -1
  164. package/dist/is-equal/is-equal.test.js +19 -15
  165. package/dist/is-equal/is-equal.test.js.map +1 -1
  166. package/dist/is-match/is-match.js +16 -25
  167. package/dist/is-match/is-match.js.map +1 -1
  168. package/dist/is-match/is-match.test.js +67 -64
  169. package/dist/is-match/is-match.test.js.map +1 -1
  170. package/dist/is-uri/is-uri.js +3 -4
  171. package/dist/is-uri/is-uri.js.map +1 -1
  172. package/dist/is-uri/is-uri.test.js +13 -13
  173. package/dist/is-uri/is-uri.test.js.map +1 -1
  174. package/dist/join/join.js +42 -53
  175. package/dist/join/join.js.map +1 -1
  176. package/dist/join/join.test.js +94 -40
  177. package/dist/join/join.test.js.map +1 -1
  178. package/dist/keys/keys.js +34 -24
  179. package/dist/keys/keys.js.map +1 -1
  180. package/dist/keys/keys.test.js +21 -9
  181. package/dist/keys/keys.test.js.map +1 -1
  182. package/dist/last/last.js +3 -4
  183. package/dist/last/last.js.map +1 -1
  184. package/dist/last/last.test.js +14 -7
  185. package/dist/last/last.test.js.map +1 -1
  186. package/dist/lt/lt.js +3 -4
  187. package/dist/lt/lt.js.map +1 -1
  188. package/dist/lt/lt.test.js +6 -5
  189. package/dist/lt/lt.test.js.map +1 -1
  190. package/dist/map/map.js +12 -15
  191. package/dist/map/map.js.map +1 -1
  192. package/dist/map/map.test.js +61 -21
  193. package/dist/map/map.test.js.map +1 -1
  194. package/dist/map-matrix/map-matrix.js +12 -19
  195. package/dist/map-matrix/map-matrix.js.map +1 -1
  196. package/dist/map-matrix/map-matrix.test.js +76 -16
  197. package/dist/map-matrix/map-matrix.test.js.map +1 -1
  198. package/dist/max/max.js +27 -39
  199. package/dist/max/max.js.map +1 -1
  200. package/dist/max/max.test.js +43 -23
  201. package/dist/max/max.test.js.map +1 -1
  202. package/dist/merge/merge.js +53 -63
  203. package/dist/merge/merge.js.map +1 -1
  204. package/dist/merge/merge.test.js +57 -49
  205. package/dist/merge/merge.test.js.map +1 -1
  206. package/dist/min/min.js +27 -39
  207. package/dist/min/min.js.map +1 -1
  208. package/dist/min/min.test.js +38 -22
  209. package/dist/min/min.test.js.map +1 -1
  210. package/dist/move/move.js +23 -37
  211. package/dist/move/move.js.map +1 -1
  212. package/dist/move/move.test.js +58 -15
  213. package/dist/move/move.test.js.map +1 -1
  214. package/dist/mutate/mutate.js +76 -84
  215. package/dist/mutate/mutate.js.map +1 -1
  216. package/dist/mutate/mutate.test.js +107 -89
  217. package/dist/mutate/mutate.test.js.map +1 -1
  218. package/dist/page/page.js +7 -14
  219. package/dist/page/page.js.map +1 -1
  220. package/dist/page/page.test.js +66 -15
  221. package/dist/page/page.test.js.map +1 -1
  222. package/dist/partition/partition.js +20 -26
  223. package/dist/partition/partition.js.map +1 -1
  224. package/dist/partition/partition.test.js +96 -35
  225. package/dist/partition/partition.test.js.map +1 -1
  226. package/dist/pick/pick.js +20 -26
  227. package/dist/pick/pick.js.map +1 -1
  228. package/dist/pick/pick.test.js +22 -12
  229. package/dist/pick/pick.test.js.map +1 -1
  230. package/dist/pipe/pipe.js +15 -14
  231. package/dist/pipe/pipe.js.map +1 -1
  232. package/dist/pipe/pipe.test.js +9 -11
  233. package/dist/pipe/pipe.test.js.map +1 -1
  234. package/dist/pipe-p/pipe-p.js +18 -21
  235. package/dist/pipe-p/pipe-p.js.map +1 -1
  236. package/dist/pipe-p/pipe-p.test.js +21 -24
  237. package/dist/pipe-p/pipe-p.test.js.map +1 -1
  238. package/dist/pluck/pluck.js +27 -38
  239. package/dist/pluck/pluck.js.map +1 -1
  240. package/dist/pluck/pluck.test.js +57 -37
  241. package/dist/pluck/pluck.test.js.map +1 -1
  242. package/dist/prepend/prepend.js +9 -11
  243. package/dist/prepend/prepend.js.map +1 -1
  244. package/dist/prepend/prepend.test.js +37 -7
  245. package/dist/prepend/prepend.test.js.map +1 -1
  246. package/dist/proto-chain/proto-chain.js +8 -8
  247. package/dist/proto-chain/proto-chain.js.map +1 -1
  248. package/dist/proto-chain/proto-chain.test.js +21 -20
  249. package/dist/proto-chain/proto-chain.test.js.map +1 -1
  250. package/dist/push/push.js +9 -12
  251. package/dist/push/push.js.map +1 -1
  252. package/dist/push/push.test.js +19 -8
  253. package/dist/push/push.test.js.map +1 -1
  254. package/dist/raise/raise.js +3 -3
  255. package/dist/raise/raise.js.map +1 -1
  256. package/dist/raise/raise.test.js +6 -5
  257. package/dist/raise/raise.test.js.map +1 -1
  258. package/dist/random/random.js +4 -5
  259. package/dist/random/random.js.map +1 -1
  260. package/dist/random/random.test.js +11 -12
  261. package/dist/random/random.test.js.map +1 -1
  262. package/dist/read/read.js +41 -48
  263. package/dist/read/read.js.map +1 -1
  264. package/dist/read/read.test.js +106 -60
  265. package/dist/read/read.test.js.map +1 -1
  266. package/dist/reduce/reduce.js +24 -29
  267. package/dist/reduce/reduce.js.map +1 -1
  268. package/dist/reduce/reduce.test.js +43 -32
  269. package/dist/reduce/reduce.test.js.map +1 -1
  270. package/dist/remove/remove.js +39 -50
  271. package/dist/remove/remove.js.map +1 -1
  272. package/dist/remove/remove.test.js +92 -54
  273. package/dist/remove/remove.test.js.map +1 -1
  274. package/dist/rename/rename.js +40 -63
  275. package/dist/rename/rename.js.map +1 -1
  276. package/dist/rename/rename.test.js +45 -39
  277. package/dist/rename/rename.test.js.map +1 -1
  278. package/dist/rename-file/rename-file.js +6 -11
  279. package/dist/rename-file/rename-file.js.map +1 -1
  280. package/dist/rename-file/rename-file.test.js +9 -8
  281. package/dist/rename-file/rename-file.test.js.map +1 -1
  282. package/dist/repeat/repeat.js +23 -30
  283. package/dist/repeat/repeat.js.map +1 -1
  284. package/dist/repeat/repeat.test.js +28 -11
  285. package/dist/repeat/repeat.test.js.map +1 -1
  286. package/dist/replace/replace.js +29 -42
  287. package/dist/replace/replace.js.map +1 -1
  288. package/dist/replace/replace.test.js +127 -82
  289. package/dist/replace/replace.test.js.map +1 -1
  290. package/dist/same/same.js +5 -5
  291. package/dist/same/same.js.map +1 -1
  292. package/dist/same/same.test.js +5 -4
  293. package/dist/same/same.test.js.map +1 -1
  294. package/dist/sequence/sequence.js +31 -40
  295. package/dist/sequence/sequence.js.map +1 -1
  296. package/dist/sequence/sequence.test.js +132 -80
  297. package/dist/sequence/sequence.test.js.map +1 -1
  298. package/dist/sort/sort-with.js +90 -98
  299. package/dist/sort/sort-with.js.map +1 -1
  300. package/dist/sort/sort.js +24 -32
  301. package/dist/sort/sort.js.map +1 -1
  302. package/dist/sort/sort.test.js +407 -294
  303. package/dist/sort/sort.test.js.map +1 -1
  304. package/dist/split/split.js +22 -29
  305. package/dist/split/split.js.map +1 -1
  306. package/dist/split/split.test.js +29 -12
  307. package/dist/split/split.test.js.map +1 -1
  308. package/dist/split-in-groups-of/split-in-groups-of.js +29 -38
  309. package/dist/split-in-groups-of/split-in-groups-of.js.map +1 -1
  310. package/dist/split-in-groups-of/split-in-groups-of.test.js +84 -15
  311. package/dist/split-in-groups-of/split-in-groups-of.test.js.map +1 -1
  312. package/dist/spy/spy.js +19 -22
  313. package/dist/spy/spy.js.map +1 -1
  314. package/dist/spy/spy.test.js +32 -28
  315. package/dist/spy/spy.test.js.map +1 -1
  316. package/dist/starts-with/starts-with.js +7 -12
  317. package/dist/starts-with/starts-with.js.map +1 -1
  318. package/dist/starts-with/starts-with.test.js +12 -8
  319. package/dist/starts-with/starts-with.test.js.map +1 -1
  320. package/dist/throttle/throttle.js +24 -31
  321. package/dist/throttle/throttle.js.map +1 -1
  322. package/dist/throttle/throttle.test.js +35 -37
  323. package/dist/throttle/throttle.test.js.map +1 -1
  324. package/dist/to-lower/to-lower.js +3 -3
  325. package/dist/to-lower/to-lower.js.map +1 -1
  326. package/dist/to-lower/to-lower.test.js +5 -4
  327. package/dist/to-lower/to-lower.test.js.map +1 -1
  328. package/dist/to-upper/to-upper.js +3 -3
  329. package/dist/to-upper/to-upper.js.map +1 -1
  330. package/dist/to-upper/to-upper.test.js +5 -4
  331. package/dist/to-upper/to-upper.test.js.map +1 -1
  332. package/dist/toggle/toggle.js +9 -11
  333. package/dist/toggle/toggle.js.map +1 -1
  334. package/dist/toggle/toggle.test.js +24 -5
  335. package/dist/toggle/toggle.test.js.map +1 -1
  336. package/dist/top/top.js +23 -35
  337. package/dist/top/top.js.map +1 -1
  338. package/dist/top/top.test.js +47 -13
  339. package/dist/top/top.test.js.map +1 -1
  340. package/dist/trim/trim.js +19 -26
  341. package/dist/trim/trim.js.map +1 -1
  342. package/dist/trim/trim.test.js +6 -5
  343. package/dist/trim/trim.test.js.map +1 -1
  344. package/dist/try-catch/try-catch.js +15 -14
  345. package/dist/try-catch/try-catch.js.map +1 -1
  346. package/dist/try-catch/try-catch.test.js +9 -8
  347. package/dist/try-catch/try-catch.test.js.map +1 -1
  348. package/dist/type/type.js +3 -4
  349. package/dist/type/type.js.map +1 -1
  350. package/dist/type/type.test.js +16 -16
  351. package/dist/type/type.test.js.map +1 -1
  352. package/dist/unite/unite.js +3 -6
  353. package/dist/unite/unite.js.map +1 -1
  354. package/dist/unite/unite.test.js +8 -3
  355. package/dist/unite/unite.test.js.map +1 -1
  356. package/dist/update/update.js +74 -81
  357. package/dist/update/update.js.map +1 -1
  358. package/dist/update/update.test.js +92 -79
  359. package/dist/update/update.test.js.map +1 -1
  360. package/dist/upsert/upsert.js +14 -18
  361. package/dist/upsert/upsert.js.map +1 -1
  362. package/dist/upsert/upsert.test.js +57 -42
  363. package/dist/upsert/upsert.test.js.map +1 -1
  364. package/dist/values/values.js +38 -29
  365. package/dist/values/values.js.map +1 -1
  366. package/dist/values/values.test.js +21 -9
  367. package/dist/values/values.test.js.map +1 -1
  368. package/dist/when/when.js +27 -37
  369. package/dist/when/when.js.map +1 -1
  370. package/dist/when/when.test.js +23 -15
  371. package/dist/when/when.test.js.map +1 -1
  372. package/dist/write/write.js +6 -12
  373. package/dist/write/write.js.map +1 -1
  374. package/dist/write/write.test.js +14 -13
  375. package/dist/write/write.test.js.map +1 -1
  376. package/dist/zip-to-object/zip-to-object.js +8 -11
  377. package/dist/zip-to-object/zip-to-object.js.map +1 -1
  378. package/dist/zip-to-object/zip-to-object.test.js +29 -12
  379. package/dist/zip-to-object/zip-to-object.test.js.map +1 -1
  380. package/package.json +47 -38
package/dist/keys/keys.js CHANGED
@@ -1,5 +1,3 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
-
3
1
  /**
4
2
  * Get list with names of all own properties
5
3
  *
@@ -20,27 +18,39 @@ import _typeof from "@babel/runtime/helpers/typeof";
20
18
  *
21
19
  * keys("foo"), keys(12), keys(null), etc
22
20
  * // => []
23
- */
24
- export var keys = function keys(input) {
25
- var type = Array.isArray(input) ? "array" : input !== null && _typeof(input) === "object" ? "object" : "other";
26
-
27
- switch (type) {
28
- case "object":
29
- case "array":
30
- {
31
- var entries = Object.entries(input);
32
- var result = [];
33
-
34
- for (var _i = 0, _entries = entries; _i < _entries.length; _i++) {
35
- var entry = _entries[_i];
36
- result.push(entry[0]);
37
- }
38
-
39
- return result;
40
- }
41
-
42
- default:
43
- return [];
44
- }
21
+ */ export var keys = function(input) {
22
+ var type = Array.isArray(input) ? "array" : input !== null && typeof input === "object" ? "object" : "other";
23
+ switch(type){
24
+ case "object":
25
+ case "array":
26
+ {
27
+ var entries = Object.entries(input);
28
+ var result = [];
29
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
30
+ try {
31
+ for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
32
+ var entry = _step.value;
33
+ result.push(entry[0]);
34
+ }
35
+ } catch (err) {
36
+ _didIteratorError = true;
37
+ _iteratorError = err;
38
+ } finally{
39
+ try {
40
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
41
+ _iterator.return();
42
+ }
43
+ } finally{
44
+ if (_didIteratorError) {
45
+ throw _iteratorError;
46
+ }
47
+ }
48
+ }
49
+ return result;
50
+ }
51
+ default:
52
+ return [];
53
+ }
45
54
  };
55
+
46
56
  //# sourceMappingURL=keys.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/keys/keys.js"],"names":["keys","input","type","Array","isArray","entries","Object","result","entry","push"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMA,IAAI,GAAG,SAAPA,IAAO,CAAAC,KAAK,EAAI;AAC3B,MAAMC,IAAI,GAAGC,KAAK,CAACC,OAAN,CAAcH,KAAd,IACT,OADS,GAETA,KAAK,KAAK,IAAV,IAAkB,QAAOA,KAAP,MAAiB,QAAnC,GACA,QADA,GAEA,OAJJ;;AAMA,UAAQC,IAAR;AACE,SAAK,QAAL;AACA,SAAK,OAAL;AAAc;AACZ,YAAMG,OAAO,GAAGC,MAAM,CAACD,OAAP,CAAeJ,KAAf,CAAhB;AACA,YAAMM,MAAM,GAAG,EAAf;;AAEA,oCAAoBF,OAApB,8BAA6B;AAAxB,cAAMG,KAAK,eAAX;AACHD,UAAAA,MAAM,CAACE,IAAP,CAAYD,KAAK,CAAC,CAAD,CAAjB;AACD;;AAED,eAAOD,MAAP;AACD;;AACD;AACE,aAAO,EAAP;AAbJ;AAeD,CAtBM","sourcesContent":["/**\n * Get list with names of all own properties\n *\n * @param {Array|Object} input Array or Object to extract keys from\n *\n * @returns {string[]} List of property names\n *\n * @name keys\n * @tag Array,Object\n * @signature (input: Array|Object): string[]\n *\n * @example\n * keys([\"lorem\", \"ipsum\"])\n * // => [\"0\", \"1\"]\n *\n * keys({ foo: \"bar\", lorem: \"ipsum\"})\n * // => [\"foo\", \"lorem\"]\n *\n * keys(\"foo\"), keys(12), keys(null), etc\n * // => []\n */\nexport const keys = input => {\n const type = Array.isArray(input)\n ? \"array\"\n : input !== null && typeof input === \"object\"\n ? \"object\"\n : \"other\"\n\n switch (type) {\n case \"object\":\n case \"array\": {\n const entries = Object.entries(input)\n const result = []\n\n for (const entry of entries) {\n result.push(entry[0])\n }\n\n return result\n }\n default:\n return []\n }\n}\n"],"file":"keys.js"}
1
+ {"version":3,"sources":["../../src/keys/keys.js"],"sourcesContent":["/**\n * Get list with names of all own properties\n *\n * @param {Array|Object} input Array or Object to extract keys from\n *\n * @returns {string[]} List of property names\n *\n * @name keys\n * @tag Array,Object\n * @signature (input: Array|Object): string[]\n *\n * @example\n * keys([\"lorem\", \"ipsum\"])\n * // => [\"0\", \"1\"]\n *\n * keys({ foo: \"bar\", lorem: \"ipsum\"})\n * // => [\"foo\", \"lorem\"]\n *\n * keys(\"foo\"), keys(12), keys(null), etc\n * // => []\n */\nexport const keys = input => {\n const type = Array.isArray(input)\n ? \"array\"\n : input !== null && typeof input === \"object\"\n ? \"object\"\n : \"other\"\n\n switch (type) {\n case \"object\":\n case \"array\": {\n const entries = Object.entries(input)\n const result = []\n\n for (const entry of entries) {\n result.push(entry[0])\n }\n\n return result\n }\n default:\n return []\n }\n}\n"],"names":["keys","input","type","Array","isArray","entries","Object","result","entry","push"],"mappings":"AAAA,EAoBG,AApBH;;;;;;;;;;;;;;;;;;;;CAoBG,AApBH,EAoBG,CACH,MAAM,CAAC,GAAK,CAACA,IAAI,GAAGC,QAAQ,CAARA,KAAK,EAAI,CAAC;IAC5B,GAAK,CAACC,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACH,KAAK,IAC5B,CAAO,SACPA,KAAK,KAAK,IAAI,IAAI,MAAM,CAACA,KAAK,KAAK,CAAQ,UAC3C,CAAQ,UACR,CAAO;IAEX,MAAM,CAAEC,IAAI;QACV,IAAI,CAAC,CAAQ;QACb,IAAI,CAAC,CAAO;YAAE,CAAC;gBACb,GAAK,CAACG,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACJ,KAAK;gBACpC,GAAK,CAACM,MAAM,GAAG,CAAC,CAAC;oBAEZ,yBAAW,SAAX,iBAAW,UAAX,cAAW;;oBAAhB,GAAG,KAAE,SAAW,GAAIF,OAAO,qBAAtB,KAAW,IAAX,yBAAW,IAAX,KAAW,GAAX,SAAW,gBAAX,yBAAW,QAAa,CAAC;wBAAzB,GAAK,CAACG,KAAK,GAAX,KAAW;wBACdD,MAAM,CAACE,IAAI,CAACD,KAAK,CAAC,CAAC;oBACrB,CAAC;;oBAFI,iBAAW;oBAAX,cAAW;;;6BAAX,yBAAW,IAAX,SAAW;4BAAX,SAAW;;;4BAAX,iBAAW;kCAAX,cAAW;;;;gBAIhB,MAAM,CAACD,MAAM;YACf,CAAC;;YAEC,MAAM,CAAC,CAAC,CAAC;;AAEf,CAAC"}
@@ -1,13 +1,25 @@
1
1
  import test from "tape";
2
2
  import { keys } from "./keys.js";
3
- test("keys", function (t) {
4
- t.deepEquals(keys(["test", 1, 2]), ["0", "1", "2"], "When passing an array, should return an array of string with the index of each element");
5
- t.deepEquals(keys({
6
- foo: "bar",
7
- lorem: "ipsum"
8
- }), ["foo", "lorem"], "When passing an object, should return an array of strings with the key values");
9
- t.deepEquals(keys("lorem"), [], "When passing a string, should return an empty array");
10
- t.deepEquals(keys(12), [], "when passing a number, should return an empty array");
11
- t.end();
3
+ test("keys", function(t) {
4
+ t.deepEquals(keys([
5
+ "test",
6
+ 1,
7
+ 2
8
+ ]), [
9
+ "0",
10
+ "1",
11
+ "2"
12
+ ], "When passing an array, should return an array of string with the index of each element");
13
+ t.deepEquals(keys({
14
+ foo: "bar",
15
+ lorem: "ipsum"
16
+ }), [
17
+ "foo",
18
+ "lorem"
19
+ ], "When passing an object, should return an array of strings with the key values");
20
+ t.deepEquals(keys("lorem"), [], "When passing a string, should return an empty array");
21
+ t.deepEquals(keys(12), [], "when passing a number, should return an empty array");
22
+ t.end();
12
23
  });
24
+
13
25
  //# sourceMappingURL=keys.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/keys/keys.test.js"],"names":["test","keys","t","deepEquals","foo","lorem","end"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,MAAjB;AAEA,SAASC,IAAT,QAAqB,WAArB;AAEAD,IAAI,CAAC,MAAD,EAAS,UAAAE,CAAC,EAAI;AAChBA,EAAAA,CAAC,CAACC,UAAF,CACEF,IAAI,CAAC,CAAC,MAAD,EAAS,CAAT,EAAY,CAAZ,CAAD,CADN,EAEE,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAFF,EAGE,wFAHF;AAMAC,EAAAA,CAAC,CAACC,UAAF,CACEF,IAAI,CAAC;AAAEG,IAAAA,GAAG,EAAE,KAAP;AAAcC,IAAAA,KAAK,EAAE;AAArB,GAAD,CADN,EAEE,CAAC,KAAD,EAAQ,OAAR,CAFF,EAGE,+EAHF;AAMAH,EAAAA,CAAC,CAACC,UAAF,CACEF,IAAI,CAAC,OAAD,CADN,EAEE,EAFF,EAGE,qDAHF;AAMAC,EAAAA,CAAC,CAACC,UAAF,CACEF,IAAI,CAAC,EAAD,CADN,EAEE,EAFF,EAGE,qDAHF;AAMAC,EAAAA,CAAC,CAACI,GAAF;AACD,CA1BG,CAAJ","sourcesContent":["import test from \"tape\"\n\nimport { keys } from \"./keys.js\"\n\ntest(\"keys\", t => {\n t.deepEquals(\n keys([\"test\", 1, 2]),\n [\"0\", \"1\", \"2\"],\n \"When passing an array, should return an array of string with the index of each element\"\n )\n\n t.deepEquals(\n keys({ foo: \"bar\", lorem: \"ipsum\" }),\n [\"foo\", \"lorem\"],\n \"When passing an object, should return an array of strings with the key values\"\n )\n\n t.deepEquals(\n keys(\"lorem\"),\n [],\n \"When passing a string, should return an empty array\"\n )\n\n t.deepEquals(\n keys(12),\n [],\n \"when passing a number, should return an empty array\"\n )\n\n t.end()\n})\n"],"file":"keys.test.js"}
1
+ {"version":3,"sources":["../../src/keys/keys.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { keys } from \"./keys.js\"\n\ntest(\"keys\", t => {\n t.deepEquals(\n keys([\"test\", 1, 2]),\n [\"0\", \"1\", \"2\"],\n \"When passing an array, should return an array of string with the index of each element\"\n )\n\n t.deepEquals(\n keys({ foo: \"bar\", lorem: \"ipsum\" }),\n [\"foo\", \"lorem\"],\n \"When passing an object, should return an array of strings with the key values\"\n )\n\n t.deepEquals(\n keys(\"lorem\"),\n [],\n \"When passing a string, should return an empty array\"\n )\n\n t.deepEquals(\n keys(12),\n [],\n \"when passing a number, should return an empty array\"\n )\n\n t.end()\n})\n"],"names":["test","keys","t","deepEquals","foo","lorem","end"],"mappings":"AAAA,MAAM,CAACA,IAAI,MAAM,CAAM;AAEvB,MAAM,GAAGC,IAAI,QAAQ,CAAW;AAEhCD,IAAI,CAAC,CAAM,OAAEE,QACZ,CADYA,CAAC,EAAI,CAAC;IACjBA,CAAC,CAACC,UAAU,CACVF,IAAI,CAAC,CAAC;QAAA,CAAM;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,GACnB,CAAC;QAAA,CAAG;QAAE,CAAG;QAAE,CAAG;IAAA,CAAC,EACf,CAAwF;IAG1FC,CAAC,CAACC,UAAU,CACVF,IAAI,CAAC,CAAC;QAACG,GAAG,EAAE,CAAK;QAAEC,KAAK,EAAE,CAAO;IAAC,CAAC,GACnC,CAAC;QAAA,CAAK;QAAE,CAAO;IAAA,CAAC,EAChB,CAA+E;IAGjFH,CAAC,CAACC,UAAU,CACVF,IAAI,CAAC,CAAO,SACZ,CAAC,CAAC,EACF,CAAqD;IAGvDC,CAAC,CAACC,UAAU,CACVF,IAAI,CAAC,EAAE,GACP,CAAC,CAAC,EACF,CAAqD;IAGvDC,CAAC,CAACI,GAAG;AACP,CAAC"}
package/dist/last/last.js CHANGED
@@ -14,10 +14,9 @@
14
14
  * // => 3
15
15
  * last([])
16
16
  * // => undefined
17
- */
18
- var last = function last(input) {
19
- return (Array.isArray(input) || typeof input === "string") && input.length !== 0 ? input[input.length - 1] : undefined;
17
+ */ var last = function(input) {
18
+ return (Array.isArray(input) || typeof input === "string") && input.length !== 0 ? input[input.length - 1] : undefined;
20
19
  };
21
-
22
20
  export { last };
21
+
23
22
  //# sourceMappingURL=last.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/last/last.js"],"names":["last","input","Array","isArray","length","undefined"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,IAAI,GAAG,SAAPA,IAAO,CAAAC,KAAK;AAAA,SAChB,CAACC,KAAK,CAACC,OAAN,CAAcF,KAAd,KAAwB,OAAOA,KAAP,KAAiB,QAA1C,KAAuDA,KAAK,CAACG,MAAN,KAAiB,CAAxE,GACIH,KAAK,CAACA,KAAK,CAACG,MAAN,GAAe,CAAhB,CADT,GAEIC,SAHY;AAAA,CAAlB;;AAKA,SAASL,IAAT","sourcesContent":["/**\n * Get right most element of array\n *\n * @param {Array} input The source\n *\n * @returns {any}\n *\n * @name last\n * @tag Array\n * @signature (input: Array): mixed\n *\n * @example\n * last([1, 2, 3])\n * // => 3\n * last([])\n * // => undefined\n */\nconst last = input =>\n (Array.isArray(input) || typeof input === \"string\") && input.length !== 0\n ? input[input.length - 1]\n : undefined\n\nexport { last }\n"],"file":"last.js"}
1
+ {"version":3,"sources":["../../src/last/last.js"],"sourcesContent":["/**\n * Get right most element of array\n *\n * @param {Array} input The source\n *\n * @returns {any}\n *\n * @name last\n * @tag Array\n * @signature (input: Array): mixed\n *\n * @example\n * last([1, 2, 3])\n * // => 3\n * last([])\n * // => undefined\n */\nconst last = input =>\n (Array.isArray(input) || typeof input === \"string\") && input.length !== 0\n ? input[input.length - 1]\n : undefined\n\nexport { last }\n"],"names":["last","input","Array","isArray","length","undefined"],"mappings":"AAAA,EAgBG,AAhBH;;;;;;;;;;;;;;;;CAgBG,AAhBH,EAgBG,CACH,GAAK,CAACA,IAAI,GAAGC,QAAQ,CAARA,KAAK;IAChB,MAAM,EAALC,KAAK,CAACC,OAAO,CAACF,KAAK,KAAK,MAAM,CAACA,KAAK,KAAK,CAAQ,YAAKA,KAAK,CAACG,MAAM,KAAK,CAAC,GACrEH,KAAK,CAACA,KAAK,CAACG,MAAM,GAAG,CAAC,IACtBC,SAAS;;AAEf,MAAM,GAAGL,IAAI"}
@@ -1,11 +1,18 @@
1
1
  import test from "tape";
2
2
  import { last } from "./last.js";
3
- test("last", function (t) {
4
- t.equals(last([1, 2, 3]), 3, "Get last element from n array");
5
- t.equals(last([1]), 1, "Get last element of an 1 array");
6
- t.equals(last("xyz"), "z", "From string should return last char");
7
- t.equals(last([]), undefined, "Get last element of empty array");
8
- t.equals(last({}), undefined, "Get last element of empty object");
9
- t.end();
3
+ test("last", function(t) {
4
+ t.equals(last([
5
+ 1,
6
+ 2,
7
+ 3
8
+ ]), 3, "Get last element from n array");
9
+ t.equals(last([
10
+ 1
11
+ ]), 1, "Get last element of an 1 array");
12
+ t.equals(last("xyz"), "z", "From string should return last char");
13
+ t.equals(last([]), undefined, "Get last element of empty array");
14
+ t.equals(last({}), undefined, "Get last element of empty object");
15
+ t.end();
10
16
  });
17
+
11
18
  //# sourceMappingURL=last.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/last/last.test.js"],"names":["test","last","t","equals","undefined","end"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,MAAjB;AAEA,SAASC,IAAT,QAAqB,WAArB;AAEAD,IAAI,CAAC,MAAD,EAAS,UAAAE,CAAC,EAAI;AAChBA,EAAAA,CAAC,CAACC,MAAF,CAASF,IAAI,CAAC,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAAD,CAAb,EAA0B,CAA1B,EAA6B,+BAA7B;AAEAC,EAAAA,CAAC,CAACC,MAAF,CAASF,IAAI,CAAC,CAAC,CAAD,CAAD,CAAb,EAAoB,CAApB,EAAuB,gCAAvB;AAEAC,EAAAA,CAAC,CAACC,MAAF,CAASF,IAAI,CAAC,KAAD,CAAb,EAAsB,GAAtB,EAA2B,qCAA3B;AAEAC,EAAAA,CAAC,CAACC,MAAF,CAASF,IAAI,CAAC,EAAD,CAAb,EAAmBG,SAAnB,EAA8B,iCAA9B;AAEAF,EAAAA,CAAC,CAACC,MAAF,CAASF,IAAI,CAAC,EAAD,CAAb,EAAmBG,SAAnB,EAA8B,kCAA9B;AAEAF,EAAAA,CAAC,CAACG,GAAF;AACD,CAZG,CAAJ","sourcesContent":["import test from \"tape\"\n\nimport { last } from \"./last.js\"\n\ntest(\"last\", t => {\n t.equals(last([1, 2, 3]), 3, \"Get last element from n array\")\n\n t.equals(last([1]), 1, \"Get last element of an 1 array\")\n\n t.equals(last(\"xyz\"), \"z\", \"From string should return last char\")\n\n t.equals(last([]), undefined, \"Get last element of empty array\")\n\n t.equals(last({}), undefined, \"Get last element of empty object\")\n\n t.end()\n})\n"],"file":"last.test.js"}
1
+ {"version":3,"sources":["../../src/last/last.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { last } from \"./last.js\"\n\ntest(\"last\", t => {\n t.equals(last([1, 2, 3]), 3, \"Get last element from n array\")\n\n t.equals(last([1]), 1, \"Get last element of an 1 array\")\n\n t.equals(last(\"xyz\"), \"z\", \"From string should return last char\")\n\n t.equals(last([]), undefined, \"Get last element of empty array\")\n\n t.equals(last({}), undefined, \"Get last element of empty object\")\n\n t.end()\n})\n"],"names":["test","last","t","equals","undefined","end"],"mappings":"AAAA,MAAM,CAACA,IAAI,MAAM,CAAM;AAEvB,MAAM,GAAGC,IAAI,QAAQ,CAAW;AAEhCD,IAAI,CAAC,CAAM,OAAEE,QACZ,CADYA,CAAC,EAAI,CAAC;IACjBA,CAAC,CAACC,MAAM,CAACF,IAAI,CAAC,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,GAAG,CAAC,EAAE,CAA+B;IAE5DC,CAAC,CAACC,MAAM,CAACF,IAAI,CAAC,CAAC;AAAA,SAAC;IAAA,CAAC,GAAG,CAAC,EAAE,CAAgC;IAEvDC,CAAC,CAACC,MAAM,CAACF,IAAI,CAAC,CAAK,OAAG,CAAG,IAAE,CAAqC;IAEhEC,CAAC,CAACC,MAAM,CAACF,IAAI,CAAC,CAAC,CAAC,GAAGG,SAAS,EAAE,CAAiC;IAE/DF,CAAC,CAACC,MAAM,CAACF,IAAI,CAAC,CAAC,CAAC,GAAGG,SAAS,EAAE,CAAkC;IAEhEF,CAAC,CAACG,GAAG;AACP,CAAC"}
package/dist/lt/lt.js CHANGED
@@ -20,9 +20,8 @@ import { curry } from "../curry/curry.js";
20
20
  *
21
21
  * lt(10)(14)
22
22
  * // => false
23
- */
24
-
25
- export var lt = curry(function (second, first) {
26
- return first < second;
23
+ */ export var lt = curry(function(second, first) {
24
+ return first < second;
27
25
  });
26
+
28
27
  //# sourceMappingURL=lt.js.map
package/dist/lt/lt.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lt/lt.js"],"names":["curry","lt","second","first"],"mappings":"AAAA,SAASA,KAAT,QAAsB,mBAAtB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,EAAE,GAAGD,KAAK,CAAC,UAACE,MAAD,EAASC,KAAT;AAAA,SAAmBA,KAAK,GAAGD,MAA3B;AAAA,CAAD,CAAhB","sourcesContent":["import { curry } from \"../curry/curry.js\"\n\n/**\n * Less compare.\n *\n * Since this will mostly be used in pipe, the first param in the curry chain\n * is the second operand.\n *\n * @param {number} second Second number\n * @param {number} first First number\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature (first: number) => (second: number): boolean\n * @signature (first: number, second: number): boolean\n *\n * @example\n * lt(10)(4)\n * // => true\n *\n * lt(10)(14)\n * // => false\n */\nexport const lt = curry((second, first) => first < second)\n"],"file":"lt.js"}
1
+ {"version":3,"sources":["../../src/lt/lt.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\n\n/**\n * Less compare.\n *\n * Since this will mostly be used in pipe, the first param in the curry chain\n * is the second operand.\n *\n * @param {number} second Second number\n * @param {number} first First number\n *\n * @returns {boolean}\n *\n * @tag Core\n * @signature (first: number) => (second: number): boolean\n * @signature (first: number, second: number): boolean\n *\n * @example\n * lt(10)(4)\n * // => true\n *\n * lt(10)(14)\n * // => false\n */\nexport const lt = curry((second, first) => first < second)\n"],"names":["curry","lt","second","first"],"mappings":"AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAmB;AAEzC,EAqBG,AArBH;;;;;;;;;;;;;;;;;;;;;CAqBG,AArBH,EAqBG,CACH,MAAM,CAAC,GAAK,CAACC,EAAE,GAAGD,KAAK,CAAC,QAAQ,CAAPE,MAAM,EAAEC,KAAK;IAAKA,MAAM,CAANA,KAAK,GAAGD,MAAM"}
@@ -1,9 +1,10 @@
1
1
  import test from "tape";
2
2
  import { lt } from "./lt.js";
3
- test("lt", function (t) {
4
- t.equals(lt(10)(14), false, "14 is not less than 10");
5
- t.equals(lt(10)(10), false, "10 is not less than 10");
6
- t.equals(lt(10)(4), true, "4 is less than 10");
7
- t.end();
3
+ test("lt", function(t) {
4
+ t.equals(lt(10)(14), false, "14 is not less than 10");
5
+ t.equals(lt(10)(10), false, "10 is not less than 10");
6
+ t.equals(lt(10)(4), true, "4 is less than 10");
7
+ t.end();
8
8
  });
9
+
9
10
  //# sourceMappingURL=lt.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lt/lt.test.js"],"names":["test","lt","t","equals","end"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,MAAjB;AAEA,SAASC,EAAT,QAAmB,SAAnB;AAEAD,IAAI,CAAC,IAAD,EAAO,UAAAE,CAAC,EAAI;AACdA,EAAAA,CAAC,CAACC,MAAF,CAASF,EAAE,CAAC,EAAD,CAAF,CAAO,EAAP,CAAT,EAAqB,KAArB,EAA4B,wBAA5B;AAEAC,EAAAA,CAAC,CAACC,MAAF,CAASF,EAAE,CAAC,EAAD,CAAF,CAAO,EAAP,CAAT,EAAqB,KAArB,EAA4B,wBAA5B;AAEAC,EAAAA,CAAC,CAACC,MAAF,CAASF,EAAE,CAAC,EAAD,CAAF,CAAO,CAAP,CAAT,EAAoB,IAApB,EAA0B,mBAA1B;AAEAC,EAAAA,CAAC,CAACE,GAAF;AACD,CARG,CAAJ","sourcesContent":["import test from \"tape\"\n\nimport { lt } from \"./lt.js\"\n\ntest(\"lt\", t => {\n t.equals(lt(10)(14), false, \"14 is not less than 10\")\n\n t.equals(lt(10)(10), false, \"10 is not less than 10\")\n\n t.equals(lt(10)(4), true, \"4 is less than 10\")\n\n t.end()\n})\n"],"file":"lt.test.js"}
1
+ {"version":3,"sources":["../../src/lt/lt.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { lt } from \"./lt.js\"\n\ntest(\"lt\", t => {\n t.equals(lt(10)(14), false, \"14 is not less than 10\")\n\n t.equals(lt(10)(10), false, \"10 is not less than 10\")\n\n t.equals(lt(10)(4), true, \"4 is less than 10\")\n\n t.end()\n})\n"],"names":["test","lt","t","equals","end"],"mappings":"AAAA,MAAM,CAACA,IAAI,MAAM,CAAM;AAEvB,MAAM,GAAGC,EAAE,QAAQ,CAAS;AAE5BD,IAAI,CAAC,CAAI,KAAEE,QACV,CADUA,CAAC,EAAI,CAAC;IACfA,CAAC,CAACC,MAAM,CAACF,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAwB;IAEpDC,CAAC,CAACC,MAAM,CAACF,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAwB;IAEpDC,CAAC,CAACC,MAAM,CAACF,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAmB;IAE7CC,CAAC,CAACE,GAAG;AACP,CAAC"}
package/dist/map/map.js CHANGED
@@ -1,17 +1,16 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
1
+ import * as swcHelpers from "@swc/helpers";
2
2
  import { pipe } from "../pipe/pipe.js";
3
3
  import { curry } from "../curry/curry.js";
4
-
5
- var _map = function _map(_fn, _input) {
6
- var result = [];
7
- var input = Array.isArray(_input) ? _input : [_input];
8
- var fn = Array.isArray(_fn) ? pipe.apply(void 0, _toConsumableArray(_fn)) : _fn;
9
-
10
- for (var i = 0, valuesCount = input.length; i < valuesCount; ++i) {
11
- result.push(fn(input[i], i, input));
12
- }
13
-
14
- return result;
4
+ var _map = function(_fn, _input) {
5
+ var result = [];
6
+ var input = Array.isArray(_input) ? _input : [
7
+ _input
8
+ ];
9
+ var fn = Array.isArray(_fn) ? pipe.apply(void 0, swcHelpers.toConsumableArray(_fn)) : _fn;
10
+ for(var i = 0, valuesCount = input.length; i < valuesCount; ++i){
11
+ result.push(fn(input[i], i, input));
12
+ }
13
+ return result;
15
14
  };
16
15
  /**
17
16
  * Iterates over an array and applies a function on each element, returning a
@@ -36,8 +35,6 @@ var _map = function _map(_fn, _input) {
36
35
  *
37
36
  * map([inc, inc], [1, 2])
38
37
  * // => [3, 4]
39
- */
40
-
38
+ */ export var map = curry(_map);
41
39
 
42
- export var map = curry(_map);
43
40
  //# sourceMappingURL=map.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/map/map.js"],"names":["pipe","curry","_map","_fn","_input","result","input","Array","isArray","fn","i","valuesCount","length","push","map"],"mappings":";AAAA,SAASA,IAAT,QAAqB,iBAArB;AACA,SAASC,KAAT,QAAsB,mBAAtB;;AAEA,IAAMC,IAAI,GAAG,SAAPA,IAAO,CAACC,GAAD,EAAMC,MAAN,EAAiB;AAC5B,MAAMC,MAAM,GAAG,EAAf;AACA,MAAMC,KAAK,GAAGC,KAAK,CAACC,OAAN,CAAcJ,MAAd,IAAwBA,MAAxB,GAAiC,CAACA,MAAD,CAA/C;AACA,MAAMK,EAAE,GAAGF,KAAK,CAACC,OAAN,CAAcL,GAAd,IAAqBH,IAAI,MAAJ,4BAAQG,GAAR,EAArB,GAAoCA,GAA/C;;AAEA,OAAK,IAAIO,CAAC,GAAG,CAAR,EAAWC,WAAW,GAAGL,KAAK,CAACM,MAApC,EAA4CF,CAAC,GAAGC,WAAhD,EAA6D,EAAED,CAA/D,EAAkE;AAChEL,IAAAA,MAAM,CAACQ,IAAP,CAAYJ,EAAE,CAACH,KAAK,CAACI,CAAD,CAAN,EAAWA,CAAX,EAAcJ,KAAd,CAAd;AACD;;AAED,SAAOD,MAAP;AACD,CAVD;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,IAAMS,GAAG,GAAGb,KAAK,CAACC,IAAD,CAAjB","sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _map = (_fn, _input) => {\n const result = []\n const input = Array.isArray(_input) ? _input : [_input]\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (let i = 0, valuesCount = input.length; i < valuesCount; ++i) {\n result.push(fn(input[i], i, input))\n }\n\n return result\n}\n\n/**\n * Iterates over an array and applies a function on each element, returning a\n * new array with the transformed elements.\n *\n * @param {Function|Function[]} fn Transform function called on each element\n * @param {Array} input Source array to iterate over\n *\n * @returns {Array} Returns new instance\n *\n * @name map\n * @tag Array\n * @signature (fn: Fn|Fn[], input: Array) => Array\n *\n * @see {@link mapMatrix}\n *\n * @example\n * const inc = x => x + 1\n *\n * map(inc, [1, 2])\n * // => [2, 3]\n *\n * map([inc, inc], [1, 2])\n * // => [3, 4]\n */\nexport const map = curry(_map)\n"],"file":"map.js"}
1
+ {"version":3,"sources":["../../src/map/map.js"],"sourcesContent":["import { pipe } from \"../pipe/pipe.js\"\nimport { curry } from \"../curry/curry.js\"\n\nconst _map = (_fn, _input) => {\n const result = []\n const input = Array.isArray(_input) ? _input : [_input]\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (let i = 0, valuesCount = input.length; i < valuesCount; ++i) {\n result.push(fn(input[i], i, input))\n }\n\n return result\n}\n\n/**\n * Iterates over an array and applies a function on each element, returning a\n * new array with the transformed elements.\n *\n * @param {Function|Function[]} fn Transform function called on each element\n * @param {Array} input Source array to iterate over\n *\n * @returns {Array} Returns new instance\n *\n * @name map\n * @tag Array\n * @signature (fn: Fn|Fn[], input: Array) => Array\n *\n * @see {@link mapMatrix}\n *\n * @example\n * const inc = x => x + 1\n *\n * map(inc, [1, 2])\n * // => [2, 3]\n *\n * map([inc, inc], [1, 2])\n * // => [3, 4]\n */\nexport const map = curry(_map)\n"],"names":["pipe","curry","_map","_fn","_input","result","input","Array","isArray","fn","i","valuesCount","length","push","map"],"mappings":";AAAA,MAAM,GAAGA,IAAI,QAAQ,CAAiB;AACtC,MAAM,GAAGC,KAAK,QAAQ,CAAmB;AAEzC,GAAK,CAACC,IAAI,GAAG,QAAQ,CAAPC,GAAG,EAAEC,MAAM,EAAK,CAAC;IAC7B,GAAK,CAACC,MAAM,GAAG,CAAC,CAAC;IACjB,GAAK,CAACC,KAAK,GAAGC,KAAK,CAACC,OAAO,CAACJ,MAAM,IAAIA,MAAM,GAAG,CAACA;QAAAA,MAAM;IAAA,CAAC;IACvD,GAAK,CAACK,EAAE,GAAGF,KAAK,CAACC,OAAO,CAACL,GAAG,IAAIH,IAAI,CAAJA,KAAY,CAAZA,IAAI,CAAJA,CAAI,+BAAIG,GAAG,KAAIA,GAAG;IAElD,GAAG,CAAE,GAAG,CAACO,CAAC,GAAG,CAAC,EAAEC,WAAW,GAAGL,KAAK,CAACM,MAAM,EAAEF,CAAC,GAAGC,WAAW,IAAID,CAAC,CAAE,CAAC;QACjEL,MAAM,CAACQ,IAAI,CAACJ,EAAE,CAACH,KAAK,CAACI,CAAC,GAAGA,CAAC,EAAEJ,KAAK;IACnC,CAAC;IAED,MAAM,CAACD,MAAM;AACf,CAAC;AAED,EAuBG,AAvBH;;;;;;;;;;;;;;;;;;;;;;;CAuBG,AAvBH,EAuBG,CACH,MAAM,CAAC,GAAK,CAACS,GAAG,GAAGb,KAAK,CAACC,IAAI"}
@@ -1,26 +1,66 @@
1
1
  import test from "tape";
2
2
  import { map } from "./map.js";
3
-
4
- var square = function square(value) {
5
- return value * value;
3
+ var square = function(value) {
4
+ return value * value;
6
5
  };
7
-
8
- test("map", function (t) {
9
- t.deepEqual(map(square, [1, 2, 3]), [1, 4, 9], "(square, [1,2,3]) // => [1,4,9]");
10
- t.deepEqual(map(square)([1, 2, 3]), [1, 4, 9], "(square)([1,2,3]) // => [1,4,9]");
11
- t.deepEqual(map(square)(3), [9], "Run map for non-array input, treat as array of one");
12
- t.deepEqual(map([square, square], [1, 2, 3]), [1, 16, 81], "([square, square], [1,2,3]) // => [1,16,82]");
13
- t.deepEqual(map(square)([]), [], "iteration over [] should equal []");
14
- map(function (currentValue, index, array) {
15
- t.equal(currentValue, array[index], "callback element \"".concat(currentValue, "\" should equal [").concat(array, "][").concat(index, "]"));
16
- return currentValue * currentValue;
17
- })([1, 2]);
18
- map([function (currentValue, index, array) {
19
- t.equal(currentValue, array[index], "callback element \"".concat(currentValue, "\" should equal [").concat(array, "][").concat(index, "]"));
20
- return currentValue * currentValue;
21
- }], [1, 2]);
22
- var imutableTestArray = [1, 2, 3];
23
- t.notEqual(map(square)(imutableTestArray), imutableTestArray, "Imutable");
24
- t.end();
6
+ test("map", function(t) {
7
+ t.deepEqual(map(square, [
8
+ 1,
9
+ 2,
10
+ 3
11
+ ]), [
12
+ 1,
13
+ 4,
14
+ 9
15
+ ], "(square, [1,2,3]) // => [1,4,9]");
16
+ t.deepEqual(map(square)([
17
+ 1,
18
+ 2,
19
+ 3
20
+ ]), [
21
+ 1,
22
+ 4,
23
+ 9
24
+ ], "(square)([1,2,3]) // => [1,4,9]");
25
+ t.deepEqual(map(square)(3), [
26
+ 9
27
+ ], "Run map for non-array input, treat as array of one");
28
+ t.deepEqual(map([
29
+ square,
30
+ square
31
+ ], [
32
+ 1,
33
+ 2,
34
+ 3
35
+ ]), [
36
+ 1,
37
+ 16,
38
+ 81
39
+ ], "([square, square], [1,2,3]) // => [1,16,82]");
40
+ t.deepEqual(map(square)([]), [], "iteration over [] should equal []");
41
+ map(function(currentValue, index, array) {
42
+ t.equal(currentValue, array[index], "callback element \"".concat(currentValue, "\" should equal [").concat(array, "][").concat(index, "]"));
43
+ return currentValue * currentValue;
44
+ })([
45
+ 1,
46
+ 2
47
+ ]);
48
+ map([
49
+ function(currentValue, index, array) {
50
+ t.equal(currentValue, array[index], "callback element \"".concat(currentValue, "\" should equal [").concat(array, "][").concat(index, "]"));
51
+ return currentValue * currentValue;
52
+ },
53
+ ], [
54
+ 1,
55
+ 2
56
+ ]);
57
+ var imutableTestArray = [
58
+ 1,
59
+ 2,
60
+ 3
61
+ ];
62
+ t.notEqual(map(square)(imutableTestArray), imutableTestArray, "Imutable");
63
+ t.end();
25
64
  });
65
+
26
66
  //# sourceMappingURL=map.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/map/map.test.js"],"names":["test","map","square","value","t","deepEqual","currentValue","index","array","equal","imutableTestArray","notEqual","end"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,MAAjB;AAEA,SAASC,GAAT,QAAoB,UAApB;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAIA,KAAK,GAAGA,KAAZ;AAAA,CAApB;;AAEAH,IAAI,CAAC,KAAD,EAAQ,UAAAI,CAAC,EAAI;AACfA,EAAAA,CAAC,CAACC,SAAF,CACEJ,GAAG,CAACC,MAAD,EAAS,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAAT,CADL,EAEE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAFF,EAGE,iCAHF;AAMAE,EAAAA,CAAC,CAACC,SAAF,CACEJ,GAAG,CAACC,MAAD,CAAH,CAAY,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAAZ,CADF,EAEE,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAFF,EAGE,iCAHF;AAMAE,EAAAA,CAAC,CAACC,SAAF,CACEJ,GAAG,CAACC,MAAD,CAAH,CAAY,CAAZ,CADF,EAEE,CAAC,CAAD,CAFF,EAGE,oDAHF;AAMAE,EAAAA,CAAC,CAACC,SAAF,CACEJ,GAAG,CAAC,CAACC,MAAD,EAASA,MAAT,CAAD,EAAmB,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAAnB,CADL,EAEE,CAAC,CAAD,EAAI,EAAJ,EAAQ,EAAR,CAFF,EAGE,6CAHF;AAMAE,EAAAA,CAAC,CAACC,SAAF,CAAYJ,GAAG,CAACC,MAAD,CAAH,CAAY,EAAZ,CAAZ,EAA6B,EAA7B,EAAiC,mCAAjC;AAEAD,EAAAA,GAAG,CAAC,UAACK,YAAD,EAAeC,KAAf,EAAsBC,KAAtB,EAAgC;AAClCJ,IAAAA,CAAC,CAACK,KAAF,CACEH,YADF,EAEEE,KAAK,CAACD,KAAD,CAFP,+BAGuBD,YAHvB,8BAGsDE,KAHtD,eAGgED,KAHhE;AAMA,WAAOD,YAAY,GAAGA,YAAtB;AACD,GARE,CAAH,CAQG,CAAC,CAAD,EAAI,CAAJ,CARH;AAUAL,EAAAA,GAAG,CACD,CACE,UAACK,YAAD,EAAeC,KAAf,EAAsBC,KAAtB,EAAgC;AAC9BJ,IAAAA,CAAC,CAACK,KAAF,CACEH,YADF,EAEEE,KAAK,CAACD,KAAD,CAFP,+BAGuBD,YAHvB,8BAGsDE,KAHtD,eAGgED,KAHhE;AAMA,WAAOD,YAAY,GAAGA,YAAtB;AACD,GATH,CADC,EAYD,CAAC,CAAD,EAAI,CAAJ,CAZC,CAAH;AAeA,MAAMI,iBAAiB,GAAG,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAA1B;AAEAN,EAAAA,CAAC,CAACO,QAAF,CAAWV,GAAG,CAACC,MAAD,CAAH,CAAYQ,iBAAZ,CAAX,EAA2CA,iBAA3C,EAA8D,UAA9D;AAEAN,EAAAA,CAAC,CAACQ,GAAF;AACD,CAzDG,CAAJ","sourcesContent":["import test from \"tape\"\n\nimport { map } from \"./map.js\"\n\nconst square = value => value * value\n\ntest(\"map\", t => {\n t.deepEqual(\n map(square, [1, 2, 3]),\n [1, 4, 9],\n \"(square, [1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)([1, 2, 3]),\n [1, 4, 9],\n \"(square)([1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)(3),\n [9],\n \"Run map for non-array input, treat as array of one\"\n )\n\n t.deepEqual(\n map([square, square], [1, 2, 3]),\n [1, 16, 81],\n \"([square, square], [1,2,3]) // => [1,16,82]\"\n )\n\n t.deepEqual(map(square)([]), [], \"iteration over [] should equal []\")\n\n map((currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n })([1, 2])\n\n map(\n [\n (currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n },\n ],\n [1, 2]\n )\n\n const imutableTestArray = [1, 2, 3]\n\n t.notEqual(map(square)(imutableTestArray), imutableTestArray, \"Imutable\")\n\n t.end()\n})\n"],"file":"map.test.js"}
1
+ {"version":3,"sources":["../../src/map/map.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { map } from \"./map.js\"\n\nconst square = value => value * value\n\ntest(\"map\", t => {\n t.deepEqual(\n map(square, [1, 2, 3]),\n [1, 4, 9],\n \"(square, [1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)([1, 2, 3]),\n [1, 4, 9],\n \"(square)([1,2,3]) // => [1,4,9]\"\n )\n\n t.deepEqual(\n map(square)(3),\n [9],\n \"Run map for non-array input, treat as array of one\"\n )\n\n t.deepEqual(\n map([square, square], [1, 2, 3]),\n [1, 16, 81],\n \"([square, square], [1,2,3]) // => [1,16,82]\"\n )\n\n t.deepEqual(map(square)([]), [], \"iteration over [] should equal []\")\n\n map((currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n })([1, 2])\n\n map(\n [\n (currentValue, index, array) => {\n t.equal(\n currentValue,\n array[index],\n `callback element \"${currentValue}\" should equal [${array}][${index}]`\n )\n\n return currentValue * currentValue\n },\n ],\n [1, 2]\n )\n\n const imutableTestArray = [1, 2, 3]\n\n t.notEqual(map(square)(imutableTestArray), imutableTestArray, \"Imutable\")\n\n t.end()\n})\n"],"names":["test","map","square","value","t","deepEqual","currentValue","index","array","equal","imutableTestArray","notEqual","end"],"mappings":"AAAA,MAAM,CAACA,IAAI,MAAM,CAAM;AAEvB,MAAM,GAAGC,GAAG,QAAQ,CAAU;AAE9B,GAAK,CAACC,MAAM,GAAGC,QAAQ,CAARA,KAAK;IAAIA,MAAM,CAANA,KAAK,GAAGA,KAAK;;AAErCH,IAAI,CAAC,CAAK,MAAEI,QACX,CADWA,CAAC,EAAI,CAAC;IAChBA,CAAC,CAACC,SAAS,CACTJ,GAAG,CAACC,MAAM,EAAE,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,GACrB,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,EACT,CAAiC;IAGnCE,CAAC,CAACC,SAAS,CACTJ,GAAG,CAACC,MAAM,EAAE,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,GACrB,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,EACT,CAAiC;IAGnCE,CAAC,CAACC,SAAS,CACTJ,GAAG,CAACC,MAAM,EAAE,CAAC,GACb,CAAC;AAAA,SAAC;IAAA,CAAC,EACH,CAAoD;IAGtDE,CAAC,CAACC,SAAS,CACTJ,GAAG,CAAC,CAACC;QAAAA,MAAM;QAAEA,MAAM;IAAA,CAAC,EAAE,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC,GAC/B,CAAC;AAAA,SAAC;AAAE,UAAE;AAAE,UAAE;IAAA,CAAC,EACX,CAA6C;IAG/CE,CAAC,CAACC,SAAS,CAACJ,GAAG,CAACC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAmC;IAEpED,GAAG,CAAC,QAAQ,CAAPK,YAAY,EAAEC,KAAK,EAAEC,KAAK,EAAK,CAAC;QACnCJ,CAAC,CAACK,KAAK,CACLH,YAAY,EACZE,KAAK,CAACD,KAAK,GACV,CAAkB,qBAAiCC,MAAK,CAApCF,YAAY,EAAC,CAAgB,oBAAYC,MAAK,CAAfC,KAAK,EAAC,CAAE,KAAQ,MAAC,CAAPD,KAAK,EAAC,CAAC;QAGvE,MAAM,CAACD,YAAY,GAAGA,YAAY;IACpC,CAAC,EAAE,CAAC;AAAA,SAAC;AAAE,SAAC;IAAA,CAAC;IAETL,GAAG,CACD,CAAC;QACC,QAAQ,CAAPK,YAAY,EAAEC,KAAK,EAAEC,KAAK,EAAK,CAAC;YAC/BJ,CAAC,CAACK,KAAK,CACLH,YAAY,EACZE,KAAK,CAACD,KAAK,GACV,CAAkB,qBAAiCC,MAAK,CAApCF,YAAY,EAAC,CAAgB,oBAAYC,MAAK,CAAfC,KAAK,EAAC,CAAE,KAAQ,MAAC,CAAPD,KAAK,EAAC,CAAC;YAGvE,MAAM,CAACD,YAAY,GAAGA,YAAY;QACpC,CAAC;IACH,CAAC,EACD,CAAC;AAAA,SAAC;AAAE,SAAC;IAAA,CAAC;IAGR,GAAK,CAACI,iBAAiB,GAAG,CAAC;AAAA,SAAC;AAAE,SAAC;AAAE,SAAC;IAAA,CAAC;IAEnCN,CAAC,CAACO,QAAQ,CAACV,GAAG,CAACC,MAAM,EAAEQ,iBAAiB,GAAGA,iBAAiB,EAAE,CAAU;IAExEN,CAAC,CAACQ,GAAG;AACP,CAAC"}
@@ -1,22 +1,17 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
1
+ import * as swcHelpers from "@swc/helpers";
2
2
  import { curry } from "../curry/curry.js";
3
3
  import { pipe } from "../pipe/pipe.js";
4
-
5
- var _mapMatrix = function _mapMatrix(_fn, input) {
6
- var result = [];
7
- var fn = Array.isArray(_fn) ? pipe.apply(void 0, _toConsumableArray(_fn)) : _fn;
8
-
9
- for (var rowIndex = 0, rowCount = input.length; rowIndex < rowCount; ++rowIndex) {
10
- var row = [];
11
-
12
- for (var columnIndex = 0, columnCount = input[rowIndex].length; columnIndex < columnCount; ++columnIndex) {
13
- row.push(fn(input[rowIndex][columnIndex], rowIndex, columnIndex, input));
4
+ var _mapMatrix = function(_fn, input) {
5
+ var result = [];
6
+ var fn = Array.isArray(_fn) ? pipe.apply(void 0, swcHelpers.toConsumableArray(_fn)) : _fn;
7
+ for(var rowIndex = 0, rowCount = input.length; rowIndex < rowCount; ++rowIndex){
8
+ var row = [];
9
+ for(var columnIndex = 0, columnCount = input[rowIndex].length; columnIndex < columnCount; ++columnIndex){
10
+ row.push(fn(input[rowIndex][columnIndex], rowIndex, columnIndex, input));
11
+ }
12
+ result.push(row);
14
13
  }
15
-
16
- result.push(row);
17
- }
18
-
19
- return result;
14
+ return result;
20
15
  };
21
16
  /**
22
17
  * Matrix version of "map". Iterates over a two-dimensional array and applies
@@ -43,8 +38,6 @@ var _mapMatrix = function _mapMatrix(_fn, input) {
43
38
  *
44
39
  * mapMatrix([inc, inc], [[1, 2], [3, 4]])
45
40
  * // => [[3, 4], [5, 6]]
46
- */
47
-
41
+ */ export var mapMatrix = curry(_mapMatrix);
48
42
 
49
- export var mapMatrix = curry(_mapMatrix);
50
43
  //# sourceMappingURL=map-matrix.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/map-matrix/map-matrix.js"],"names":["curry","pipe","_mapMatrix","_fn","input","result","fn","Array","isArray","rowIndex","rowCount","length","row","columnIndex","columnCount","push","mapMatrix"],"mappings":";AAAA,SAASA,KAAT,QAAsB,mBAAtB;AACA,SAASC,IAAT,QAAqB,iBAArB;;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,GAAD,EAAMC,KAAN,EAAgB;AACjC,MAAMC,MAAM,GAAG,EAAf;AACA,MAAMC,EAAE,GAAGC,KAAK,CAACC,OAAN,CAAcL,GAAd,IAAqBF,IAAI,MAAJ,4BAAQE,GAAR,EAArB,GAAoCA,GAA/C;;AAEA,OACE,IAAIM,QAAQ,GAAG,CAAf,EAAkBC,QAAQ,GAAGN,KAAK,CAACO,MADrC,EAEEF,QAAQ,GAAGC,QAFb,EAGE,EAAED,QAHJ,EAIE;AACA,QAAMG,GAAG,GAAG,EAAZ;;AAEA,SACE,IAAIC,WAAW,GAAG,CAAlB,EAAqBC,WAAW,GAAGV,KAAK,CAACK,QAAD,CAAL,CAAgBE,MADrD,EAEEE,WAAW,GAAGC,WAFhB,EAGE,EAAED,WAHJ,EAIE;AACAD,MAAAA,GAAG,CAACG,IAAJ,CAAST,EAAE,CAACF,KAAK,CAACK,QAAD,CAAL,CAAgBI,WAAhB,CAAD,EAA+BJ,QAA/B,EAAyCI,WAAzC,EAAsDT,KAAtD,CAAX;AACD;;AAEDC,IAAAA,MAAM,CAACU,IAAP,CAAYH,GAAZ;AACD;;AAED,SAAOP,MAAP;AACD,CAvBD;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,IAAMW,SAAS,GAAGhB,KAAK,CAACE,UAAD,CAAvB","sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { pipe } from \"../pipe/pipe.js\"\n\nconst _mapMatrix = (_fn, input) => {\n const result = []\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (\n let rowIndex = 0, rowCount = input.length;\n rowIndex < rowCount;\n ++rowIndex\n ) {\n const row = []\n\n for (\n let columnIndex = 0, columnCount = input[rowIndex].length;\n columnIndex < columnCount;\n ++columnIndex\n ) {\n row.push(fn(input[rowIndex][columnIndex], rowIndex, columnIndex, input))\n }\n\n result.push(row)\n }\n\n return result\n}\n\n/**\n * Matrix version of \"map\". Iterates over a two-dimensional array and applies\n * a function on each element, returning a new matrix with the transformed\n * elements.\n *\n * @param {Function|Function[]} fn Transform function called on all elements\n * @param {any[][]} input Two-dimensional array to iterate over\n *\n * @returns {any[][]} New array instance\n *\n * @name mapMatrix\n * @tag Array\n * @signature (fn: Fn|Fn[]) => (input: [][]) => [][]\n * @signature (fn: Fn|Fn[], input: [][]) => [][]\n *\n * @see {@link map}\n *\n * @example\n * const inc = x => x + 1\n *\n * mapMatrix(inc, [[1, 2], [3, 4]])\n * // => [[2, 3], [4, 5]]\n *\n * mapMatrix([inc, inc], [[1, 2], [3, 4]])\n * // => [[3, 4], [5, 6]]\n */\nexport const mapMatrix = curry(_mapMatrix)\n"],"file":"map-matrix.js"}
1
+ {"version":3,"sources":["../../src/map-matrix/map-matrix.js"],"sourcesContent":["import { curry } from \"../curry/curry.js\"\nimport { pipe } from \"../pipe/pipe.js\"\n\nconst _mapMatrix = (_fn, input) => {\n const result = []\n const fn = Array.isArray(_fn) ? pipe(..._fn) : _fn\n\n for (\n let rowIndex = 0, rowCount = input.length;\n rowIndex < rowCount;\n ++rowIndex\n ) {\n const row = []\n\n for (\n let columnIndex = 0, columnCount = input[rowIndex].length;\n columnIndex < columnCount;\n ++columnIndex\n ) {\n row.push(fn(input[rowIndex][columnIndex], rowIndex, columnIndex, input))\n }\n\n result.push(row)\n }\n\n return result\n}\n\n/**\n * Matrix version of \"map\". Iterates over a two-dimensional array and applies\n * a function on each element, returning a new matrix with the transformed\n * elements.\n *\n * @param {Function|Function[]} fn Transform function called on all elements\n * @param {any[][]} input Two-dimensional array to iterate over\n *\n * @returns {any[][]} New array instance\n *\n * @name mapMatrix\n * @tag Array\n * @signature (fn: Fn|Fn[]) => (input: [][]) => [][]\n * @signature (fn: Fn|Fn[], input: [][]) => [][]\n *\n * @see {@link map}\n *\n * @example\n * const inc = x => x + 1\n *\n * mapMatrix(inc, [[1, 2], [3, 4]])\n * // => [[2, 3], [4, 5]]\n *\n * mapMatrix([inc, inc], [[1, 2], [3, 4]])\n * // => [[3, 4], [5, 6]]\n */\nexport const mapMatrix = curry(_mapMatrix)\n"],"names":["curry","pipe","_mapMatrix","_fn","input","result","fn","Array","isArray","rowIndex","rowCount","length","row","columnIndex","columnCount","push","mapMatrix"],"mappings":";AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAmB;AACzC,MAAM,GAAGC,IAAI,QAAQ,CAAiB;AAEtC,GAAK,CAACC,UAAU,GAAG,QAAQ,CAAPC,GAAG,EAAEC,KAAK,EAAK,CAAC;IAClC,GAAK,CAACC,MAAM,GAAG,CAAC,CAAC;IACjB,GAAK,CAACC,EAAE,GAAGC,KAAK,CAACC,OAAO,CAACL,GAAG,IAAIF,IAAI,CAAJA,KAAY,CAAZA,IAAI,CAAJA,CAAI,+BAAIE,GAAG,KAAIA,GAAG;IAElD,GAAG,CACD,GAAG,CAACM,QAAQ,GAAG,CAAC,EAAEC,QAAQ,GAAGN,KAAK,CAACO,MAAM,EACzCF,QAAQ,GAAGC,QAAQ,IACjBD,QAAQ,CACV,CAAC;QACD,GAAK,CAACG,GAAG,GAAG,CAAC,CAAC;QAEd,GAAG,CACD,GAAG,CAACC,WAAW,GAAG,CAAC,EAAEC,WAAW,GAAGV,KAAK,CAACK,QAAQ,EAAEE,MAAM,EACzDE,WAAW,GAAGC,WAAW,IACvBD,WAAW,CACb,CAAC;YACDD,GAAG,CAACG,IAAI,CAACT,EAAE,CAACF,KAAK,CAACK,QAAQ,EAAEI,WAAW,GAAGJ,QAAQ,EAAEI,WAAW,EAAET,KAAK;QACxE,CAAC;QAEDC,MAAM,CAACU,IAAI,CAACH,GAAG;IACjB,CAAC;IAED,MAAM,CAACP,MAAM;AACf,CAAC;AAED,EAyBG,AAzBH;;;;;;;;;;;;;;;;;;;;;;;;;CAyBG,AAzBH,EAyBG,CACH,MAAM,CAAC,GAAK,CAACW,SAAS,GAAGhB,KAAK,CAACE,UAAU"}
@@ -1,22 +1,82 @@
1
1
  import test from "tape";
2
2
  import { mapMatrix } from "./map-matrix.js";
3
-
4
- var square = function square(x) {
5
- return x * x;
3
+ var square = function(x) {
4
+ return x * x;
6
5
  };
7
-
8
- var inc = function inc(x) {
9
- return x + 1;
6
+ var inc = function(x) {
7
+ return x + 1;
10
8
  };
11
-
12
- test("mapMatrix", function (t) {
13
- t.deepEqual(mapMatrix(square)([[1, 2], [3, 4]]), [[1, 4], [9, 16]], "Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]");
14
- t.deepEqual(mapMatrix(square, [[1, 2], [3, 4]]), [[1, 4], [9, 16]], "Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]");
15
- t.deepEqual(mapMatrix([square, inc], [[1, 2], [3, 4]]), [[2, 5], [10, 17]], "Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]");
16
- mapMatrix(function (currentValue, rowIndex, columIndex, array) {
17
- t.equal(currentValue, array[rowIndex][columIndex], "callback element \"".concat(currentValue, "\" should equal [").concat(array, "][").concat(rowIndex, "][").concat(columIndex, "]"));
18
- return currentValue * currentValue;
19
- })([[1, 2]]);
20
- t.end();
9
+ test("mapMatrix", function(t) {
10
+ t.deepEqual(mapMatrix(square)([
11
+ [
12
+ 1,
13
+ 2
14
+ ],
15
+ [
16
+ 3,
17
+ 4
18
+ ],
19
+ ]), [
20
+ [
21
+ 1,
22
+ 4
23
+ ],
24
+ [
25
+ 9,
26
+ 16
27
+ ],
28
+ ], "Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]");
29
+ t.deepEqual(mapMatrix(square, [
30
+ [
31
+ 1,
32
+ 2
33
+ ],
34
+ [
35
+ 3,
36
+ 4
37
+ ],
38
+ ]), [
39
+ [
40
+ 1,
41
+ 4
42
+ ],
43
+ [
44
+ 9,
45
+ 16
46
+ ],
47
+ ], "Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]");
48
+ t.deepEqual(mapMatrix([
49
+ square,
50
+ inc
51
+ ], [
52
+ [
53
+ 1,
54
+ 2
55
+ ],
56
+ [
57
+ 3,
58
+ 4
59
+ ],
60
+ ]), [
61
+ [
62
+ 2,
63
+ 5
64
+ ],
65
+ [
66
+ 10,
67
+ 17
68
+ ],
69
+ ], "Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]");
70
+ mapMatrix(function(currentValue, rowIndex, columIndex, array) {
71
+ t.equal(currentValue, array[rowIndex][columIndex], "callback element \"".concat(currentValue, "\" should equal [").concat(array, "][").concat(rowIndex, "][").concat(columIndex, "]"));
72
+ return currentValue * currentValue;
73
+ })([
74
+ [
75
+ 1,
76
+ 2
77
+ ]
78
+ ]);
79
+ t.end();
21
80
  });
81
+
22
82
  //# sourceMappingURL=map-matrix.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/map-matrix/map-matrix.test.js"],"names":["test","mapMatrix","square","x","inc","t","deepEqual","currentValue","rowIndex","columIndex","array","equal","end"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,MAAjB;AAEA,SAASC,SAAT,QAA0B,iBAA1B;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,CAAC;AAAA,SAAIA,CAAC,GAAGA,CAAR;AAAA,CAAhB;;AACA,IAAMC,GAAG,GAAG,SAANA,GAAM,CAAAD,CAAC;AAAA,SAAIA,CAAC,GAAG,CAAR;AAAA,CAAb;;AAEAH,IAAI,CAAC,WAAD,EAAc,UAAAK,CAAC,EAAI;AACrBA,EAAAA,CAAC,CAACC,SAAF,CACEL,SAAS,CAACC,MAAD,CAAT,CAAkB,CAChB,CAAC,CAAD,EAAI,CAAJ,CADgB,EAEhB,CAAC,CAAD,EAAI,CAAJ,CAFgB,CAAlB,CADF,EAKE,CACE,CAAC,CAAD,EAAI,CAAJ,CADF,EAEE,CAAC,CAAD,EAAI,EAAJ,CAFF,CALF,EASE,4DATF;AAYAG,EAAAA,CAAC,CAACC,SAAF,CACEL,SAAS,CAACC,MAAD,EAAS,CAChB,CAAC,CAAD,EAAI,CAAJ,CADgB,EAEhB,CAAC,CAAD,EAAI,CAAJ,CAFgB,CAAT,CADX,EAKE,CACE,CAAC,CAAD,EAAI,CAAJ,CADF,EAEE,CAAC,CAAD,EAAI,EAAJ,CAFF,CALF,EASE,8DATF;AAYAG,EAAAA,CAAC,CAACC,SAAF,CACEL,SAAS,CACP,CAACC,MAAD,EAASE,GAAT,CADO,EAEP,CACE,CAAC,CAAD,EAAI,CAAJ,CADF,EAEE,CAAC,CAAD,EAAI,CAAJ,CAFF,CAFO,CADX,EAQE,CACE,CAAC,CAAD,EAAI,CAAJ,CADF,EAEE,CAAC,EAAD,EAAK,EAAL,CAFF,CARF,EAYE,yFAZF;AAeAH,EAAAA,SAAS,CAAC,UAACM,YAAD,EAAeC,QAAf,EAAyBC,UAAzB,EAAqCC,KAArC,EAA+C;AACvDL,IAAAA,CAAC,CAACM,KAAF,CACEJ,YADF,EAEEG,KAAK,CAACF,QAAD,CAAL,CAAgBC,UAAhB,CAFF,+BAGuBF,YAHvB,8BAGsDG,KAHtD,eAGgEF,QAHhE,eAG6EC,UAH7E;AAMA,WAAOF,YAAY,GAAGA,YAAtB;AACD,GARQ,CAAT,CAQG,CAAC,CAAC,CAAD,EAAI,CAAJ,CAAD,CARH;AAUAF,EAAAA,CAAC,CAACO,GAAF;AACD,CAnDG,CAAJ","sourcesContent":["import test from \"tape\"\n\nimport { mapMatrix } from \"./map-matrix.js\"\n\nconst square = x => x * x\nconst inc = x => x + 1\n\ntest(\"mapMatrix\", t => {\n t.deepEqual(\n mapMatrix(square)([\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(square, [\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(\n [square, inc],\n [\n [1, 2],\n [3, 4],\n ]\n ),\n [\n [2, 5],\n [10, 17],\n ],\n \"Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]\"\n )\n\n mapMatrix((currentValue, rowIndex, columIndex, array) => {\n t.equal(\n currentValue,\n array[rowIndex][columIndex],\n `callback element \"${currentValue}\" should equal [${array}][${rowIndex}][${columIndex}]`\n )\n\n return currentValue * currentValue\n })([[1, 2]])\n\n t.end()\n})\n"],"file":"map-matrix.test.js"}
1
+ {"version":3,"sources":["../../src/map-matrix/map-matrix.test.js"],"sourcesContent":["import test from \"tape\"\n\nimport { mapMatrix } from \"./map-matrix.js\"\n\nconst square = x => x * x\nconst inc = x => x + 1\n\ntest(\"mapMatrix\", t => {\n t.deepEqual(\n mapMatrix(square)([\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Curried (square)([[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(square, [\n [1, 2],\n [3, 4],\n ]),\n [\n [1, 4],\n [9, 16],\n ],\n \"Uncurried (square, [[1, 2], [3, 4]]) // => [[1, 4], [9, 16]]\"\n )\n\n t.deepEqual(\n mapMatrix(\n [square, inc],\n [\n [1, 2],\n [3, 4],\n ]\n ),\n [\n [2, 5],\n [10, 17],\n ],\n \"Multiple transform functions ([square, inc], [[1, 2], [3, 4]]) // => [[2, 5], [10, 17]]\"\n )\n\n mapMatrix((currentValue, rowIndex, columIndex, array) => {\n t.equal(\n currentValue,\n array[rowIndex][columIndex],\n `callback element \"${currentValue}\" should equal [${array}][${rowIndex}][${columIndex}]`\n )\n\n return currentValue * currentValue\n })([[1, 2]])\n\n t.end()\n})\n"],"names":["test","mapMatrix","square","x","inc","t","deepEqual","currentValue","rowIndex","columIndex","array","equal","end"],"mappings":"AAAA,MAAM,CAACA,IAAI,MAAM,CAAM;AAEvB,MAAM,GAAGC,SAAS,QAAQ,CAAiB;AAE3C,GAAK,CAACC,MAAM,GAAGC,QAAQ,CAARA,CAAC;IAAIA,MACpB,CADoBA,CAAC,GAAGA,CAAC;;AACzB,GAAK,CAACC,GAAG,GAAGD,QAAQ,CAARA,CAAC;IAAIA,MACjB,CADiBA,CAAC,GAAG,CAAC;;AAEtBH,IAAI,CAAC,CAAW,YAAEK,QACjB,CADiBA,CAAC,EAAI,CAAC;IACtBA,CAAC,CAACC,SAAS,CACTL,SAAS,CAACC,MAAM,EAAE,CAAC;QACjB,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;QACN,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;IACR,CAAC,GACD,CAAC;QACC,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;QACN,CAAC;AAAA,aAAC;AAAE,cAAE;QAAA,CAAC;IACT,CAAC,EACD,CAA4D;IAG9DG,CAAC,CAACC,SAAS,CACTL,SAAS,CAACC,MAAM,EAAE,CAAC;QACjB,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;QACN,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;IACR,CAAC,GACD,CAAC;QACC,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;QACN,CAAC;AAAA,aAAC;AAAE,cAAE;QAAA,CAAC;IACT,CAAC,EACD,CAA8D;IAGhEG,CAAC,CAACC,SAAS,CACTL,SAAS,CACP,CAACC;QAAAA,MAAM;QAAEE,GAAG;IAAA,CAAC,EACb,CAAC;QACC,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;QACN,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;IACR,CAAC,GAEH,CAAC;QACC,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;QACN,CAAC;AAAA,cAAE;AAAE,cAAE;QAAA,CAAC;IACV,CAAC,EACD,CAAyF;IAG3FH,SAAS,CAAC,QAAQ,CAAPM,YAAY,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAK,CAAC;QACxDL,CAAC,CAACM,KAAK,CACLJ,YAAY,EACZG,KAAK,CAACF,QAAQ,EAAEC,UAAU,GACzB,CAAkB,qBAAiCC,MAAK,CAApCH,YAAY,EAAC,CAAgB,oBAAYC,MAAQ,CAAlBE,KAAK,EAAC,CAAE,KAAeD,MAAU,CAAvBD,QAAQ,EAAC,CAAE,KAAa,MAAC,CAAZC,UAAU,EAAC,CAAC;QAGzF,MAAM,CAACF,YAAY,GAAGA,YAAY;IACpC,CAAC,EAAE,CAAC;QAAA,CAAC;AAAA,aAAC;AAAE,aAAC;QAAA,CAAC;IAAA,CAAC;IAEXF,CAAC,CAACO,GAAG;AACP,CAAC"}