@koine/utils 2.0.0-beta.37 → 2.0.0-beta.39

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 (602) hide show
  1. package/Defer.d.ts +0 -1
  2. package/Emitter.d.ts +2 -3
  3. package/README.md +48 -0
  4. package/accentSets.d.ts +1 -2
  5. package/addOrReplaceAtIdx.d.ts +1 -2
  6. package/areEqual.d.ts +2 -2
  7. package/arrayFilterFalsy.d.ts +1 -2
  8. package/arrayOfAll.d.ts +1 -2
  9. package/arraySum.d.ts +1 -2
  10. package/arrayToLookup.d.ts +1 -2
  11. package/arrayUniqueByProperties.d.ts +1 -2
  12. package/buildUrlQueryString.d.ts +2 -3
  13. package/capitalize.d.ts +1 -2
  14. package/changeCaseCamel.d.ts +2 -0
  15. package/changeCaseCapital.d.ts +2 -0
  16. package/changeCaseConstant.d.ts +2 -0
  17. package/changeCaseDot.d.ts +2 -0
  18. package/changeCaseHelpers.d.ts +19 -0
  19. package/changeCaseKebab.d.ts +2 -0
  20. package/changeCaseNone.d.ts +2 -0
  21. package/changeCasePascal.d.ts +2 -0
  22. package/changeCasePascalSnake.d.ts +2 -0
  23. package/changeCasePath.d.ts +2 -0
  24. package/changeCaseSentence.d.ts +2 -0
  25. package/changeCaseSnake.d.ts +2 -0
  26. package/changeCaseTrain.d.ts +2 -0
  27. package/chunkByChunks.d.ts +1 -2
  28. package/chunkBySize.d.ts +1 -2
  29. package/clamp.d.ts +1 -2
  30. package/clsx.d.ts +2 -2
  31. package/convertRange.d.ts +1 -2
  32. package/cookie.d.ts +1 -1
  33. package/createPalette.d.ts +2 -2
  34. package/debounce.d.ts +1 -2
  35. package/debouncePromise.d.ts +1 -2
  36. package/debounceRaf.d.ts +0 -1
  37. package/decode.d.ts +1 -2
  38. package/encode.d.ts +1 -2
  39. package/ensureInt.d.ts +1 -2
  40. package/errorToString.d.ts +1 -2
  41. package/findDuplicatedIndexes.d.ts +1 -2
  42. package/forin.d.ts +1 -2
  43. package/gbToBytes.d.ts +1 -2
  44. package/getEmptyArray.d.ts +1 -2
  45. package/getKeys.d.ts +1 -2
  46. package/getMediaQueryWidthResolvers.d.ts +1 -2
  47. package/getMediaQueryWidthTailwindScreens.d.ts +2 -3
  48. package/getNonce.d.ts +1 -2
  49. package/getParamAmong.d.ts +1 -2
  50. package/getParamAsInt.d.ts +1 -2
  51. package/getParamAsString.d.ts +1 -2
  52. package/getType.d.ts +1 -2
  53. package/getUrlHashParams.d.ts +1 -3
  54. package/getUrlHashPathname.d.ts +1 -2
  55. package/getUrlPathnameParts.d.ts +1 -2
  56. package/getUrlQueryParams.d.ts +1 -3
  57. package/imgEmptyPixel.d.ts +1 -2
  58. package/index.cjs.d.ts +1 -0
  59. package/index.cjs.default.js +1 -0
  60. package/index.cjs.js +473 -0
  61. package/index.cjs.mjs +2 -0
  62. package/index.d.ts +149 -140
  63. package/index.esm.js +324 -0
  64. package/invariant.d.ts +1 -2
  65. package/isAnyObject.d.ts +2 -3
  66. package/isArray.d.ts +1 -2
  67. package/isBlob.d.ts +1 -2
  68. package/isBoolean.d.ts +1 -2
  69. package/isBrowser.d.ts +1 -2
  70. package/isBrowserNow.d.ts +1 -2
  71. package/isDate.d.ts +1 -2
  72. package/isEmptyArray.d.ts +1 -2
  73. package/isEmptyObject.d.ts +4 -3
  74. package/isEmptyString.d.ts +1 -2
  75. package/isError.d.ts +1 -2
  76. package/isExternalUrl.d.ts +1 -2
  77. package/isFile.d.ts +1 -2
  78. package/isFloat.d.ts +1 -2
  79. package/isFormData.d.ts +1 -2
  80. package/isFullArray.d.ts +1 -2
  81. package/isFullObject.d.ts +2 -3
  82. package/isFullString.d.ts +1 -2
  83. package/isFunction.d.ts +2 -3
  84. package/isInt.d.ts +1 -2
  85. package/isMap.d.ts +1 -2
  86. package/isNaNValue.d.ts +1 -2
  87. package/isNegativeNumber.d.ts +1 -2
  88. package/isNull.d.ts +1 -2
  89. package/isNullOrUndefined.d.ts +1 -2
  90. package/isNumber.d.ts +1 -2
  91. package/isNumericLiteral.d.ts +1 -2
  92. package/isObject.d.ts +2 -3
  93. package/isObjectLike.d.ts +2 -3
  94. package/isOneOf.d.ts +1 -2
  95. package/isPlainObject.d.ts +2 -3
  96. package/isPositiveNumber.d.ts +1 -2
  97. package/isPrimitive.d.ts +1 -2
  98. package/isPromise.d.ts +1 -2
  99. package/isRegExp.d.ts +1 -2
  100. package/isServer.d.ts +1 -2
  101. package/isServerNow.d.ts +1 -2
  102. package/isSet.d.ts +1 -2
  103. package/isString.d.ts +1 -2
  104. package/isSymbol.d.ts +1 -2
  105. package/isType.d.ts +2 -3
  106. package/isUndefined.d.ts +1 -2
  107. package/isWeakMap.d.ts +1 -2
  108. package/isWeakSet.d.ts +1 -2
  109. package/kbToBytes.d.ts +1 -2
  110. package/lowercase.d.ts +1 -2
  111. package/mapListBy.d.ts +1 -2
  112. package/matchSorter.d.ts +2 -3
  113. package/mbToBytes.d.ts +1 -2
  114. package/mergeObjects.d.ts +1 -1
  115. package/mergeUrlQueryParams.d.ts +2 -3
  116. package/moveSortableArrayItemByKey.d.ts +1 -2
  117. package/noop.d.ts +1 -2
  118. package/normaliseUrl.d.ts +1 -2
  119. package/normaliseUrlPathname.d.ts +1 -2
  120. package/objectFlat.d.ts +3 -0
  121. package/objectFlip.d.ts +1 -2
  122. package/objectOmit.d.ts +1 -2
  123. package/objectPick.d.ts +1 -2
  124. package/objectToArray.d.ts +1 -2
  125. package/package.json +10 -590
  126. package/parseCookie.d.ts +2 -3
  127. package/parseURL.d.ts +1 -2
  128. package/quaranteneProps.d.ts +2 -2
  129. package/randomInt.d.ts +1 -2
  130. package/randomKey.d.ts +1 -2
  131. package/readCookie.d.ts +0 -1
  132. package/removeAccents.d.ts +2 -3
  133. package/removeCookie.d.ts +2 -3
  134. package/removeDuplicatesByKey.d.ts +1 -2
  135. package/removeDuplicatesComparing.d.ts +1 -2
  136. package/removeIndexesFromArray.d.ts +1 -2
  137. package/removeTrailingSlash.d.ts +1 -2
  138. package/removeUrlQueryParams.d.ts +1 -2
  139. package/render.d.ts +2 -2
  140. package/round.d.ts +2 -3
  141. package/roundTo.d.ts +1 -2
  142. package/serializeCookie.d.ts +2 -3
  143. package/setCookie.d.ts +2 -3
  144. package/shuffle.d.ts +1 -2
  145. package/slugify.d.ts +1 -2
  146. package/split.d.ts +1 -2
  147. package/swapMap.d.ts +1 -2
  148. package/throttle.d.ts +1 -2
  149. package/titleCase.d.ts +1 -2
  150. package/toNumber.d.ts +1 -2
  151. package/toRgba.d.ts +1 -2
  152. package/transformToUrlPathname.d.ts +1 -2
  153. package/truncate.d.ts +1 -2
  154. package/tryUntil.d.ts +1 -2
  155. package/uid.d.ts +1 -2
  156. package/updateLinkParams.d.ts +2 -3
  157. package/updateUrlQueryParams.d.ts +2 -3
  158. package/uppercase.d.ts +1 -2
  159. package/uuid.d.ts +1 -2
  160. package/uuidNumeric.d.ts +1 -2
  161. package/wait.d.ts +1 -2
  162. package/Defer.js +0 -11
  163. package/Emitter.js +0 -20
  164. package/accentSets.js +0 -30
  165. package/addOrReplaceAtIdx.js +0 -16
  166. package/areEqual.js +0 -58
  167. package/arrayFilterFalsy.js +0 -4
  168. package/arrayOfAll.js +0 -6
  169. package/arraySum.js +0 -4
  170. package/arrayToLookup.js +0 -8
  171. package/arrayUniqueByProperties.js +0 -8
  172. package/buildUrlQueryString.js +0 -21
  173. package/capitalize.js +0 -6
  174. package/changeUrlPath.d.ts +0 -2
  175. package/changeUrlPath.js +0 -10
  176. package/chunkByChunks.js +0 -32
  177. package/chunkBySize.js +0 -8
  178. package/cjs/Defer.d.ts +0 -6
  179. package/cjs/Defer.js +0 -15
  180. package/cjs/Emitter.d.ts +0 -7
  181. package/cjs/Emitter.js +0 -24
  182. package/cjs/accentSets.d.ts +0 -3
  183. package/cjs/accentSets.js +0 -33
  184. package/cjs/addOrReplaceAtIdx.d.ts +0 -2
  185. package/cjs/addOrReplaceAtIdx.js +0 -20
  186. package/cjs/areEqual.d.ts +0 -4
  187. package/cjs/areEqual.js +0 -62
  188. package/cjs/arrayFilterFalsy.d.ts +0 -2
  189. package/cjs/arrayFilterFalsy.js +0 -8
  190. package/cjs/arrayOfAll.d.ts +0 -2
  191. package/cjs/arrayOfAll.js +0 -10
  192. package/cjs/arraySum.d.ts +0 -2
  193. package/cjs/arraySum.js +0 -8
  194. package/cjs/arrayToLookup.d.ts +0 -2
  195. package/cjs/arrayToLookup.js +0 -12
  196. package/cjs/arrayUniqueByProperties.d.ts +0 -2
  197. package/cjs/arrayUniqueByProperties.js +0 -12
  198. package/cjs/buildUrlQueryString.d.ts +0 -3
  199. package/cjs/buildUrlQueryString.js +0 -25
  200. package/cjs/capitalize.d.ts +0 -2
  201. package/cjs/capitalize.js +0 -10
  202. package/cjs/changeUrlPath.d.ts +0 -2
  203. package/cjs/changeUrlPath.js +0 -14
  204. package/cjs/chunkByChunks.d.ts +0 -2
  205. package/cjs/chunkByChunks.js +0 -36
  206. package/cjs/chunkBySize.d.ts +0 -2
  207. package/cjs/chunkBySize.js +0 -12
  208. package/cjs/clamp.d.ts +0 -2
  209. package/cjs/clamp.js +0 -8
  210. package/cjs/clsx.d.ts +0 -6
  211. package/cjs/clsx.js +0 -44
  212. package/cjs/convertRange.d.ts +0 -2
  213. package/cjs/convertRange.js +0 -8
  214. package/cjs/cookie.d.ts +0 -18
  215. package/cjs/cookie.js +0 -4
  216. package/cjs/createPalette.d.ts +0 -10
  217. package/cjs/createPalette.js +0 -16
  218. package/cjs/debounce.d.ts +0 -2
  219. package/cjs/debounce.js +0 -26
  220. package/cjs/debouncePromise.d.ts +0 -11
  221. package/cjs/debouncePromise.js +0 -69
  222. package/cjs/debounceRaf.d.ts +0 -2
  223. package/cjs/debounceRaf.js +0 -21
  224. package/cjs/decode.d.ts +0 -2
  225. package/cjs/decode.js +0 -10
  226. package/cjs/encode.d.ts +0 -2
  227. package/cjs/encode.js +0 -10
  228. package/cjs/ensureInt.d.ts +0 -2
  229. package/cjs/ensureInt.js +0 -8
  230. package/cjs/env.d.ts +0 -0
  231. package/cjs/env.js +0 -1
  232. package/cjs/errorToString.d.ts +0 -2
  233. package/cjs/errorToString.js +0 -9
  234. package/cjs/findDuplicatedIndexes.d.ts +0 -2
  235. package/cjs/findDuplicatedIndexes.js +0 -15
  236. package/cjs/forin.d.ts +0 -2
  237. package/cjs/forin.js +0 -10
  238. package/cjs/gbToBytes.d.ts +0 -2
  239. package/cjs/gbToBytes.js +0 -6
  240. package/cjs/getEmptyArray.d.ts +0 -2
  241. package/cjs/getEmptyArray.js +0 -12
  242. package/cjs/getKeys.d.ts +0 -2
  243. package/cjs/getKeys.js +0 -5
  244. package/cjs/getMediaQueryWidthResolvers.d.ts +0 -10
  245. package/cjs/getMediaQueryWidthResolvers.js +0 -44
  246. package/cjs/getMediaQueryWidthTailwindScreens.d.ts +0 -5
  247. package/cjs/getMediaQueryWidthTailwindScreens.js +0 -31
  248. package/cjs/getNonce.d.ts +0 -2
  249. package/cjs/getNonce.js +0 -9
  250. package/cjs/getParamAmong.d.ts +0 -2
  251. package/cjs/getParamAmong.js +0 -11
  252. package/cjs/getParamAsInt.d.ts +0 -2
  253. package/cjs/getParamAsInt.js +0 -14
  254. package/cjs/getParamAsString.d.ts +0 -2
  255. package/cjs/getParamAsString.js +0 -9
  256. package/cjs/getType.d.ts +0 -7
  257. package/cjs/getType.js +0 -8
  258. package/cjs/getUrlHashParams.d.ts +0 -3
  259. package/cjs/getUrlHashParams.js +0 -14
  260. package/cjs/getUrlHashPathname.d.ts +0 -2
  261. package/cjs/getUrlHashPathname.js +0 -10
  262. package/cjs/getUrlPathnameParts.d.ts +0 -2
  263. package/cjs/getUrlPathnameParts.js +0 -14
  264. package/cjs/getUrlQueryParams.d.ts +0 -3
  265. package/cjs/getUrlQueryParams.js +0 -29
  266. package/cjs/imgEmptyPixel.d.ts +0 -2
  267. package/cjs/imgEmptyPixel.js +0 -5
  268. package/cjs/index.d.ts +0 -141
  269. package/cjs/index.js +0 -279
  270. package/cjs/invariant.d.ts +0 -2
  271. package/cjs/invariant.js +0 -21
  272. package/cjs/isAnyObject.d.ts +0 -3
  273. package/cjs/isAnyObject.js +0 -9
  274. package/cjs/isArray.d.ts +0 -2
  275. package/cjs/isArray.js +0 -9
  276. package/cjs/isBlob.d.ts +0 -2
  277. package/cjs/isBlob.js +0 -9
  278. package/cjs/isBoolean.d.ts +0 -2
  279. package/cjs/isBoolean.js +0 -9
  280. package/cjs/isBrowser.d.ts +0 -2
  281. package/cjs/isBrowser.js +0 -5
  282. package/cjs/isBrowserNow.d.ts +0 -2
  283. package/cjs/isBrowserNow.js +0 -7
  284. package/cjs/isDate.d.ts +0 -2
  285. package/cjs/isDate.js +0 -9
  286. package/cjs/isEmptyArray.d.ts +0 -2
  287. package/cjs/isEmptyArray.js +0 -9
  288. package/cjs/isEmptyObject.d.ts +0 -4
  289. package/cjs/isEmptyObject.js +0 -9
  290. package/cjs/isEmptyString.d.ts +0 -2
  291. package/cjs/isEmptyString.js +0 -8
  292. package/cjs/isError.d.ts +0 -2
  293. package/cjs/isError.js +0 -9
  294. package/cjs/isExternalUrl.d.ts +0 -2
  295. package/cjs/isExternalUrl.js +0 -16
  296. package/cjs/isFile.d.ts +0 -2
  297. package/cjs/isFile.js +0 -9
  298. package/cjs/isFloat.d.ts +0 -2
  299. package/cjs/isFloat.js +0 -9
  300. package/cjs/isFormData.d.ts +0 -2
  301. package/cjs/isFormData.js +0 -9
  302. package/cjs/isFullArray.d.ts +0 -2
  303. package/cjs/isFullArray.js +0 -9
  304. package/cjs/isFullObject.d.ts +0 -3
  305. package/cjs/isFullObject.js +0 -9
  306. package/cjs/isFullString.d.ts +0 -2
  307. package/cjs/isFullString.js +0 -9
  308. package/cjs/isFunction.d.ts +0 -3
  309. package/cjs/isFunction.js +0 -8
  310. package/cjs/isInt.d.ts +0 -2
  311. package/cjs/isInt.js +0 -9
  312. package/cjs/isMap.d.ts +0 -2
  313. package/cjs/isMap.js +0 -9
  314. package/cjs/isNaNValue.d.ts +0 -2
  315. package/cjs/isNaNValue.js +0 -9
  316. package/cjs/isNegativeNumber.d.ts +0 -2
  317. package/cjs/isNegativeNumber.js +0 -9
  318. package/cjs/isNull.d.ts +0 -2
  319. package/cjs/isNull.js +0 -9
  320. package/cjs/isNullOrUndefined.d.ts +0 -2
  321. package/cjs/isNullOrUndefined.js +0 -8
  322. package/cjs/isNumber.d.ts +0 -2
  323. package/cjs/isNumber.js +0 -9
  324. package/cjs/isNumericLiteral.d.ts +0 -2
  325. package/cjs/isNumericLiteral.js +0 -8
  326. package/cjs/isObject.d.ts +0 -3
  327. package/cjs/isObject.js +0 -9
  328. package/cjs/isObjectLike.d.ts +0 -3
  329. package/cjs/isObjectLike.js +0 -9
  330. package/cjs/isOneOf.d.ts +0 -6
  331. package/cjs/isOneOf.js +0 -14
  332. package/cjs/isPlainObject.d.ts +0 -3
  333. package/cjs/isPlainObject.js +0 -12
  334. package/cjs/isPositiveNumber.d.ts +0 -2
  335. package/cjs/isPositiveNumber.js +0 -9
  336. package/cjs/isPrimitive.d.ts +0 -2
  337. package/cjs/isPrimitive.js +0 -19
  338. package/cjs/isPromise.d.ts +0 -2
  339. package/cjs/isPromise.js +0 -9
  340. package/cjs/isRegExp.d.ts +0 -2
  341. package/cjs/isRegExp.js +0 -9
  342. package/cjs/isServer.d.ts +0 -2
  343. package/cjs/isServer.js +0 -6
  344. package/cjs/isServerNow.d.ts +0 -2
  345. package/cjs/isServerNow.js +0 -7
  346. package/cjs/isSet.d.ts +0 -2
  347. package/cjs/isSet.js +0 -9
  348. package/cjs/isString.d.ts +0 -2
  349. package/cjs/isString.js +0 -9
  350. package/cjs/isSymbol.d.ts +0 -2
  351. package/cjs/isSymbol.js +0 -9
  352. package/cjs/isType.d.ts +0 -3
  353. package/cjs/isType.js +0 -17
  354. package/cjs/isUndefined.d.ts +0 -2
  355. package/cjs/isUndefined.js +0 -9
  356. package/cjs/isWeakMap.d.ts +0 -2
  357. package/cjs/isWeakMap.js +0 -9
  358. package/cjs/isWeakSet.d.ts +0 -2
  359. package/cjs/isWeakSet.js +0 -9
  360. package/cjs/kbToBytes.d.ts +0 -2
  361. package/cjs/kbToBytes.js +0 -6
  362. package/cjs/location.d.ts +0 -1
  363. package/cjs/location.js +0 -2
  364. package/cjs/lowercase.d.ts +0 -2
  365. package/cjs/lowercase.js +0 -8
  366. package/cjs/mapListBy.d.ts +0 -2
  367. package/cjs/mapListBy.js +0 -13
  368. package/cjs/matchSorter.d.ts +0 -54
  369. package/cjs/matchSorter.js +0 -259
  370. package/cjs/mbToBytes.d.ts +0 -2
  371. package/cjs/mbToBytes.js +0 -6
  372. package/cjs/mergeObjects.d.ts +0 -1
  373. package/cjs/mergeObjects.js +0 -37
  374. package/cjs/mergeUrlQueryParams.d.ts +0 -3
  375. package/cjs/mergeUrlQueryParams.js +0 -20
  376. package/cjs/moveSortableArrayItemByKey.d.ts +0 -2
  377. package/cjs/moveSortableArrayItemByKey.js +0 -14
  378. package/cjs/noop.d.ts +0 -2
  379. package/cjs/noop.js +0 -6
  380. package/cjs/normaliseUrl.d.ts +0 -2
  381. package/cjs/normaliseUrl.js +0 -10
  382. package/cjs/normaliseUrlPathname.d.ts +0 -2
  383. package/cjs/normaliseUrlPathname.js +0 -10
  384. package/cjs/objectFlip.d.ts +0 -2
  385. package/cjs/objectFlip.js +0 -15
  386. package/cjs/objectOmit.d.ts +0 -2
  387. package/cjs/objectOmit.js +0 -14
  388. package/cjs/objectPick.d.ts +0 -2
  389. package/cjs/objectPick.js +0 -13
  390. package/cjs/objectToArray.d.ts +0 -2
  391. package/cjs/objectToArray.js +0 -8
  392. package/cjs/package.json +0 -9
  393. package/cjs/parseCookie.d.ts +0 -3
  394. package/cjs/parseCookie.js +0 -38
  395. package/cjs/parseURL.d.ts +0 -11
  396. package/cjs/parseURL.js +0 -18
  397. package/cjs/quaranteneProps.d.ts +0 -7
  398. package/cjs/quaranteneProps.js +0 -20
  399. package/cjs/randomInt.d.ts +0 -2
  400. package/cjs/randomInt.js +0 -8
  401. package/cjs/randomKey.d.ts +0 -2
  402. package/cjs/randomKey.js +0 -9
  403. package/cjs/readCookie.d.ts +0 -3
  404. package/cjs/readCookie.js +0 -38
  405. package/cjs/removeAccents.d.ts +0 -3
  406. package/cjs/removeAccents.js +0 -17
  407. package/cjs/removeCookie.d.ts +0 -3
  408. package/cjs/removeCookie.js +0 -12
  409. package/cjs/removeDuplicates.d.ts +0 -0
  410. package/cjs/removeDuplicates.js +0 -1
  411. package/cjs/removeDuplicatesByKey.d.ts +0 -2
  412. package/cjs/removeDuplicatesByKey.js +0 -18
  413. package/cjs/removeDuplicatesComparing.d.ts +0 -2
  414. package/cjs/removeDuplicatesComparing.js +0 -11
  415. package/cjs/removeIndexesFromArray.d.ts +0 -2
  416. package/cjs/removeIndexesFromArray.js +0 -14
  417. package/cjs/removeTrailingSlash.d.ts +0 -2
  418. package/cjs/removeTrailingSlash.js +0 -9
  419. package/cjs/removeUrlQueryParams.d.ts +0 -2
  420. package/cjs/removeUrlQueryParams.js +0 -19
  421. package/cjs/render.d.ts +0 -13
  422. package/cjs/render.js +0 -123
  423. package/cjs/round.d.ts +0 -3
  424. package/cjs/round.js +0 -10
  425. package/cjs/roundTo.d.ts +0 -2
  426. package/cjs/roundTo.js +0 -16
  427. package/cjs/serializeCookie.d.ts +0 -3
  428. package/cjs/serializeCookie.js +0 -74
  429. package/cjs/setCookie.d.ts +0 -3
  430. package/cjs/setCookie.js +0 -47
  431. package/cjs/shuffle.d.ts +0 -2
  432. package/cjs/shuffle.js +0 -22
  433. package/cjs/slugify.d.ts +0 -2
  434. package/cjs/slugify.js +0 -18
  435. package/cjs/split.d.ts +0 -3
  436. package/cjs/split.js +0 -6
  437. package/cjs/swapMap.d.ts +0 -2
  438. package/cjs/swapMap.js +0 -13
  439. package/cjs/throttle.d.ts +0 -3
  440. package/cjs/throttle.js +0 -24
  441. package/cjs/titleCase.d.ts +0 -2
  442. package/cjs/titleCase.js +0 -10
  443. package/cjs/toNumber.d.ts +0 -2
  444. package/cjs/toNumber.js +0 -9
  445. package/cjs/toRgba.d.ts +0 -2
  446. package/cjs/toRgba.js +0 -13
  447. package/cjs/transformToUrlPathname.d.ts +0 -2
  448. package/cjs/transformToUrlPathname.js +0 -11
  449. package/cjs/truncate.d.ts +0 -2
  450. package/cjs/truncate.js +0 -12
  451. package/cjs/tryUntil.d.ts +0 -2
  452. package/cjs/tryUntil.js +0 -19
  453. package/cjs/types.d.ts +0 -10
  454. package/cjs/types.js +0 -2
  455. package/cjs/uid.d.ts +0 -2
  456. package/cjs/uid.js +0 -11
  457. package/cjs/updateLinkParams.d.ts +0 -3
  458. package/cjs/updateLinkParams.js +0 -11
  459. package/cjs/updateUrlQueryParams.d.ts +0 -3
  460. package/cjs/updateUrlQueryParams.js +0 -16
  461. package/cjs/uppercase.d.ts +0 -2
  462. package/cjs/uppercase.js +0 -8
  463. package/cjs/uuid.d.ts +0 -2
  464. package/cjs/uuid.js +0 -11
  465. package/cjs/uuidNumeric.d.ts +0 -2
  466. package/cjs/uuidNumeric.js +0 -6
  467. package/cjs/wait.d.ts +0 -2
  468. package/cjs/wait.js +0 -8
  469. package/cjs/without.d.ts +0 -0
  470. package/cjs/without.js +0 -1
  471. package/clamp.js +0 -4
  472. package/clsx.js +0 -40
  473. package/convertRange.js +0 -4
  474. package/cookie.js +0 -1
  475. package/createPalette.js +0 -12
  476. package/debounce.js +0 -22
  477. package/debouncePromise.js +0 -65
  478. package/debounceRaf.js +0 -17
  479. package/decode.js +0 -6
  480. package/encode.js +0 -6
  481. package/ensureInt.js +0 -4
  482. package/env.js +0 -1
  483. package/errorToString.js +0 -5
  484. package/findDuplicatedIndexes.js +0 -11
  485. package/forin.js +0 -6
  486. package/gbToBytes.js +0 -2
  487. package/getEmptyArray.js +0 -8
  488. package/getKeys.js +0 -2
  489. package/getMediaQueryWidthResolvers.js +0 -40
  490. package/getMediaQueryWidthTailwindScreens.js +0 -27
  491. package/getNonce.js +0 -5
  492. package/getParamAmong.js +0 -7
  493. package/getParamAsInt.js +0 -10
  494. package/getParamAsString.js +0 -5
  495. package/getType.js +0 -4
  496. package/getUrlHashParams.js +0 -10
  497. package/getUrlHashPathname.js +0 -6
  498. package/getUrlPathnameParts.js +0 -10
  499. package/getUrlQueryParams.js +0 -25
  500. package/imgEmptyPixel.js +0 -2
  501. package/index.js +0 -137
  502. package/invariant.js +0 -17
  503. package/isAnyObject.js +0 -5
  504. package/isArray.js +0 -5
  505. package/isBlob.js +0 -5
  506. package/isBoolean.js +0 -5
  507. package/isBrowser.js +0 -2
  508. package/isBrowserNow.js +0 -3
  509. package/isDate.js +0 -5
  510. package/isEmptyArray.js +0 -5
  511. package/isEmptyObject.js +0 -5
  512. package/isEmptyString.js +0 -4
  513. package/isError.js +0 -5
  514. package/isExternalUrl.js +0 -12
  515. package/isFile.js +0 -5
  516. package/isFloat.js +0 -5
  517. package/isFormData.js +0 -5
  518. package/isFullArray.js +0 -5
  519. package/isFullObject.js +0 -5
  520. package/isFullString.js +0 -5
  521. package/isFunction.js +0 -4
  522. package/isInt.js +0 -5
  523. package/isMap.js +0 -5
  524. package/isNaNValue.js +0 -5
  525. package/isNegativeNumber.js +0 -5
  526. package/isNull.js +0 -5
  527. package/isNullOrUndefined.js +0 -5
  528. package/isNumber.js +0 -5
  529. package/isNumericLiteral.js +0 -4
  530. package/isObject.js +0 -5
  531. package/isObjectLike.js +0 -5
  532. package/isOneOf.js +0 -10
  533. package/isPlainObject.js +0 -8
  534. package/isPositiveNumber.js +0 -5
  535. package/isPrimitive.js +0 -15
  536. package/isPromise.js +0 -5
  537. package/isRegExp.js +0 -5
  538. package/isServer.js +0 -3
  539. package/isServerNow.js +0 -3
  540. package/isSet.js +0 -5
  541. package/isString.js +0 -5
  542. package/isSymbol.js +0 -5
  543. package/isType.js +0 -13
  544. package/isUndefined.js +0 -5
  545. package/isWeakMap.js +0 -5
  546. package/isWeakSet.js +0 -5
  547. package/kbToBytes.js +0 -2
  548. package/location.js +0 -1
  549. package/lowercase.js +0 -4
  550. package/mapListBy.js +0 -9
  551. package/matchSorter.js +0 -255
  552. package/mbToBytes.js +0 -2
  553. package/mergeObjects.js +0 -33
  554. package/mergeUrlQueryParams.js +0 -16
  555. package/moveSortableArrayItemByKey.js +0 -10
  556. package/noop.js +0 -2
  557. package/normaliseUrl.js +0 -6
  558. package/normaliseUrlPathname.js +0 -6
  559. package/objectFlip.js +0 -11
  560. package/objectOmit.js +0 -10
  561. package/objectPick.js +0 -9
  562. package/objectToArray.js +0 -4
  563. package/parseCookie.js +0 -34
  564. package/parseURL.js +0 -14
  565. package/quaranteneProps.js +0 -16
  566. package/randomInt.js +0 -4
  567. package/randomKey.js +0 -5
  568. package/readCookie.js +0 -34
  569. package/removeAccents.js +0 -13
  570. package/removeCookie.js +0 -8
  571. package/removeDuplicates.js +0 -1
  572. package/removeDuplicatesByKey.js +0 -14
  573. package/removeDuplicatesComparing.js +0 -7
  574. package/removeIndexesFromArray.js +0 -10
  575. package/removeTrailingSlash.js +0 -5
  576. package/removeUrlQueryParams.js +0 -15
  577. package/render.js +0 -119
  578. package/round.js +0 -6
  579. package/roundTo.js +0 -12
  580. package/serializeCookie.js +0 -70
  581. package/setCookie.js +0 -43
  582. package/shuffle.js +0 -18
  583. package/slugify.js +0 -14
  584. package/split.js +0 -2
  585. package/swapMap.js +0 -9
  586. package/throttle.js +0 -20
  587. package/titleCase.js +0 -6
  588. package/toNumber.js +0 -5
  589. package/toRgba.js +0 -9
  590. package/transformToUrlPathname.js +0 -7
  591. package/truncate.js +0 -8
  592. package/tryUntil.js +0 -15
  593. package/types.js +0 -1
  594. package/typings.d.ts +0 -35
  595. package/uid.js +0 -7
  596. package/updateLinkParams.js +0 -7
  597. package/updateUrlQueryParams.js +0 -12
  598. package/uppercase.js +0 -4
  599. package/uuid.js +0 -7
  600. package/uuidNumeric.js +0 -2
  601. package/wait.js +0 -4
  602. package/without.js +0 -1
