@sparted/shared-library 1.0.8-alpha.6 → 1.0.9

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 (368) hide show
  1. package/{dist/cdn → cdn}/cdn.factory.js +16 -11
  2. package/cdn/cdn.factory.js.map +1 -0
  3. package/{dist/cdn → cdn}/types/cdn-factory.type.d.ts +4 -0
  4. package/{dist/cdn → cdn}/utils/extract-info-from-url.util.js +3 -0
  5. package/{dist/cdn → cdn}/utils/extract-info-from-url.util.js.map +1 -1
  6. package/http/build-search-params.d.ts +2 -0
  7. package/http/build-search-params.js +18 -0
  8. package/http/build-search-params.js.map +1 -0
  9. package/{dist/http → http}/index.d.ts +1 -0
  10. package/{dist/http → http}/index.js +2 -0
  11. package/http/index.js.map +1 -0
  12. package/{src/index.ts → index.d.ts} +14 -15
  13. package/{dist/index.js → index.js} +2 -2
  14. package/package.json +3 -7
  15. package/.circleci/config.yml +0 -40
  16. package/.eslintignore +0 -1
  17. package/.eslintrc.js +0 -17
  18. package/.gitignore +0 -37
  19. package/CHANGELOG.md +0 -34
  20. package/README.md +0 -26
  21. package/dist/cdn/cdn.factory.js.map +0 -1
  22. package/dist/github/branch/create-branch.d.ts +0 -11
  23. package/dist/github/branch/create-branch.js +0 -27
  24. package/dist/github/branch/create-branch.js.map +0 -1
  25. package/dist/github/branch/index.d.ts +0 -2
  26. package/dist/github/branch/index.js +0 -12
  27. package/dist/github/branch/index.js.map +0 -1
  28. package/dist/github/branch/update-branch.d.ts +0 -11
  29. package/dist/github/branch/update-branch.js +0 -26
  30. package/dist/github/branch/update-branch.js.map +0 -1
  31. package/dist/github/commit/create-git-blob.d.ts +0 -26
  32. package/dist/github/commit/create-git-blob.js +0 -42
  33. package/dist/github/commit/create-git-blob.js.map +0 -1
  34. package/dist/github/commit/create-git-commit.d.ts +0 -23
  35. package/dist/github/commit/create-git-commit.js +0 -39
  36. package/dist/github/commit/create-git-commit.js.map +0 -1
  37. package/dist/github/commit/create-git-tree.d.ts +0 -29
  38. package/dist/github/commit/create-git-tree.js +0 -47
  39. package/dist/github/commit/create-git-tree.js.map +0 -1
  40. package/dist/github/commit/get-sha-last-commit-of-branch.d.ts +0 -21
  41. package/dist/github/commit/get-sha-last-commit-of-branch.js +0 -35
  42. package/dist/github/commit/get-sha-last-commit-of-branch.js.map +0 -1
  43. package/dist/github/commit/get-tree-by-commit-sha.d.ts +0 -23
  44. package/dist/github/commit/get-tree-by-commit-sha.js +0 -37
  45. package/dist/github/commit/get-tree-by-commit-sha.js.map +0 -1
  46. package/dist/github/commit/index.d.ts +0 -6
  47. package/dist/github/commit/index.js +0 -20
  48. package/dist/github/commit/run-new-commit-process.d.ts +0 -27
  49. package/dist/github/commit/run-new-commit-process.js +0 -49
  50. package/dist/github/commit/run-new-commit-process.js.map +0 -1
  51. package/dist/github/commit/utils.d.ts +0 -1
  52. package/dist/github/commit/utils.js +0 -29
  53. package/dist/github/commit/utils.js.map +0 -1
  54. package/dist/github/content/get-file-content.d.ts +0 -20
  55. package/dist/github/content/get-file-content.js +0 -38
  56. package/dist/github/content/get-file-content.js.map +0 -1
  57. package/dist/github/github.d.ts +0 -25
  58. package/dist/github/github.js +0 -65
  59. package/dist/github/github.js.map +0 -1
  60. package/dist/github/index.d.ts +0 -1
  61. package/dist/github/index.js +0 -10
  62. package/dist/github/merge/create-pull-request.d.ts +0 -14
  63. package/dist/github/merge/create-pull-request.js +0 -30
  64. package/dist/github/merge/create-pull-request.js.map +0 -1
  65. package/dist/github/merge/index.d.ts +0 -2
  66. package/dist/github/merge/index.js +0 -12
  67. package/dist/github/merge/index.js.map +0 -1
  68. package/dist/github/merge/merge-pull-request.d.ts +0 -13
  69. package/dist/github/merge/merge-pull-request.js +0 -28
  70. package/dist/github/merge/merge-pull-request.js.map +0 -1
  71. package/dist/http/index.js.map +0 -1
  72. package/dist/index.d.ts +0 -15
  73. package/dist/package.json +0 -65
  74. package/dist/string/index.js.map +0 -1
  75. package/dist/time/index.js.map +0 -1
  76. package/global.d.ts +0 -2
  77. package/rollup.config.ts +0 -15
  78. package/src/array/__tests__/array-to-map.test.ts +0 -50
  79. package/src/array/__tests__/get-values-from-keys.test.ts +0 -14
  80. package/src/array/array-to-map.ts +0 -32
  81. package/src/array/get-values-from-keys.ts +0 -3
  82. package/src/array/index.ts +0 -2
  83. package/src/cdn/__tests__/cdn.factory.test.ts +0 -120
  84. package/src/cdn/__tests__/utils.test.ts +0 -456
  85. package/src/cdn/cdn.factory.ts +0 -63
  86. package/src/cdn/index.ts +0 -2
  87. package/src/cdn/types/cdn-factory.type.ts +0 -35
  88. package/src/cdn/types/index.ts +0 -1
  89. package/src/cdn/utils/extract-info-from-url.util.ts +0 -21
  90. package/src/cdn/utils/get-cdn-from-s3-url.util.ts +0 -20
  91. package/src/cdn/utils/get-cdn-url.util.ts +0 -26
  92. package/src/formatting/__tests__/format-number.test.ts +0 -11
  93. package/src/formatting/format-number.ts +0 -14
  94. package/src/formatting/index.ts +0 -1
  95. package/src/fp/__tests__/run-while.test.ts +0 -29
  96. package/src/fp/index.ts +0 -1
  97. package/src/fp/run-while.ts +0 -54
  98. package/src/github/branch/create-branch.ts +0 -36
  99. package/src/github/branch/index.ts +0 -2
  100. package/src/github/branch/update-branch.ts +0 -35
  101. package/src/github/commit/create-git-blob.ts +0 -57
  102. package/src/github/commit/create-git-commit.ts +0 -57
  103. package/src/github/commit/create-git-tree.ts +0 -68
  104. package/src/github/commit/get-sha-last-commit-of-branch.ts +0 -50
  105. package/src/github/commit/get-tree-by-commit-sha.ts +0 -52
  106. package/src/github/commit/index.ts +0 -6
  107. package/src/github/commit/run-new-commit-process.ts +0 -88
  108. package/src/github/commit/utils.ts +0 -31
  109. package/src/github/content/get-file-content.ts +0 -50
  110. package/src/github/github.ts +0 -93
  111. package/src/github/index.ts +0 -1
  112. package/src/github/merge/create-pull-request.ts +0 -42
  113. package/src/github/merge/index.ts +0 -2
  114. package/src/github/merge/merge-pull-request.ts +0 -39
  115. package/src/http/__tests__/encode-search-object.test.ts +0 -34
  116. package/src/http/__tests__/fetch-with-timeout.test.ts +0 -50
  117. package/src/http/encode-search-object.ts +0 -39
  118. package/src/http/fetch-with-timeout.ts +0 -24
  119. package/src/http/index.ts +0 -2
  120. package/src/linked-list/__tests__/apply-diff-linked-list.test.ts +0 -103
  121. package/src/linked-list/__tests__/create-linked-list.test.ts +0 -204
  122. package/src/linked-list/__tests__/find-linked-list.test.ts +0 -40
  123. package/src/linked-list/__tests__/get-linked-list.test.ts +0 -28
  124. package/src/linked-list/__tests__/insert-linked-list.test.ts +0 -186
  125. package/src/linked-list/__tests__/linked-list-utils.test.ts +0 -252
  126. package/src/linked-list/__tests__/reduce-linked-list.test.ts +0 -31
  127. package/src/linked-list/__tests__/remove-linked-list.test.ts +0 -129
  128. package/src/linked-list/__tests__/update-linked-list.test.ts +0 -53
  129. package/src/linked-list/__tests__/while-linked-list.test.ts +0 -58
  130. package/src/linked-list/apply-diff-linked-list.ts +0 -35
  131. package/src/linked-list/create-linked-list.ts +0 -79
  132. package/src/linked-list/find-linked-list.ts +0 -26
  133. package/src/linked-list/get-linked-list.ts +0 -9
  134. package/src/linked-list/index.ts +0 -2
  135. package/src/linked-list/insert-linked-list.ts +0 -50
  136. package/src/linked-list/linked-list-utils.ts +0 -143
  137. package/src/linked-list/reduce-linked-list.ts +0 -18
  138. package/src/linked-list/remove-linked-list.ts +0 -36
  139. package/src/linked-list/type.ts +0 -38
  140. package/src/linked-list/update-linked-list.ts +0 -29
  141. package/src/linked-list/while-linked-list.ts +0 -33
  142. package/src/math/__tests__/clamp-number.test.ts +0 -30
  143. package/src/math/__tests__/interpolate.test.ts +0 -28
  144. package/src/math/__tests__/number-range.test.ts +0 -59
  145. package/src/math/__tests__/random-number.test.ts +0 -11
  146. package/src/math/clamp-number.ts +0 -8
  147. package/src/math/index.ts +0 -4
  148. package/src/math/interpolate.ts +0 -18
  149. package/src/math/number-range.ts +0 -16
  150. package/src/math/random-number.ts +0 -10
  151. package/src/object/__tests__/merge-deep.test.ts +0 -56
  152. package/src/object/index.ts +0 -1
  153. package/src/object/merge-deep.ts +0 -27
  154. package/src/parsing/__tests__/parse-boolean.test.ts +0 -15
  155. package/src/parsing/__tests__/parse-enum.test.ts +0 -19
  156. package/src/parsing/__tests__/parse-number.test.ts +0 -20
  157. package/src/parsing/index.ts +0 -3
  158. package/src/parsing/parse-boolean.ts +0 -10
  159. package/src/parsing/parse-enum.ts +0 -16
  160. package/src/parsing/parse-number.ts +0 -12
  161. package/src/predicates/__tests__/is-function.test.ts +0 -11
  162. package/src/predicates/__tests__/is-null.test.ts +0 -11
  163. package/src/predicates/__tests__/is-object.test.ts +0 -11
  164. package/src/predicates/__tests__/is-primitive.test.ts +0 -42
  165. package/src/predicates/__tests__/is-undefined.test.ts +0 -11
  166. package/src/predicates/__tests__/is-uuid.test.ts +0 -13
  167. package/src/predicates/index.ts +0 -5
  168. package/src/predicates/is-function.ts +0 -3
  169. package/src/predicates/is-null.ts +0 -3
  170. package/src/predicates/is-object.ts +0 -3
  171. package/src/predicates/is-primitive.ts +0 -19
  172. package/src/predicates/is-undefined.ts +0 -3
  173. package/src/predicates/is-uuid.ts +0 -3
  174. package/src/promise/__tests__/delay.test.ts +0 -13
  175. package/src/promise/__tests__/execute-or-resolve-default.test.ts +0 -25
  176. package/src/promise/__tests__/execute-with-delay.test.ts +0 -24
  177. package/src/promise/delay.ts +0 -3
  178. package/src/promise/execute-or-resolve-default.ts +0 -14
  179. package/src/promise/execute-with-delay.ts +0 -6
  180. package/src/promise/index.ts +0 -3
  181. package/src/string/__tests__/replace-in-template.test.ts +0 -52
  182. package/src/string/index.ts +0 -1
  183. package/src/string/replace-in-template.ts +0 -45
  184. package/src/time/__tests__/convert.test.ts +0 -14
  185. package/src/time/__tests__/format-minutes.test.ts +0 -10
  186. package/src/time/__tests__/get-time-diff-as-string.test.ts +0 -128
  187. package/src/time/constants.ts +0 -4
  188. package/src/time/convert.ts +0 -5
  189. package/src/time/format-minutes.ts +0 -9
  190. package/src/time/get-time-diff-as-string.ts +0 -196
  191. package/src/time/index.ts +0 -4
  192. package/src/types/function.ts +0 -1
  193. package/src/types/general.ts +0 -8
  194. package/src/types/index.ts +0 -4
  195. package/src/types/object.ts +0 -33
  196. package/src/types/search.ts +0 -29
  197. package/tsconfig.eslint.json +0 -8
  198. package/tsconfig.json +0 -25
  199. /package/{dist/_virtual → _virtual}/_tslib.js +0 -0
  200. /package/{dist/_virtual → _virtual}/_tslib.js.map +0 -0
  201. /package/{dist/array → array}/array-to-map.d.ts +0 -0
  202. /package/{dist/array → array}/array-to-map.js +0 -0
  203. /package/{dist/array → array}/array-to-map.js.map +0 -0
  204. /package/{dist/array → array}/get-values-from-keys.d.ts +0 -0
  205. /package/{dist/array → array}/get-values-from-keys.js +0 -0
  206. /package/{dist/array → array}/get-values-from-keys.js.map +0 -0
  207. /package/{dist/array → array}/index.d.ts +0 -0
  208. /package/{dist/array → array}/index.js +0 -0
  209. /package/{dist/array → array}/index.js.map +0 -0
  210. /package/{dist/cdn → cdn}/cdn.factory.d.ts +0 -0
  211. /package/{dist/cdn → cdn}/index.d.ts +0 -0
  212. /package/{dist/cdn → cdn}/index.js +0 -0
  213. /package/{dist/cdn → cdn}/index.js.map +0 -0
  214. /package/{dist/cdn → cdn}/types/index.d.ts +0 -0
  215. /package/{dist/cdn → cdn}/types/index.js +0 -0
  216. /package/{dist/cdn → cdn}/types/index.js.map +0 -0
  217. /package/{dist/cdn → cdn}/utils/extract-info-from-url.util.d.ts +0 -0
  218. /package/{dist/cdn → cdn}/utils/get-cdn-from-s3-url.util.d.ts +0 -0
  219. /package/{dist/cdn → cdn}/utils/get-cdn-from-s3-url.util.js +0 -0
  220. /package/{dist/cdn → cdn}/utils/get-cdn-from-s3-url.util.js.map +0 -0
  221. /package/{dist/cdn → cdn}/utils/get-cdn-url.util.d.ts +0 -0
  222. /package/{dist/cdn → cdn}/utils/get-cdn-url.util.js +0 -0
  223. /package/{dist/cdn → cdn}/utils/get-cdn-url.util.js.map +0 -0
  224. /package/{dist/formatting → formatting}/format-number.d.ts +0 -0
  225. /package/{dist/formatting → formatting}/format-number.js +0 -0
  226. /package/{dist/formatting → formatting}/format-number.js.map +0 -0
  227. /package/{dist/formatting → formatting}/index.d.ts +0 -0
  228. /package/{dist/formatting → formatting}/index.js +0 -0
  229. /package/{dist/formatting → formatting}/index.js.map +0 -0
  230. /package/{dist/fp → fp}/index.d.ts +0 -0
  231. /package/{dist/fp → fp}/index.js +0 -0
  232. /package/{dist/fp → fp}/index.js.map +0 -0
  233. /package/{dist/fp → fp}/run-while.d.ts +0 -0
  234. /package/{dist/fp → fp}/run-while.js +0 -0
  235. /package/{dist/fp → fp}/run-while.js.map +0 -0
  236. /package/{dist/http → http}/encode-search-object.d.ts +0 -0
  237. /package/{dist/http → http}/encode-search-object.js +0 -0
  238. /package/{dist/http → http}/encode-search-object.js.map +0 -0
  239. /package/{dist/http → http}/fetch-with-timeout.d.ts +0 -0
  240. /package/{dist/http → http}/fetch-with-timeout.js +0 -0
  241. /package/{dist/http → http}/fetch-with-timeout.js.map +0 -0
  242. /package/{dist/index.js.map → index.js.map} +0 -0
  243. /package/{dist/linked-list → linked-list}/apply-diff-linked-list.d.ts +0 -0
  244. /package/{dist/linked-list → linked-list}/apply-diff-linked-list.js +0 -0
  245. /package/{dist/linked-list → linked-list}/apply-diff-linked-list.js.map +0 -0
  246. /package/{dist/linked-list → linked-list}/create-linked-list.d.ts +0 -0
  247. /package/{dist/linked-list → linked-list}/create-linked-list.js +0 -0
  248. /package/{dist/linked-list → linked-list}/create-linked-list.js.map +0 -0
  249. /package/{dist/linked-list → linked-list}/find-linked-list.d.ts +0 -0
  250. /package/{dist/linked-list → linked-list}/find-linked-list.js +0 -0
  251. /package/{dist/linked-list → linked-list}/find-linked-list.js.map +0 -0
  252. /package/{dist/linked-list → linked-list}/get-linked-list.d.ts +0 -0
  253. /package/{dist/linked-list → linked-list}/get-linked-list.js +0 -0
  254. /package/{dist/linked-list → linked-list}/get-linked-list.js.map +0 -0
  255. /package/{dist/linked-list → linked-list}/index.d.ts +0 -0
  256. /package/{dist/linked-list → linked-list}/index.js +0 -0
  257. /package/{dist/github → linked-list}/index.js.map +0 -0
  258. /package/{dist/linked-list → linked-list}/insert-linked-list.d.ts +0 -0
  259. /package/{dist/linked-list → linked-list}/insert-linked-list.js +0 -0
  260. /package/{dist/linked-list → linked-list}/insert-linked-list.js.map +0 -0
  261. /package/{dist/linked-list → linked-list}/linked-list-utils.d.ts +0 -0
  262. /package/{dist/linked-list → linked-list}/linked-list-utils.js +0 -0
  263. /package/{dist/linked-list → linked-list}/linked-list-utils.js.map +0 -0
  264. /package/{dist/linked-list → linked-list}/reduce-linked-list.d.ts +0 -0
  265. /package/{dist/linked-list → linked-list}/reduce-linked-list.js +0 -0
  266. /package/{dist/linked-list → linked-list}/reduce-linked-list.js.map +0 -0
  267. /package/{dist/linked-list → linked-list}/remove-linked-list.d.ts +0 -0
  268. /package/{dist/linked-list → linked-list}/remove-linked-list.js +0 -0
  269. /package/{dist/linked-list → linked-list}/remove-linked-list.js.map +0 -0
  270. /package/{dist/linked-list → linked-list}/type.d.ts +0 -0
  271. /package/{dist/linked-list → linked-list}/update-linked-list.d.ts +0 -0
  272. /package/{dist/linked-list → linked-list}/update-linked-list.js +0 -0
  273. /package/{dist/linked-list → linked-list}/update-linked-list.js.map +0 -0
  274. /package/{dist/linked-list → linked-list}/while-linked-list.d.ts +0 -0
  275. /package/{dist/linked-list → linked-list}/while-linked-list.js +0 -0
  276. /package/{dist/linked-list → linked-list}/while-linked-list.js.map +0 -0
  277. /package/{dist/math → math}/clamp-number.d.ts +0 -0
  278. /package/{dist/math → math}/clamp-number.js +0 -0
  279. /package/{dist/math → math}/clamp-number.js.map +0 -0
  280. /package/{dist/math → math}/index.d.ts +0 -0
  281. /package/{dist/math → math}/index.js +0 -0
  282. /package/{dist/math → math}/index.js.map +0 -0
  283. /package/{dist/math → math}/interpolate.d.ts +0 -0
  284. /package/{dist/math → math}/interpolate.js +0 -0
  285. /package/{dist/math → math}/interpolate.js.map +0 -0
  286. /package/{dist/math → math}/number-range.d.ts +0 -0
  287. /package/{dist/math → math}/number-range.js +0 -0
  288. /package/{dist/math → math}/number-range.js.map +0 -0
  289. /package/{dist/math → math}/random-number.d.ts +0 -0
  290. /package/{dist/math → math}/random-number.js +0 -0
  291. /package/{dist/math → math}/random-number.js.map +0 -0
  292. /package/{dist/object → object}/index.d.ts +0 -0
  293. /package/{dist/object → object}/index.js +0 -0
  294. /package/{dist/linked-list → object}/index.js.map +0 -0
  295. /package/{dist/object → object}/merge-deep.d.ts +0 -0
  296. /package/{dist/object → object}/merge-deep.js +0 -0
  297. /package/{dist/object → object}/merge-deep.js.map +0 -0
  298. /package/{dist/parsing → parsing}/index.d.ts +0 -0
  299. /package/{dist/parsing → parsing}/index.js +0 -0
  300. /package/{dist/parsing → parsing}/index.js.map +0 -0
  301. /package/{dist/parsing → parsing}/parse-boolean.d.ts +0 -0
  302. /package/{dist/parsing → parsing}/parse-boolean.js +0 -0
  303. /package/{dist/parsing → parsing}/parse-boolean.js.map +0 -0
  304. /package/{dist/parsing → parsing}/parse-enum.d.ts +0 -0
  305. /package/{dist/parsing → parsing}/parse-enum.js +0 -0
  306. /package/{dist/parsing → parsing}/parse-enum.js.map +0 -0
  307. /package/{dist/parsing → parsing}/parse-number.d.ts +0 -0
  308. /package/{dist/parsing → parsing}/parse-number.js +0 -0
  309. /package/{dist/parsing → parsing}/parse-number.js.map +0 -0
  310. /package/{dist/predicates → predicates}/index.d.ts +0 -0
  311. /package/{dist/predicates → predicates}/index.js +0 -0
  312. /package/{dist/predicates → predicates}/index.js.map +0 -0
  313. /package/{dist/predicates → predicates}/is-function.d.ts +0 -0
  314. /package/{dist/predicates → predicates}/is-function.js +0 -0
  315. /package/{dist/predicates → predicates}/is-function.js.map +0 -0
  316. /package/{dist/predicates → predicates}/is-null.d.ts +0 -0
  317. /package/{dist/predicates → predicates}/is-null.js +0 -0
  318. /package/{dist/predicates → predicates}/is-null.js.map +0 -0
  319. /package/{dist/predicates → predicates}/is-object.d.ts +0 -0
  320. /package/{dist/predicates → predicates}/is-object.js +0 -0
  321. /package/{dist/predicates → predicates}/is-object.js.map +0 -0
  322. /package/{dist/predicates → predicates}/is-primitive.d.ts +0 -0
  323. /package/{dist/predicates → predicates}/is-primitive.js +0 -0
  324. /package/{dist/predicates → predicates}/is-primitive.js.map +0 -0
  325. /package/{dist/predicates → predicates}/is-undefined.d.ts +0 -0
  326. /package/{dist/predicates → predicates}/is-undefined.js +0 -0
  327. /package/{dist/predicates → predicates}/is-undefined.js.map +0 -0
  328. /package/{dist/predicates → predicates}/is-uuid.d.ts +0 -0
  329. /package/{dist/promise → promise}/delay.d.ts +0 -0
  330. /package/{dist/promise → promise}/delay.js +0 -0
  331. /package/{dist/promise → promise}/delay.js.map +0 -0
  332. /package/{dist/promise → promise}/execute-or-resolve-default.d.ts +0 -0
  333. /package/{dist/promise → promise}/execute-or-resolve-default.js +0 -0
  334. /package/{dist/promise → promise}/execute-or-resolve-default.js.map +0 -0
  335. /package/{dist/promise → promise}/execute-with-delay.d.ts +0 -0
  336. /package/{dist/promise → promise}/execute-with-delay.js +0 -0
  337. /package/{dist/promise → promise}/execute-with-delay.js.map +0 -0
  338. /package/{dist/promise → promise}/index.d.ts +0 -0
  339. /package/{dist/promise → promise}/index.js +0 -0
  340. /package/{dist/promise → promise}/index.js.map +0 -0
  341. /package/{dist/string → string}/index.d.ts +0 -0
  342. /package/{dist/string → string}/index.js +0 -0
  343. /package/{dist/object → string}/index.js.map +0 -0
  344. /package/{dist/string → string}/replace-in-template.d.ts +0 -0
  345. /package/{dist/string → string}/replace-in-template.js +0 -0
  346. /package/{dist/string → string}/replace-in-template.js.map +0 -0
  347. /package/{dist/time → time}/constants.d.ts +0 -0
  348. /package/{dist/time → time}/constants.js +0 -0
  349. /package/{dist/time → time}/constants.js.map +0 -0
  350. /package/{dist/time → time}/convert.d.ts +0 -0
  351. /package/{dist/time → time}/convert.js +0 -0
  352. /package/{dist/time → time}/convert.js.map +0 -0
  353. /package/{dist/time → time}/format-minutes.d.ts +0 -0
  354. /package/{dist/time → time}/format-minutes.js +0 -0
  355. /package/{dist/time → time}/format-minutes.js.map +0 -0
  356. /package/{dist/time → time}/get-time-diff-as-string.d.ts +0 -0
  357. /package/{dist/time → time}/get-time-diff-as-string.js +0 -0
  358. /package/{dist/time → time}/get-time-diff-as-string.js.map +0 -0
  359. /package/{dist/time → time}/index.d.ts +0 -0
  360. /package/{dist/time → time}/index.js +0 -0
  361. /package/{dist/github/commit → time}/index.js.map +0 -0
  362. /package/{dist/types → types}/function.d.ts +0 -0
  363. /package/{dist/types → types}/general.d.ts +0 -0
  364. /package/{dist/types → types}/index.d.ts +0 -0
  365. /package/{dist/types → types}/index.js +0 -0
  366. /package/{dist/types → types}/index.js.map +0 -0
  367. /package/{dist/types → types}/object.d.ts +0 -0
  368. /package/{dist/types → types}/search.d.ts +0 -0
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('../commit/utils.js');
8
-
9
- const createPullRequestResponseSchema = zod.z.object({
10
- url: zod.z.string(),
11
- number: zod.z.number(),
12
- });
13
- const createPullRequestFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
14
- const { title, body, head, base } = args;
15
- try {
16
- const { data } = yield instance.post('/pulls', {
17
- title,
18
- body,
19
- head,
20
- base,
21
- });
22
- return createPullRequestResponseSchema.parse(data);
23
- }
24
- catch (error) {
25
- throw utils.handleError(error);
26
- }
27
- });
28
-
29
- exports.createPullRequestFactory = createPullRequestFactory;
30
- //# sourceMappingURL=create-pull-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-pull-request.js","sources":["../../../src/github/merge/create-pull-request.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from '../commit/utils';\n\nexport type CreatePullRequestArgs = {\n title: string;\n body: string;\n head: string;\n base: string;\n};\n\nexport type CreatePullRequestResponse = {\n url: string;\n number: number;\n};\n\nconst createPullRequestResponseSchema = z.object({\n url: z.string(),\n number: z.number(),\n});\n\nexport type CreatePullRequest = (args: CreatePullRequestArgs) => Promise<CreatePullRequestResponse>;\n\nexport type CreatePullRequestFactory = (instance: AxiosInstance) => CreatePullRequest;\n\nexport const createPullRequestFactory: CreatePullRequestFactory = (instance) => async (args) => {\n const { title, body, head, base } = args;\n\n try {\n const { data } = await instance.post<CreatePullRequestResponse>('/pulls', {\n title,\n body,\n head,\n base,\n });\n\n return createPullRequestResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAiBA,MAAM,+BAA+B,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC/C,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AACf,IAAA,MAAM,EAAEA,KAAC,CAAC,MAAM,EAAE;AACnB,CAAA,CAAC,CAAC;AAMI,MAAM,wBAAwB,GAA6B,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEzC,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAA4B,QAAQ,EAAE;YACxE,KAAK;YACL,IAAI;YACJ,IAAI;YACJ,IAAI;AACL,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,+BAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACpD,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1,2 +0,0 @@
1
- export * from './create-pull-request';
2
- export * from './merge-pull-request';
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var createPullRequest = require('./create-pull-request.js');
6
- var mergePullRequest = require('./merge-pull-request.js');
7
-
8
-
9
-
10
- exports.createPullRequestFactory = createPullRequest.createPullRequestFactory;
11
- exports.mergePullRequestFactory = mergePullRequest.mergePullRequestFactory;
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,13 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- export declare type MergePullRequestArgs = {
3
- pullRequestNumber: number;
4
- commitTitle: string;
5
- commitMessage: string;
6
- mergeMethod: 'merge' | 'squash' | 'rebase';
7
- };
8
- export declare type MergePullRequestResponse = {
9
- sha: string;
10
- };
11
- export declare type MergePullRequest = (args: MergePullRequestArgs) => Promise<MergePullRequestResponse>;
12
- export declare type MergePullRequestFactory = (instance: AxiosInstance) => MergePullRequest;
13
- export declare const mergePullRequestFactory: MergePullRequestFactory;
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('../commit/utils.js');
8
-
9
- const mergePullRequestResponseSchema = zod.z.object({
10
- sha: zod.z.string(),
11
- });
12
- const mergePullRequestFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
13
- const { pullRequestNumber, commitTitle, commitMessage, mergeMethod } = args;
14
- try {
15
- const { data } = yield instance.put(`/pulls/${pullRequestNumber}/merge`, {
16
- commit_title: commitTitle,
17
- commit_message: commitMessage,
18
- merge_method: mergeMethod,
19
- });
20
- return mergePullRequestResponseSchema.parse(data);
21
- }
22
- catch (error) {
23
- throw utils.handleError(error);
24
- }
25
- });
26
-
27
- exports.mergePullRequestFactory = mergePullRequestFactory;
28
- //# sourceMappingURL=merge-pull-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merge-pull-request.js","sources":["../../../src/github/merge/merge-pull-request.ts"],"sourcesContent":["import { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from '../commit/utils';\n\nexport type MergePullRequestArgs = {\n pullRequestNumber: number;\n commitTitle: string;\n commitMessage: string;\n mergeMethod: 'merge' | 'squash' | 'rebase';\n};\n\nexport type MergePullRequestResponse = {\n sha: string;\n};\n\nconst mergePullRequestResponseSchema = z.object({\n sha: z.string(),\n});\n\nexport type MergePullRequest = (args: MergePullRequestArgs) => Promise<MergePullRequestResponse>;\n\nexport type MergePullRequestFactory = (instance: AxiosInstance) => MergePullRequest;\n\nexport const mergePullRequestFactory: MergePullRequestFactory = (instance) => async (args) => {\n const { pullRequestNumber, commitTitle, commitMessage, mergeMethod } = args;\n\n try {\n const { data } = await instance.put<MergePullRequestResponse>(`/pulls/${pullRequestNumber}/merge`, {\n commit_title: commitTitle,\n commit_message: commitMessage,\n merge_method: mergeMethod,\n });\n\n return mergePullRequestResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAgBA,MAAM,8BAA8B,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC9C,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AAChB,CAAA,CAAC,CAAC;AAMI,MAAM,uBAAuB,GAA4B,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;IAC3F,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE5E,IAAI;AACF,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,GAAG,CAA2B,CAAA,OAAA,EAAU,iBAAiB,CAAA,MAAA,CAAQ,EAAE;AACjG,YAAA,YAAY,EAAE,WAAW;AACzB,YAAA,cAAc,EAAE,aAAa;AAC7B,YAAA,YAAY,EAAE,WAAW;AAC1B,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,8BAA8B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnD,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/dist/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export * from './array';
2
- export * from './cdn';
3
- export * from './time';
4
- export * from './formatting';
5
- export * from './fp';
6
- export * from './github';
7
- export * from './http';
8
- export * from './linked-list';
9
- export * from './math';
10
- export * from './object';
11
- export * from './parsing';
12
- export * from './predicates';
13
- export * from './promise';
14
- export * from './string';
15
- export * from './types';
package/dist/package.json DELETED
@@ -1,65 +0,0 @@
1
- {
2
- "name": "@sparted/shared-library",
3
- "version": "1.0.8-alpha.6",
4
- "repository": "git@github.com:Sparted/shared-library.git",
5
- "author": "Thomas <duprethomasfr@gmail.com>",
6
- "license": "MIT",
7
- "sideEffets": false,
8
- "main": "dist/index.js",
9
- "module": "dist/index.js",
10
- "files": [
11
- "**/*",
12
- "**/**"
13
- ],
14
- "scripts": {
15
- "test": "jest",
16
- "lint": "eslint .",
17
- "clean": "rm -rf ./dist",
18
- "build": "yarn clean && rollup --config rollup.config.ts --configPlugin typescript2 && cp package.json ./dist/package.json",
19
- "build-and-publish": "yarn test && yarn build && (cd ./dist && NPM_CONFIG_REGISTRY=undefined npm publish)"
20
- },
21
- "devDependencies": {
22
- "@sparted/eslint-config": "^1.0.0",
23
- "@types/glob": "^8.0.0",
24
- "@types/jest": "^29.0.3",
25
- "@typescript-eslint/eslint-plugin": "^5.8.0",
26
- "@typescript-eslint/parser": "^5.8.0",
27
- "eslint": "^7.32.0",
28
- "eslint-config-airbnb": "^19.0.4",
29
- "eslint-config-airbnb-typescript": "^16.1.0",
30
- "eslint-plugin-import": "^2.25.3",
31
- "eslint-plugin-jsx-a11y": "^6.5.1",
32
- "eslint-plugin-react": "^7.28.0",
33
- "eslint-plugin-react-hooks": "^4.3.0",
34
- "glob": "^8.0.3",
35
- "jest": "^29.0.3",
36
- "jest-environment-jsdom": "^29.0.3",
37
- "jest-extended": "^3.1.0",
38
- "jest-fetch-mock": "^3.0.3",
39
- "rollup": "^2.79.1",
40
- "rollup-plugin-typescript2": "^0.34.0",
41
- "ts-jest": "^29.0.2",
42
- "tslib": "^2.4.0",
43
- "typescript": "^4.8.3"
44
- },
45
- "jest": {
46
- "moduleFileExtensions": [
47
- "js",
48
- "ts"
49
- ],
50
- "setupFilesAfterEnv": [
51
- "jest-extended/all"
52
- ],
53
- "rootDir": ".",
54
- "testRegex": [
55
- ".*\\.test\\.ts$"
56
- ],
57
- "transform": {
58
- "^.+\\.(t|j)s$": "ts-jest"
59
- }
60
- },
61
- "dependencies": {
62
- "axios": "^1.3.4",
63
- "zod": "^3.21.4"
64
- }
65
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
package/global.d.ts DELETED
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies -- only needed during development
2
- import 'jest-extended';
package/rollup.config.ts DELETED
@@ -1,15 +0,0 @@
1
- import { glob } from 'glob';
2
- import typescript from 'rollup-plugin-typescript2';
3
-
4
- export default {
5
- input: glob.sync('./src/**/index.ts'),
6
- plugins: [typescript({
7
- exclude: ['**/__tests__', '**/*.test.ts'],
8
- })],
9
- output: [{
10
- dir: 'dist',
11
- format: 'cjs',
12
- sourcemap: true,
13
- preserveModules: true, // Keep directory structure and files
14
- }],
15
- };
@@ -1,50 +0,0 @@
1
- import { arrayToMap } from '../array-to-map';
2
-
3
- type Item = {
4
- id: string,
5
- bar: number,
6
- };
7
-
8
- describe('arrayToMap', () => {
9
- it('should convert array to map with item containing one key', () => {
10
- const array = [{ id: 'toto' }, { id: 'bonjour' }];
11
- const map = arrayToMap(array, { selectKey: ({ id }) => id });
12
-
13
- expect(map).toStrictEqual({
14
- bonjour: { id: 'bonjour' },
15
- toto: { id: 'toto' },
16
- });
17
- });
18
-
19
- it('should convert array to map and select right key in item', () => {
20
- const array = [{ id: 'toto', bar: 1 }, { id: 'bonjour', bar: 2 }];
21
- const map = arrayToMap(array, { selectKey: ({ bar }) => bar.toString() });
22
-
23
- expect(map).toStrictEqual({
24
- 1: { id: 'toto', bar: 1 },
25
- 2: { id: 'bonjour', bar: 2 },
26
- });
27
- });
28
-
29
- it('should handle data transformation', () => {
30
- const item1: Item = { id: 'toto', bar: 1 };
31
- const item2: Item = { id: 'bonjour', bar: 2 };
32
- const array = [item1, item2];
33
-
34
- const modifierFn = jest.fn();
35
- const map = arrayToMap<Item, string>(array, {
36
- selectKey: ({ bar }) => bar.toString(),
37
- dataModifier: ({ id }, currentMap) => {
38
- modifierFn(currentMap);
39
- return id;
40
- },
41
- });
42
-
43
- expect(modifierFn).toHaveBeenNthCalledWith(1, {});
44
- expect(modifierFn).toHaveBeenNthCalledWith(2, { 1: 'toto' });
45
- expect(map).toStrictEqual({
46
- 1: 'toto',
47
- 2: 'bonjour',
48
- });
49
- });
50
- });
@@ -1,14 +0,0 @@
1
- import { valuesFromKeys } from '../get-values-from-keys';
2
-
3
- describe('valuesFromKeys', () => {
4
- it('should transform a map to an array with only selected keys', () => {
5
- const map = {
6
- uno: 1,
7
- dos: 2,
8
- tres: 3,
9
- quatro: 4,
10
- };
11
-
12
- expect(valuesFromKeys(['uno', 'tres'], map)).toStrictEqual([1, 3]);
13
- });
14
- });
@@ -1,32 +0,0 @@
1
- export type ArrayToMapOptions<InitialValue, ModifiedValue = InitialValue> = {
2
- /**
3
- * Function to return the key used in the map.
4
- */
5
- selectKey: (value: InitialValue) => string,
6
- /**
7
- * Transform the initial data into another value
8
- */
9
- dataModifier?: (value: InitialValue, map: Readonly<Record<string, ModifiedValue>>) => ModifiedValue;
10
- };
11
-
12
- /**
13
- * Transform an array to a map.
14
- */
15
- export const arrayToMap = <InitialValue, ModifiedValue = InitialValue>(
16
- array: ReadonlyArray<InitialValue>,
17
- options: ArrayToMapOptions<InitialValue, ModifiedValue>,
18
- ) => {
19
- const { selectKey } = options;
20
-
21
- return array.reduce<Record<string, ModifiedValue>>((acc, current) => {
22
- const key = selectKey(current);
23
- const value = options.dataModifier
24
- ? options.dataModifier(current, acc)
25
- : current;
26
-
27
- return {
28
- ...acc,
29
- [key]: value as ModifiedValue,
30
- };
31
- }, {});
32
- };
@@ -1,3 +0,0 @@
1
- export const valuesFromKeys = <T>(keys: string[], map: Record<string, T>) => (
2
- keys.map((key) => map[key])
3
- );
@@ -1,2 +0,0 @@
1
- export * from './array-to-map';
2
- export * from './get-values-from-keys';
@@ -1,120 +0,0 @@
1
- import {
2
- createCdn,
3
- imgixTransformationQueries,
4
- twicpicsTransformationQueries,
5
- } from '../cdn.factory';
6
- import type { InstanceMapper } from '../types';
7
- import { getCdnFromS3UrlFactory } from '../utils/get-cdn-from-s3-url.util';
8
- import { getCdnUrlFactory } from '../utils/get-cdn-url.util';
9
-
10
- describe('TransformationQueries', () => {
11
- it('Imgix - should handle imgix transformation', () => {
12
- expect(
13
- imgixTransformationQueries({
14
- fit: 'crop',
15
- width: 1,
16
- height: 1,
17
- }),
18
- ).toBe('?auto=compress,format&fit=crop&h=1&w=1');
19
-
20
- expect(imgixTransformationQueries({ fit: 'crop', width: 1 })).toBe(
21
- '?auto=compress,format&fit=crop&w=1',
22
- );
23
-
24
- expect(imgixTransformationQueries({ fit: 'crop', height: 1 })).toBe(
25
- '?auto=compress,format&fit=crop&h=1',
26
- );
27
-
28
- expect(imgixTransformationQueries({ width: 1 })).toBe(
29
- '?auto=compress,format&w=1',
30
- );
31
-
32
- expect(imgixTransformationQueries({ height: 1 })).toBe(
33
- '?auto=compress,format&h=1',
34
- );
35
-
36
- expect(imgixTransformationQueries({ width: 1, height: 1 })).toBe(
37
- '?auto=compress,format&h=1&w=1',
38
- );
39
-
40
- expect(imgixTransformationQueries({ devicePixelRatio: 2 })).toBe(
41
- '?auto=compress,format&dpr=2',
42
- );
43
-
44
- expect(imgixTransformationQueries({ quality: 75 })).toBe(
45
- '?auto=compress,format&q=75',
46
- );
47
- });
48
-
49
- it('should handle twicpics transformation', () => {
50
- const crop = twicpicsTransformationQueries({
51
- fit: 'crop',
52
- width: 1,
53
- height: 1,
54
- });
55
-
56
- expect(crop).toBe('?twic=v1/crop=1x1');
57
-
58
- const contain = twicpicsTransformationQueries({
59
- fit: 'contain',
60
- width: 1,
61
- height: 1,
62
- });
63
-
64
- expect(contain).toBe('?twic=v1/contain=1x1');
65
-
66
- const cover = twicpicsTransformationQueries({ width: 1 });
67
-
68
- expect(cover).toBe('?twic=v1/cover=1');
69
- });
70
- });
71
-
72
- describe('cdnFactory', () => {
73
- it('Imgix - should instanciate the right cdn', () => {
74
- const domain = 'https://sparted.imgix.fr';
75
- const instanceMapper: InstanceMapper = (instanceId) => `/prod/${instanceId}`;
76
- const getCdnUrl = getCdnUrlFactory({
77
- domain,
78
- instanceMapper,
79
- transformationQueries: imgixTransformationQueries,
80
- });
81
-
82
- const getCdnFromS3Url = getCdnFromS3UrlFactory({
83
- getCdnUrl,
84
- });
85
-
86
- const cdn = createCdn({
87
- type: 'imgix',
88
- domain: 'https://sparted.imgix.fr/',
89
- instanceMapper,
90
- });
91
-
92
- expect(cdn.getCdnUrl.toString()).toBe(getCdnUrl.toString());
93
-
94
- expect(cdn.getCdnFromS3Url.toString()).toBe(getCdnFromS3Url.toString());
95
- });
96
-
97
- it('Twicpics - should instanciate the right cdn', () => {
98
- const domain = 'https://sparted.twicpics.fr';
99
- const instanceMapper: InstanceMapper = (instanceId) => `/prod/${instanceId}`;
100
- const getCdnUrl = getCdnUrlFactory({
101
- domain,
102
- instanceMapper,
103
- transformationQueries: twicpicsTransformationQueries,
104
- });
105
-
106
- const getCdnFromS3Url = getCdnFromS3UrlFactory({
107
- getCdnUrl,
108
- });
109
-
110
- const cdn = createCdn({
111
- type: 'twicpics',
112
- domain: 'https://sparted.twicpics.fr/',
113
- instanceMapper: (instanceId) => instanceId,
114
- });
115
-
116
- expect(cdn.getCdnUrl.toString()).toBe(getCdnUrl.toString());
117
-
118
- expect(cdn.getCdnFromS3Url.toString()).toBe(getCdnFromS3Url.toString());
119
- });
120
- });