@@ -1,3 +0,0 @@
1
- import { type AccentsSet } from "./accentSets";
2
- export declare function removeAccents(text?: string, sets?: AccentsSet[]): string;
3
- export default removeAccents;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeAccents = void 0;
4
- var tslib_1 = require("tslib");
5
- var accentSets_1 = require("./accentSets");
6
- function removeAccents(text, sets) {
7
- if (text === void 0) { text = ""; }
8
- if (sets === void 0) { sets = accentSets_1.accentsSets; }
9
- var len = sets.length;
10
- while (len--) {
11
- var _a = tslib_1.__read(sets[len], 2), to = _a[0], from = _a[1];
12
- text = text.replace(new RegExp("[".concat(from, "]"), "gi"), to);
13
- }
14
- return text;
15
- }
16
- exports.removeAccents = removeAccents;
17
- exports.default = removeAccents;
@@ -1,3 +0,0 @@
1
- import { type CookieAttributesClient } from "./cookie";
2
- export declare function removeCookie(name: string, attributes?: CookieAttributesClient): void;
3
- export default removeCookie;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeCookie = void 0;
4
- var tslib_1 = require("tslib");
5
- var cookie_1 = require("./cookie");
6
- var setCookie_1 = require("./setCookie");
7
- function removeCookie(name, attributes) {
8
- if (attributes === void 0) { attributes = {}; }
9
- (0, setCookie_1.setCookie)(name, "", tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, cookie_1.defaultAttributesClient), attributes), { expires: -1 }));
10
- }
11
- exports.removeCookie = removeCookie;
12
- exports.default = removeCookie;
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,2 +0,0 @@
1
- export declare function removeDuplicatesByKey<T extends Record<string | number | symbol, any>>(array: T[] | undefined, key: keyof T): T[];
2
- export default removeDuplicatesByKey;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeDuplicatesByKey = void 0;
4
- function removeDuplicatesByKey(array, key) {
5
- if (array === void 0) { array = []; }
6
- var keysMap = {};
7
- var output = [];
8
- for (var i = 0; i < array.length; i++) {
9
- var item = array[i];
10
- if (!keysMap[item[key]]) {
11
- output.push(item);
12
- keysMap[item[key]] = true;
13
- }
14
- }
15
- return output;
16
- }
17
- exports.removeDuplicatesByKey = removeDuplicatesByKey;
18
- exports.default = removeDuplicatesByKey;
@@ -1,2 +0,0 @@
1
- export declare function removeDuplicatesComparing<T>(from: any[], to: T[]): T[];
2
- export default removeDuplicatesComparing;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeDuplicatesComparing = void 0;
4
- var findDuplicatedIndexes_1 = require("./findDuplicatedIndexes");
5
- var removeIndexesFromArray_1 = require("./removeIndexesFromArray");
6
- function removeDuplicatesComparing(from, to) {
7
- var indexes = (0, findDuplicatedIndexes_1.findDuplicatedIndexes)(from);
8
- return (0, removeIndexesFromArray_1.removeIndexesFromArray)(to, indexes);
9
- }
10
- exports.removeDuplicatesComparing = removeDuplicatesComparing;
11
- exports.default = removeDuplicatesComparing;
@@ -1,2 +0,0 @@
1
- export declare function removeIndexesFromArray<T>(arr: T[], indexes: Record<number, true>): T[];
2
- export default removeIndexesFromArray;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeIndexesFromArray = void 0;
4
- function removeIndexesFromArray(arr, indexes) {
5
- var output = [];
6
- for (var i = 0; i < arr.length; i++) {
7
- if (!indexes.hasOwnProperty(i)) {
8
- output.push(arr[i]);
9
- }
10
- }
11
- return output;
12
- }
13
- exports.removeIndexesFromArray = removeIndexesFromArray;
14
- exports.default = removeIndexesFromArray;
@@ -1,2 +0,0 @@
1
- export declare function removeTralingSlash(urlLike?: string): string;
2
- export default removeTralingSlash;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeTralingSlash = void 0;
4
- function removeTralingSlash(urlLike) {
5
- if (urlLike === void 0) { urlLike = ""; }
6
- return urlLike.replace(/\/*$/, "");
7
- }
8
- exports.removeTralingSlash = removeTralingSlash;
9
- exports.default = removeTralingSlash;
@@ -1,2 +0,0 @@
1
- export declare function removeUrlQueryParams(url: string, paramsToRemove?: string[]): string;
2
- export default removeUrlQueryParams;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeUrlQueryParams = void 0;
4
- var buildUrlQueryString_1 = require("./buildUrlQueryString");
5
- var getUrlQueryParams_1 = require("./getUrlQueryParams");
6
- function removeUrlQueryParams(url, paramsToRemove) {
7
- if (paramsToRemove === void 0) { paramsToRemove = []; }
8
- var parts = url.split("?");
9
- var allParams = (0, getUrlQueryParams_1.default)(url);
10
- var params = {};
11
- for (var key in allParams) {
12
- if (!paramsToRemove.includes(key)) {
13
- params[key] = allParams[key];
14
- }
15
- }
16
- return parts[0] + (0, buildUrlQueryString_1.default)(params);
17
- }
18
- exports.removeUrlQueryParams = removeUrlQueryParams;
19
- exports.default = removeUrlQueryParams;
package/cjs/render.d.ts DELETED
@@ -1,13 +0,0 @@
1
- type DefinitionExtended = {
2
- __exp?: {
3
- [key: string]: number | boolean | string;
4
- };
5
- arg: string;
6
- text: string;
7
- };
8
- type Definitions = {
9
- [key: string]: DefinitionExtended;
10
- } & DefinitionExtended;
11
- type RenderFunction = (data: object) => string;
12
- export declare const render: (tmpl: string, def?: Definitions) => RenderFunction;
13
- export default render;
package/cjs/render.js DELETED
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.render = void 0;
4
- var varname = "data";
5
- var evaluate = /<%([\s\S]+?(\}?)+)%>/g;
6
- var interpolate = /<%=([\s\S]+?)%>/g;
7
- var conditional = /<%\?(\?)?\s*([\s\S]*?)\s*%>/g;
8
- var iterate = /<%~\s*(?:%>|([\s\S]+?)\s*:\s*([\w$]+)\s*(?::\s*([\w$]+))?\s*%>)/g;
9
- var use = /<%#([\s\S]+?)%>/g;
10
- var useParams = /(^|[^\w$])def(?:\.|\[['"])([\w$.]+)(?:['"]\])?\s*:\s*([\w$.]+|"[^"]+"|'[^']+'|\{[^}]+\})/g;
11
- var define = /<%##\s*([\w.$]+)\s*(:|=)([\s\S]+?)#%>/g;
12
- var defineParams = /^\s*([\w$]+):([\s\S]+)/;
13
- var start = "'+(";
14
- var end = ")+'";
15
- var skip = /$^/;
16
- var resolveDefs = function (block, def) {
17
- return (typeof block === "string" ? block : block.toString())
18
- .replace(define || skip, function (_, code, assign, value) {
19
- if (code.indexOf("def.") === 0) {
20
- code = code.substring(4);
21
- }
22
- if (!(code in def)) {
23
- if (assign === ":") {
24
- value.replace(defineParams, function (_, param, v) {
25
- def[code] = { arg: param, text: v };
26
- });
27
- if (!(code in def))
28
- def[code] = value;
29
- }
30
- else {
31
- new Function("def", "def['" + code + "']=" + value)(def);
32
- }
33
- }
34
- return "";
35
- })
36
- .replace(use || skip, function (_, code) {
37
- code = code.replace(useParams, function (_, s, d, param) {
38
- if (def[d] && def[d].arg && param) {
39
- var rw = (d + ":" + param).replace(/'|\\/g, "_");
40
- def.__exp = def.__exp || {};
41
- def.__exp[rw] = def[d].text.replace(new RegExp("(^|[^\\w$])" + def[d].arg + "([^\\w$])", "g"), "$1" + param + "$2");
42
- return s + "def.__exp['" + rw + "']";
43
- }
44
- return s;
45
- });
46
- var v = new Function("def", "return " + code)(def);
47
- return v ? resolveDefs(v, def) : v;
48
- });
49
- };
50
- var unescape = function (code) {
51
- return code.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, " ");
52
- };
53
- var render = function (tmpl, def) {
54
- var sid = 0;
55
- var indv;
56
- var str = use || define ? resolveDefs(tmpl, def || {}) : tmpl;
57
- str = ("var X='" +
58
- str
59
- .replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, " ")
60
- .replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, "")
61
- .replace(/'|\\/g, "\\$&")
62
- .replace(interpolate || skip, function (_, code) { return start + unescape(code) + end; })
63
- .replace(conditional || skip, function (_, elseCase, code) {
64
- return elseCase
65
- ? code
66
- ? "';}else if(" + unescape(code) + "){X+='"
67
- : "';}else{X+='"
68
- : code
69
- ? "';if(" + unescape(code) + "){X+='"
70
- : "';}X+='";
71
- })
72
- .replace(iterate || skip, function (_, arr, vName, iName) {
73
- if (!arr)
74
- return "';} } X+='";
75
- sid++;
76
- indv = iName || "i" + sid;
77
- arr = unescape(arr);
78
- return ("';var arr" +
79
- sid +
80
- "=" +
81
- arr +
82
- ";if(arr" +
83
- sid +
84
- "){var " +
85
- vName +
86
- "," +
87
- indv +
88
- "=-1,l" +
89
- sid +
90
- "=arr" +
91
- sid +
92
- ".length-1;while(" +
93
- indv +
94
- "<l" +
95
- sid +
96
- "){" +
97
- vName +
98
- "=arr" +
99
- sid +
100
- "[" +
101
- indv +
102
- "+=1];X+='");
103
- })
104
- .replace(evaluate || skip, function (_, code) { return "';" + unescape(code) + "X+='"; }) +
105
- "';return X;")
106
- .replace(/\n/g, "\\n")
107
- .replace(/\t/g, "\\t")
108
- .replace(/\r/g, "\\r")
109
- .replace(/(\s|;|\}|^|\{)X\+='';/g, "$1")
110
- .replace(/\+''/g, "");
111
- try {
112
- return new Function(varname, str);
113
- }
114
- catch (e) {
115
- if (process.env["NODE_ENV"] === "development") {
116
- console.log("Could not create a template function: " + str);
117
- throw e;
118
- }
119
- }
120
- return function () { return ""; };
121
- };
122
- exports.render = render;
123
- exports.default = exports.render;
package/cjs/round.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { AnythingFalsy } from "./types";
2
- export declare const round: (number: number, decimals?: AnythingFalsy | number, trailingZeroes?: 1 | boolean | AnythingFalsy) => number;
3
- export default round;
package/cjs/round.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.round = void 0;
4
- var round = function (number, decimals, trailingZeroes) {
5
- return decimals
6
- ? parseFloat(number.toFixed(decimals).replace(trailingZeroes ? "" : /\.+0*$/, ""))
7
- : parseInt(number + "", 10);
8
- };
9
- exports.round = round;
10
- exports.default = exports.round;
package/cjs/roundTo.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function roundTo(num: number, decimals?: number): string;
2
- export default roundTo;
package/cjs/roundTo.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.roundTo = void 0;
4
- function roundTo(num, decimals) {
5
- if (decimals === void 0) { decimals = 2; }
6
- if (isFinite(num) && !isNaN(num)) {
7
- var multiplicator = Math.pow(10, decimals);
8
- return Math.round(num * multiplicator) / multiplicator + "";
9
- }
10
- if (process.env["NODE_ENV"] === "development") {
11
- console.warn("[@koine/utils] math:roundTo -> given not a finite number as first arg");
12
- }
13
- return "";
14
- }
15
- exports.roundTo = roundTo;
16
- exports.default = roundTo;
@@ -1,3 +0,0 @@
1
- import { type CookieAttributesServer } from "./cookie";
2
- export declare function serializeCookie(name: string, val: string, attributes?: CookieAttributesServer): string;
3
- export default serializeCookie;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeCookie = void 0;
4
- var isNumber_1 = require("./isNumber");
5
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
6
- function serializeCookie(name, val, attributes) {
7
- if (attributes === void 0) { attributes = {}; }
8
- var _a = attributes.encode, encode = _a === void 0 ? encodeURIComponent : _a, domain = attributes.domain, path = attributes.path, httpOnly = attributes.httpOnly, secure = attributes.secure, sameSite = attributes.sameSite;
9
- var maxAge = attributes.maxAge, expires = attributes.expires;
10
- var value = encode(val);
11
- if (process.env["NODE_ENV"] === "development") {
12
- if (!fieldContentRegExp.test(name)) {
13
- throw new TypeError("argument name is invalid");
14
- }
15
- if (typeof attributes.encode !== "function") {
16
- throw new TypeError("option encode is invalid");
17
- }
18
- if (value && !fieldContentRegExp.test(value)) {
19
- throw new TypeError("argument val is invalid");
20
- }
21
- }
22
- var str = name + "=" + value;
23
- if (null != maxAge) {
24
- maxAge = maxAge - 0;
25
- if (isNaN(maxAge) || !isFinite(maxAge)) {
26
- throw new TypeError("option maxAge is invalid");
27
- }
28
- str += "; Max-Age=" + Math.floor(maxAge);
29
- }
30
- if (domain) {
31
- if (process.env["NODE_ENV"] === "development") {
32
- if (!fieldContentRegExp.test(domain)) {
33
- throw new TypeError("option domain is invalid");
34
- }
35
- }
36
- str += "; Domain=" + domain;
37
- }
38
- if (path) {
39
- if (process.env["NODE_ENV"] === "development") {
40
- if (!fieldContentRegExp.test(path)) {
41
- throw new TypeError("option path is invalid");
42
- }
43
- }
44
- str += "; Path=" + path;
45
- }
46
- if (expires) {
47
- if ((0, isNumber_1.isNumber)(expires)) {
48
- expires = new Date(Date.now() + expires * 864e5);
49
- }
50
- str += "; Expires=" + expires.toUTCString();
51
- }
52
- if (httpOnly) {
53
- str += "; HttpOnly";
54
- }
55
- if (secure) {
56
- str += "; Secure";
57
- }
58
- if (sameSite) {
59
- switch (sameSite.toLowerCase()) {
60
- case "lax":
61
- str += "; SameSite=Lax";
62
- break;
63
- case "strict":
64
- str += "; SameSite=Strict";
65
- break;
66
- case "none":
67
- str += "; SameSite=None";
68
- break;
69
- }
70
- }
71
- return str;
72
- }
73
- exports.serializeCookie = serializeCookie;
74
- exports.default = serializeCookie;
@@ -1,3 +0,0 @@
1
- import { type CookieAttributesClient } from "./cookie";
2
- export declare function setCookie<T extends string = string>(name: string, value: string | T, attributes?: CookieAttributesClient): string | undefined;
3
- export default setCookie;
package/cjs/setCookie.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setCookie = void 0;
4
- var tslib_1 = require("tslib");
5
- var cookie_1 = require("./cookie");
6
- var isNumber_1 = require("./isNumber");
7
- var isUndefined_1 = require("./isUndefined");
8
- function converterWrite(value) {
9
- return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
10
- }
11
- function setCookie(name, value, attributes) {
12
- if (attributes === void 0) { attributes = {}; }
13
- var expires = attributes.expires, restAttrs = tslib_1.__rest(attributes, ["expires"]);
14
- var cleanedAttrs = tslib_1.__assign(tslib_1.__assign({ expires: "" }, cookie_1.defaultAttributesClient), restAttrs);
15
- if ((0, isUndefined_1.default)(document)) {
16
- if (process.env["NODE_ENV"] === "development") {
17
- console.warn("[@koine/utils:setCookie] document is undefined");
18
- }
19
- return undefined;
20
- }
21
- if ((0, isNumber_1.default)(expires)) {
22
- expires = new Date(Date.now() + expires * 864e5);
23
- }
24
- if (expires) {
25
- cleanedAttrs.expires = expires.toUTCString();
26
- }
27
- name = encodeURIComponent(name)
28
- .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
29
- .replace(/[()]/g, escape);
30
- var stringifiedAttributes = "";
31
- for (var name_1 in attributes) {
32
- var attrName = name_1;
33
- if (!attributes[attrName]) {
34
- continue;
35
- }
36
- stringifiedAttributes += "; " + attrName;
37
- if (attributes[attrName] === true) {
38
- continue;
39
- }
40
- stringifiedAttributes +=
41
- "=" + String(attributes[attrName]).split(";")[0];
42
- }
43
- return (document.cookie =
44
- name + "=" + converterWrite(value) + stringifiedAttributes);
45
- }
46
- exports.setCookie = setCookie;
47
- exports.default = setCookie;
package/cjs/shuffle.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function shuffle<T>(array: T[]): T[];
2
- export default shuffle;
package/cjs/shuffle.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shuffle = void 0;
4
- var tslib_1 = require("tslib");
5
- function shuffle(array) {
6
- var length = array == null ? 0 : array.length;
7
- if (!length) {
8
- return [];
9
- }
10
- var index = -1;
11
- var lastIndex = length - 1;
12
- var result = tslib_1.__spreadArray([], tslib_1.__read(array), false);
13
- while (++index < length) {
14
- var rand = index + Math.floor(Math.random() * (lastIndex - index + 1));
15
- var value = result[rand];
16
- result[rand] = result[index];
17
- result[index] = value;
18
- }
19
- return result;
20
- }
21
- exports.shuffle = shuffle;
22
- exports.default = shuffle;
package/cjs/slugify.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function slugify(text: string, separator?: string): string;
2
- export default slugify;
package/cjs/slugify.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.slugify = void 0;
4
- var accentSets_1 = require("./accentSets");
5
- var removeAccents_1 = require("./removeAccents");
6
- function slugify(text, separator) {
7
- if (separator === void 0) { separator = "-"; }
8
- return (0, removeAccents_1.removeAccents)(text.toString().toLowerCase().trim(), accentSets_1.accentsSets.concat([["-", "[·/_,:;']"]]))
9
- .replace(/\s+/g, "-")
10
- .replace(/&/g, "-and-")
11
- .replace(/[^\w-]+/g, "")
12
- .replace(/--+/g, "-")
13
- .replace(/^-+/, "")
14
- .replace(/-+$/, "")
15
- .replace(/-/g, separator);
16
- }
17
- exports.slugify = slugify;
18
- exports.default = slugify;
package/cjs/split.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export type Split<S extends string, D extends string> = string extends S ? string[] : S extends "" ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
2
- export declare const split: <T extends string, D extends string>(string: T, delimiter: D) => Split<T, D>;
3
- export default split;
package/cjs/split.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.split = void 0;
4
- var split = function (string, delimiter) { return string.split(delimiter); };
5
- exports.split = split;
6
- exports.default = exports.split;
package/cjs/swapMap.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function swapMap<T extends Record<string, string | number | symbol> = Record<string, string | number | symbol>>(map?: T): Record<T[keyof T], keyof T>;
2
- export default swapMap;
package/cjs/swapMap.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.swapMap = void 0;
4
- function swapMap(map) {
5
- if (map === void 0) { map = {}; }
6
- var output = {};
7
- for (var key in map) {
8
- output[map[key]] = key;
9
- }
10
- return output;
11
- }
12
- exports.swapMap = swapMap;
13
- exports.default = swapMap;
package/cjs/throttle.d.ts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference types="node" />
2
- export declare function throttle<TFn extends Function, TContext>(fn: TFn, limit: number, context?: TContext): (this: TContext, ...args: any[]) => NodeJS.Timeout | undefined;
3
- export default throttle;
package/cjs/throttle.js DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.throttle = void 0;
4
- var tslib_1 = require("tslib");
5
- function throttle(fn, limit, context) {
6
- var wait;
7
- return function () {
8
- var args = [];
9
- for (var _i = 0; _i < arguments.length; _i++) {
10
- args[_i] = arguments[_i];
11
- }
12
- context = context || this;
13
- if (!wait) {
14
- fn.apply.apply(fn, tslib_1.__spreadArray([context], tslib_1.__read(args), false));
15
- wait = true;
16
- return setTimeout(function () {
17
- wait = false;
18
- }, limit);
19
- }
20
- return;
21
- };
22
- }
23
- exports.throttle = throttle;
24
- exports.default = throttle;
@@ -1,2 +0,0 @@
1
- export declare const titleCase: (input?: null | string) => string;
2
- export default titleCase;
package/cjs/titleCase.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.titleCase = void 0;
4
- var titleCase = function (input) {
5
- return input
6
- ? input.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase(); })
7
- : "";
8
- };
9
- exports.titleCase = titleCase;
10
- exports.default = exports.titleCase;
package/cjs/toNumber.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function toNumber(input?: string | number, fallback?: number): number;
2
- export default toNumber;
package/cjs/toNumber.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toNumber = void 0;
4
- var isNumber_1 = require("./isNumber");
5
- function toNumber(input, fallback) {
6
- return (0, isNumber_1.isNumber)(input) ? input : input ? parseFloat(input) : fallback || 0;
7
- }
8
- exports.toNumber = toNumber;
9
- exports.default = toNumber;
package/cjs/toRgba.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function toRgba(hex: string, alpha?: number): string;
2
- export default toRgba;
package/cjs/toRgba.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toRgba = void 0;
4
- function toRgba(hex, alpha) {
5
- if (alpha === void 0) { alpha = 1; }
6
- var r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
7
- if (r) {
8
- return "rgba(".concat(parseInt(r[1], 16), ",").concat(parseInt(r[2], 16), ",").concat(parseInt(r[3], 16), ",").concat(alpha, ")");
9
- }
10
- return "";
11
- }
12
- exports.toRgba = toRgba;
13
- exports.default = toRgba;
@@ -1,2 +0,0 @@
1
- export declare function transformToUrlPathname(toPathname?: string): string;
2
- export default transformToUrlPathname;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformToUrlPathname = void 0;
4
- var isString_1 = require("./isString");
5
- function transformToUrlPathname(toPathname) {
6
- return (0, isString_1.default)(toPathname)
7
- ? "/".concat(encodeURIComponent(toPathname.replace(/\s/g, "-").toLowerCase()))
8
- : "";
9
- }
10
- exports.transformToUrlPathname = transformToUrlPathname;
11
- exports.default = transformToUrlPathname;
package/cjs/truncate.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const truncate: (input: undefined | null | string, length: number) => string;
2
- export default truncate;