@koine/utils 2.0.0-beta.72 → 2.0.0-beta.74

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 (333) hide show
  1. package/Defer.d.ts +1 -0
  2. package/Defer.js +11 -0
  3. package/Emitter.d.ts +1 -0
  4. package/Emitter.js +20 -0
  5. package/accentSets.d.ts +1 -0
  6. package/accentSets.js +30 -0
  7. package/addOrReplaceAtIdx.d.ts +1 -0
  8. package/addOrReplaceAtIdx.js +15 -0
  9. package/areEqual.d.ts +1 -1
  10. package/areEqual.js +46 -0
  11. package/arrayFilterFalsy.d.ts +1 -0
  12. package/arrayFilterFalsy.js +2 -0
  13. package/arrayFindLastIndex.d.ts +1 -0
  14. package/arrayFindLastIndex.js +9 -0
  15. package/arrayOfAll.d.ts +1 -0
  16. package/arrayOfAll.js +2 -0
  17. package/arraySum.d.ts +1 -0
  18. package/arraySum.js +2 -0
  19. package/arrayToLookup.d.ts +1 -0
  20. package/arrayToLookup.js +5 -0
  21. package/arrayUniqueByProperties.d.ts +1 -0
  22. package/arrayUniqueByProperties.js +2 -0
  23. package/buildUrlQueryString.d.ts +1 -0
  24. package/buildUrlQueryString.js +21 -0
  25. package/capitalize.d.ts +1 -0
  26. package/capitalize.js +3 -0
  27. package/changeCaseCamel.d.ts +1 -0
  28. package/changeCaseCamel.js +19 -0
  29. package/changeCaseCapital.d.ts +1 -0
  30. package/changeCaseCapital.js +12 -0
  31. package/changeCaseConstant.d.ts +1 -0
  32. package/changeCaseConstant.js +8 -0
  33. package/changeCaseDot.d.ts +1 -0
  34. package/changeCaseDot.js +3 -0
  35. package/changeCaseHelpers.d.ts +0 -5
  36. package/changeCaseHelpers.js +71 -0
  37. package/changeCaseKebab.d.ts +1 -0
  38. package/changeCaseKebab.js +3 -0
  39. package/changeCaseNone.d.ts +1 -0
  40. package/changeCaseNone.js +8 -0
  41. package/changeCasePascal.d.ts +1 -0
  42. package/changeCasePascal.js +11 -0
  43. package/changeCasePascalSnake.d.ts +1 -0
  44. package/changeCasePascalSnake.js +3 -0
  45. package/changeCasePath.d.ts +1 -0
  46. package/changeCasePath.js +3 -0
  47. package/changeCaseSentence.d.ts +1 -0
  48. package/changeCaseSentence.js +17 -0
  49. package/changeCaseSnake.d.ts +1 -0
  50. package/changeCaseSnake.js +3 -0
  51. package/changeCaseTrain.d.ts +1 -0
  52. package/changeCaseTrain.js +3 -0
  53. package/chunkByChunks.d.ts +1 -0
  54. package/chunkByChunks.js +32 -0
  55. package/chunkBySize.d.ts +1 -0
  56. package/chunkBySize.js +8 -0
  57. package/clamp.d.ts +1 -0
  58. package/clamp.js +2 -0
  59. package/clsx.d.ts +1 -1
  60. package/clsx.js +40 -0
  61. package/convertRange.d.ts +1 -0
  62. package/convertRange.js +2 -0
  63. package/cookie.d.ts +0 -3
  64. package/cookie.js +1 -0
  65. package/createPalette.d.ts +1 -1
  66. package/createPalette.js +12 -0
  67. package/debounce.d.ts +1 -0
  68. package/debounce.js +18 -0
  69. package/debouncePromise.d.ts +1 -0
  70. package/debouncePromise.js +52 -0
  71. package/debounceRaf.d.ts +1 -0
  72. package/debounceRaf.js +13 -0
  73. package/decode.d.ts +1 -0
  74. package/decode.js +2 -0
  75. package/encode.d.ts +1 -0
  76. package/encode.js +2 -0
  77. package/ensureInt.d.ts +1 -0
  78. package/ensureInt.js +2 -0
  79. package/env.js +1 -0
  80. package/errorToString.d.ts +1 -0
  81. package/errorToString.js +3 -0
  82. package/escapeRegExp.d.ts +1 -0
  83. package/escapeRegExp.js +2 -0
  84. package/findDuplicatedIndexes.d.ts +1 -0
  85. package/findDuplicatedIndexes.js +11 -0
  86. package/forin.d.ts +1 -0
  87. package/forin.js +6 -0
  88. package/gbToBytes.d.ts +1 -0
  89. package/gbToBytes.js +2 -0
  90. package/getEmptyArray.d.ts +1 -0
  91. package/getEmptyArray.js +5 -0
  92. package/getKeys.d.ts +1 -0
  93. package/getKeys.js +2 -0
  94. package/getMediaQueryWidthResolvers.d.ts +1 -0
  95. package/getMediaQueryWidthResolvers.js +42 -0
  96. package/getMediaQueryWidthTailwindScreens.d.ts +1 -0
  97. package/getMediaQueryWidthTailwindScreens.js +27 -0
  98. package/getNonce.d.ts +1 -0
  99. package/getNonce.js +3 -0
  100. package/getParamAmong.d.ts +1 -0
  101. package/getParamAmong.js +6 -0
  102. package/getParamAsInt.d.ts +1 -0
  103. package/getParamAsInt.js +9 -0
  104. package/getParamAsString.d.ts +1 -0
  105. package/getParamAsString.js +3 -0
  106. package/getType.d.ts +1 -0
  107. package/getType.js +2 -0
  108. package/getUrlHashParams.d.ts +1 -0
  109. package/getUrlHashParams.js +9 -0
  110. package/getUrlHashPathname.d.ts +1 -0
  111. package/getUrlHashPathname.js +2 -0
  112. package/getUrlPathnameParts.d.ts +1 -0
  113. package/getUrlPathnameParts.js +6 -0
  114. package/getUrlQueryParams.d.ts +1 -0
  115. package/getUrlQueryParams.js +22 -0
  116. package/imgEmptyPixel.d.ts +1 -0
  117. package/imgEmptyPixel.js +2 -0
  118. package/index.cjs.js +69 -69
  119. package/index.d.ts +1 -1
  120. package/index.esm.js +69 -69
  121. package/index.js +156 -0
  122. package/invariant.d.ts +1 -0
  123. package/invariant.js +17 -0
  124. package/isAbsoluteUrl.d.ts +1 -0
  125. package/isAbsoluteUrl.js +3 -0
  126. package/isAnyObject.d.ts +1 -0
  127. package/isAnyObject.js +3 -0
  128. package/isArray.d.ts +1 -0
  129. package/isArray.js +3 -0
  130. package/isBlob.d.ts +1 -0
  131. package/isBlob.js +3 -0
  132. package/isBoolean.d.ts +1 -0
  133. package/isBoolean.js +3 -0
  134. package/isBrowser.d.ts +1 -0
  135. package/isBrowser.js +2 -0
  136. package/isBrowserNow.d.ts +1 -0
  137. package/isBrowserNow.js +3 -0
  138. package/isDate.d.ts +1 -0
  139. package/isDate.js +3 -0
  140. package/isEmptyArray.d.ts +1 -0
  141. package/isEmptyArray.js +3 -0
  142. package/isEmptyObject.d.ts +1 -0
  143. package/isEmptyObject.js +3 -0
  144. package/isEmptyString.d.ts +1 -0
  145. package/isEmptyString.js +2 -0
  146. package/isError.d.ts +1 -0
  147. package/isError.js +3 -0
  148. package/isExternalUrl.d.ts +1 -0
  149. package/isExternalUrl.js +11 -0
  150. package/isFile.d.ts +1 -0
  151. package/isFile.js +3 -0
  152. package/isFloat.d.ts +1 -0
  153. package/isFloat.js +3 -0
  154. package/isFormData.d.ts +1 -0
  155. package/isFormData.js +3 -0
  156. package/isFullArray.d.ts +1 -0
  157. package/isFullArray.js +3 -0
  158. package/isFullObject.d.ts +1 -0
  159. package/isFullObject.js +3 -0
  160. package/isFullString.d.ts +1 -0
  161. package/isFullString.js +3 -0
  162. package/isFunction.d.ts +1 -0
  163. package/isFunction.js +2 -0
  164. package/isInt.d.ts +1 -0
  165. package/isInt.js +3 -0
  166. package/isMap.d.ts +1 -0
  167. package/isMap.js +3 -0
  168. package/isNaNValue.d.ts +1 -0
  169. package/isNaNValue.js +3 -0
  170. package/isNegativeNumber.d.ts +1 -0
  171. package/isNegativeNumber.js +3 -0
  172. package/isNull.d.ts +1 -0
  173. package/isNull.js +3 -0
  174. package/isNullOrUndefined.d.ts +1 -0
  175. package/isNullOrUndefined.js +5 -0
  176. package/isNumber.d.ts +1 -0
  177. package/isNumber.js +3 -0
  178. package/isNumericLiteral.d.ts +1 -0
  179. package/isNumericLiteral.js +2 -0
  180. package/isObject.d.ts +1 -0
  181. package/isObject.js +3 -0
  182. package/isObjectLike.d.ts +1 -0
  183. package/isObjectLike.js +3 -0
  184. package/isObjectStringKeyed.d.ts +1 -0
  185. package/isObjectStringKeyed.js +3 -0
  186. package/isOneOf.d.ts +1 -0
  187. package/isOneOf.js +8 -0
  188. package/isPlainObject.d.ts +1 -0
  189. package/isPlainObject.js +6 -0
  190. package/isPositiveNumber.d.ts +1 -0
  191. package/isPositiveNumber.js +3 -0
  192. package/isPrimitive.d.ts +1 -0
  193. package/isPrimitive.js +13 -0
  194. package/isPromise.d.ts +1 -0
  195. package/isPromise.js +3 -0
  196. package/isRegExp.d.ts +1 -0
  197. package/isRegExp.js +3 -0
  198. package/isServer.d.ts +1 -0
  199. package/isServer.js +3 -0
  200. package/isServerNow.d.ts +1 -0
  201. package/isServerNow.js +3 -0
  202. package/isSet.d.ts +1 -0
  203. package/isSet.js +3 -0
  204. package/isString.d.ts +1 -0
  205. package/isString.js +3 -0
  206. package/isSymbol.d.ts +1 -0
  207. package/isSymbol.js +3 -0
  208. package/isType.d.ts +1 -0
  209. package/isType.js +13 -0
  210. package/isUndefined.d.ts +1 -0
  211. package/isUndefined.js +3 -0
  212. package/isWeakMap.d.ts +1 -0
  213. package/isWeakMap.js +3 -0
  214. package/isWeakSet.d.ts +1 -0
  215. package/isWeakSet.js +3 -0
  216. package/kbToBytes.d.ts +1 -0
  217. package/kbToBytes.js +2 -0
  218. package/location.js +1 -0
  219. package/lowercase.d.ts +1 -0
  220. package/lowercase.js +2 -0
  221. package/mapListBy.d.ts +1 -0
  222. package/mapListBy.js +5 -0
  223. package/matchSorter.d.ts +1 -0
  224. package/matchSorter.js +239 -0
  225. package/mbToBytes.d.ts +1 -0
  226. package/mbToBytes.js +2 -0
  227. package/mergeObjects.d.ts +1 -0
  228. package/mergeObjects.js +29 -0
  229. package/mergeUrlQueryParams.d.ts +1 -0
  230. package/mergeUrlQueryParams.js +14 -0
  231. package/moveSortableArrayItemByKey.d.ts +1 -0
  232. package/moveSortableArrayItemByKey.js +9 -0
  233. package/noop.d.ts +1 -0
  234. package/noop.js +2 -0
  235. package/normaliseUrl.d.ts +1 -0
  236. package/normaliseUrl.js +3 -0
  237. package/normaliseUrlPathname.d.ts +1 -0
  238. package/normaliseUrlPathname.js +3 -0
  239. package/objectFlat.d.ts +1 -0
  240. package/objectFlat.js +17 -0
  241. package/objectFlip.d.ts +1 -0
  242. package/objectFlip.js +5 -0
  243. package/objectMergeWithDefaults.d.ts +1 -0
  244. package/objectMergeWithDefaults.js +21 -0
  245. package/objectOmit.d.ts +1 -0
  246. package/objectOmit.js +8 -0
  247. package/objectPick.d.ts +1 -0
  248. package/objectPick.js +9 -0
  249. package/objectSort.d.ts +1 -0
  250. package/objectSort.js +2 -0
  251. package/objectSortByKeysMatching.d.ts +1 -0
  252. package/objectSortByKeysMatching.js +3 -0
  253. package/objectToArray.d.ts +1 -0
  254. package/objectToArray.js +2 -0
  255. package/package.json +1 -1
  256. package/parseCookie.d.ts +1 -0
  257. package/parseCookie.js +33 -0
  258. package/parseURL.d.ts +1 -0
  259. package/parseURL.js +14 -0
  260. package/quaranteneProps.d.ts +1 -1
  261. package/quaranteneProps.js +16 -0
  262. package/randomInt.d.ts +1 -0
  263. package/randomInt.js +2 -0
  264. package/randomKey.d.ts +1 -0
  265. package/randomKey.js +5 -0
  266. package/readCookie.d.ts +1 -0
  267. package/readCookie.js +34 -0
  268. package/removeAccents.d.ts +1 -0
  269. package/removeAccents.js +10 -0
  270. package/removeCookie.d.ts +1 -0
  271. package/removeCookie.js +10 -0
  272. package/removeDuplicates.d.ts +2 -0
  273. package/removeDuplicates.js +2 -0
  274. package/removeDuplicatesByKey.d.ts +1 -0
  275. package/removeDuplicatesByKey.js +13 -0
  276. package/removeDuplicatesComparing.d.ts +1 -0
  277. package/removeDuplicatesComparing.js +7 -0
  278. package/removeIndexesFromArray.d.ts +1 -0
  279. package/removeIndexesFromArray.js +10 -0
  280. package/removeTrailingSlash.d.ts +2 -1
  281. package/removeTrailingSlash.js +2 -0
  282. package/removeUrlQueryParams.d.ts +1 -0
  283. package/removeUrlQueryParams.js +14 -0
  284. package/render.d.ts +1 -1
  285. package/render.js +113 -0
  286. package/round.d.ts +1 -0
  287. package/round.js +4 -0
  288. package/roundTo.d.ts +1 -0
  289. package/roundTo.js +11 -0
  290. package/serializeCookie.d.ts +1 -0
  291. package/serializeCookie.js +69 -0
  292. package/setCookie.d.ts +1 -0
  293. package/setCookie.js +45 -0
  294. package/shuffle.d.ts +1 -0
  295. package/shuffle.js +17 -0
  296. package/slugify.d.ts +1 -0
  297. package/slugify.js +11 -0
  298. package/split.d.ts +1 -0
  299. package/split.js +2 -0
  300. package/splitReverse.d.ts +1 -0
  301. package/splitReverse.js +2 -0
  302. package/swapMap.d.ts +1 -0
  303. package/swapMap.js +8 -0
  304. package/throttle.d.ts +1 -0
  305. package/throttle.js +15 -0
  306. package/titleCase.d.ts +1 -0
  307. package/titleCase.js +4 -0
  308. package/toNumber.d.ts +1 -0
  309. package/toNumber.js +3 -0
  310. package/toRgba.d.ts +1 -0
  311. package/toRgba.js +8 -0
  312. package/transformToUrlPathname.d.ts +1 -0
  313. package/transformToUrlPathname.js +5 -0
  314. package/truncate.d.ts +1 -0
  315. package/truncate.js +6 -0
  316. package/tryUntil.d.ts +1 -0
  317. package/tryUntil.js +15 -0
  318. package/types.js +1 -0
  319. package/uid.d.ts +1 -0
  320. package/uid.js +6 -0
  321. package/updateLinkParams.d.ts +1 -0
  322. package/updateLinkParams.js +7 -0
  323. package/updateUrlQueryParams.d.ts +1 -0
  324. package/updateUrlQueryParams.js +11 -0
  325. package/uppercase.d.ts +1 -0
  326. package/uppercase.js +2 -0
  327. package/uuid.d.ts +1 -0
  328. package/uuid.js +5 -0
  329. package/uuidNumeric.d.ts +1 -0
  330. package/uuidNumeric.js +2 -0
  331. package/wait.d.ts +1 -0
  332. package/wait.js +2 -0
  333. package/without.js +1 -0
package/isArray.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isArray: (payload: any) => payload is any[];
2
+ export default isArray;
package/isArray.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isArray = (payload) => getType(payload) === "Array";
3
+ export default isArray;
package/isBlob.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isBlob: (payload: any) => payload is Blob;
2
+ export default isBlob;
package/isBlob.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isBlob = (payload) => getType(payload) === "Blob";
3
+ export default isBlob;
package/isBoolean.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isBoolean: (payload: any) => payload is boolean;
2
+ export default isBoolean;
package/isBoolean.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isBoolean = (payload) => getType(payload) === "Boolean";
3
+ export default isBoolean;
package/isBrowser.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isBrowser: boolean;
2
+ export default isBrowser;
package/isBrowser.js ADDED
@@ -0,0 +1,2 @@
1
+ export let isBrowser = typeof window !== "undefined";
2
+ export default isBrowser;
package/isBrowserNow.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isBrowserNow: () => boolean;
2
+ export default isBrowserNow;
@@ -0,0 +1,3 @@
1
+ import { isUndefined } from "./isUndefined";
2
+ export let isBrowserNow = () => !isUndefined(window);
3
+ export default isBrowserNow;
package/isDate.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isDate: (payload: any) => payload is Date;
2
+ export default isDate;
package/isDate.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isDate = (payload) => getType(payload) === "Date" && !isNaN(payload);
3
+ export default isDate;
package/isEmptyArray.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isEmptyArray: (payload: any) => payload is [];
2
+ export default isEmptyArray;
@@ -0,0 +1,3 @@
1
+ import { isArray } from "./isArray";
2
+ export let isEmptyArray = (payload) => isArray(payload) && payload.length === 0;
3
+ export default isEmptyArray;
@@ -3,3 +3,4 @@ export declare let isEmptyObject: (payload: any) => payload is {
3
3
  [x: number]: never;
4
4
  [x: symbol]: never;
5
5
  };
6
+ export default isEmptyObject;
@@ -0,0 +1,3 @@
1
+ import { isPlainObject } from "./isPlainObject";
2
+ export let isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
3
+ export default isEmptyObject;
@@ -1 +1,2 @@
1
1
  export declare let isEmptyString: (payload: any) => payload is string;
2
+ export default isEmptyString;
@@ -0,0 +1,2 @@
1
+ export let isEmptyString = (payload) => payload === "";
2
+ export default isEmptyString;
package/isError.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isError: (payload: any) => payload is Error;
2
+ export default isError;
package/isError.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isError = (payload) => getType(payload) === "Error";
3
+ export default isError;
@@ -1 +1,2 @@
1
1
  export declare let isExternalUrl: (url: string, currentUrl?: string) => boolean;
2
+ export default isExternalUrl;
@@ -0,0 +1,11 @@
1
+ import { isBrowser } from "./isBrowser";
2
+ export let isExternalUrl = (url, currentUrl) => {
3
+ const reg = /https?:\/\/((?:[\w\d-]+\.)+[\w\d]{2,})/i;
4
+ const urlMatches = reg.exec(url);
5
+ if (!urlMatches) {
6
+ return false;
7
+ }
8
+ currentUrl = currentUrl || isBrowser ? location.href : "";
9
+ return currentUrl ? reg.exec(currentUrl)?.[1] !== urlMatches[1] : true;
10
+ };
11
+ export default isExternalUrl;
package/isFile.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isFile: (payload: any) => payload is File;
2
+ export default isFile;
package/isFile.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isFile = (payload) => getType(payload) === "File";
3
+ export default isFile;
package/isFloat.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isFloat: (payload: any) => payload is number;
2
+ export default isFloat;
package/isFloat.js ADDED
@@ -0,0 +1,3 @@
1
+ import { isNumber } from "./isNumber";
2
+ export let isFloat = (payload) => isNumber(payload) && payload % 1 !== 0;
3
+ export default isFloat;
package/isFormData.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isFormData: (payload: any) => payload is FormData;
2
+ export default isFormData;
package/isFormData.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isFormData = (payload) => getType(payload) === "FormData";
3
+ export default isFormData;
package/isFullArray.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isFullArray: (payload: any) => payload is any[];
2
+ export default isFullArray;
package/isFullArray.js ADDED
@@ -0,0 +1,3 @@
1
+ import { isArray } from "./isArray";
2
+ export let isFullArray = (payload) => isArray(payload) && payload.length > 0;
3
+ export default isFullArray;
package/isFullObject.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { PlainObject } from "./getType";
2
2
  export declare let isFullObject: (payload: any) => payload is PlainObject;
3
+ export default isFullObject;
@@ -0,0 +1,3 @@
1
+ import { isPlainObject } from "./isPlainObject";
2
+ export let isFullObject = (payload) => isPlainObject(payload) && Object.keys(payload).length > 0;
3
+ export default isFullObject;
package/isFullString.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isFullString: (payload: any) => payload is string;
2
+ export default isFullString;
@@ -0,0 +1,3 @@
1
+ import { isString } from "./isString";
2
+ export let isFullString = (payload) => isString(payload) && payload !== "";
3
+ export default isFullString;
package/isFunction.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { AnyFunction } from "./getType";
2
2
  export declare let isFunction: (payload: any) => payload is AnyFunction;
3
+ export default isFunction;
package/isFunction.js ADDED
@@ -0,0 +1,2 @@
1
+ export let isFunction = (payload) => typeof payload === "function";
2
+ export default isFunction;
package/isInt.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isInt: (payload: any) => payload is number;
2
+ export default isInt;
package/isInt.js ADDED
@@ -0,0 +1,3 @@
1
+ import { isNumber } from "./isNumber";
2
+ export let isInt = (payload) => isNumber(payload) && payload % 1 === 0;
3
+ export default isInt;
package/isMap.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isMap: (payload: any) => payload is Map<any, any>;
2
+ export default isMap;
package/isMap.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isMap = (payload) => getType(payload) === "Map";
3
+ export default isMap;
package/isNaNValue.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isNaNValue: (payload: any) => payload is number;
2
+ export default isNaNValue;
package/isNaNValue.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isNaNValue = (payload) => getType(payload) === "Number" && isNaN(payload);
3
+ export default isNaNValue;
@@ -1 +1,2 @@
1
1
  export declare let isNegativeNumber: (payload: any) => payload is number;
2
+ export default isNegativeNumber;
@@ -0,0 +1,3 @@
1
+ import { isNumber } from "./isNumber";
2
+ export let isNegativeNumber = (payload) => isNumber(payload) && payload < 0;
3
+ export default isNegativeNumber;
package/isNull.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isNull: (payload: any) => payload is null;
2
+ export default isNull;
package/isNull.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isNull = (payload) => getType(payload) === "Null";
3
+ export default isNull;
@@ -1 +1,2 @@
1
1
  export declare let isNullOrUndefined: import("./getType").TypeGuard<any, null | undefined>;
2
+ export default isNullOrUndefined;
@@ -0,0 +1,5 @@
1
+ import { isNull } from "./isNull";
2
+ import { isOneOf } from "./isOneOf";
3
+ import { isUndefined } from "./isUndefined";
4
+ export let isNullOrUndefined = isOneOf(isNull, isUndefined);
5
+ export default isNullOrUndefined;
package/isNumber.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isNumber: (payload: any) => payload is number;
2
+ export default isNumber;
package/isNumber.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isNumber = (payload) => getType(payload) === "Number" && !isNaN(payload);
3
+ export default isNumber;
@@ -1 +1,2 @@
1
1
  export declare let isNumericLiteral: (payload: string) => payload is `${number}`;
2
+ export default isNumericLiteral;
@@ -0,0 +1,2 @@
1
+ export let isNumericLiteral = (payload) => /^[+-]?\d+(\.\d+)?$/.test(payload);
2
+ export default isNumericLiteral;
package/isObject.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { PlainObject } from "./getType";
2
2
  export declare let isObject: (payload: any) => payload is PlainObject;
3
+ export default isObject;
package/isObject.js ADDED
@@ -0,0 +1,3 @@
1
+ import { isPlainObject } from "./isPlainObject";
2
+ export let isObject = (payload) => isPlainObject(payload);
3
+ export default isObject;
package/isObjectLike.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { PlainObject } from "./getType";
2
2
  export declare let isObjectLike: <T extends PlainObject>(payload: any) => payload is T;
3
+ export default isObjectLike;
@@ -0,0 +1,3 @@
1
+ import { isAnyObject } from "./isAnyObject";
2
+ export let isObjectLike = (payload) => isAnyObject(payload);
3
+ export default isObjectLike;
@@ -1,2 +1,3 @@
1
1
  import type { PlainObjectStringKeyed } from "./getType";
2
2
  export declare let isObjectStringKeyed: (payload: any) => payload is PlainObjectStringKeyed;
3
+ export default isObjectStringKeyed;
@@ -0,0 +1,3 @@
1
+ import { isPlainObject } from "./isPlainObject";
2
+ export let isObjectStringKeyed = (payload) => isPlainObject(payload);
3
+ export default isObjectStringKeyed;
package/isOneOf.d.ts CHANGED
@@ -3,3 +3,4 @@ export declare function isOneOf<A, B extends A, C extends A>(a: TypeGuard<A, B>,
3
3
  export declare function isOneOf<A, B extends A, C extends A, D extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>): TypeGuard<A, B | C | D>;
4
4
  export declare function isOneOf<A, B extends A, C extends A, D extends A, E extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>, d: TypeGuard<A, E>): TypeGuard<A, B | C | D | E>;
5
5
  export declare function isOneOf<A, B extends A, C extends A, D extends A, E extends A, F extends A>(a: TypeGuard<A, B>, b: TypeGuard<A, C>, c: TypeGuard<A, D>, d: TypeGuard<A, E>, e: TypeGuard<A, F>): TypeGuard<A, B | C | D | E | F>;
6
+ export default isOneOf;
package/isOneOf.js ADDED
@@ -0,0 +1,8 @@
1
+ export function isOneOf(a, b, c, d, e) {
2
+ return (value) => a(value) ||
3
+ b(value) ||
4
+ (!!c && c(value)) ||
5
+ (!!d && d(value)) ||
6
+ (!!e && e(value));
7
+ }
8
+ export default isOneOf;
@@ -1,2 +1,3 @@
1
1
  import type { PlainObject } from "./getType";
2
2
  export declare let isPlainObject: <TReturn = PlainObject>(payload: any) => payload is TReturn;
3
+ export default isPlainObject;
@@ -0,0 +1,6 @@
1
+ import { getType } from "./getType";
2
+ export let isPlainObject = (payload) => getType(payload) !== "Object"
3
+ ? false
4
+ : payload.constructor === Object &&
5
+ Object.getPrototypeOf(payload) === Object.prototype;
6
+ export default isPlainObject;
@@ -1 +1,2 @@
1
1
  export declare let isPositiveNumber: (payload: any) => payload is number;
2
+ export default isPositiveNumber;
@@ -0,0 +1,3 @@
1
+ import { isNumber } from "./isNumber";
2
+ export let isPositiveNumber = (payload) => isNumber(payload) && payload > 0;
3
+ export default isPositiveNumber;
package/isPrimitive.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isPrimitive: (payload: any) => payload is string | number | boolean | symbol | null | undefined;
2
+ export default isPrimitive;
package/isPrimitive.js ADDED
@@ -0,0 +1,13 @@
1
+ import { isBoolean } from "./isBoolean";
2
+ import { isNull } from "./isNull";
3
+ import { isNumber } from "./isNumber";
4
+ import { isString } from "./isString";
5
+ import { isSymbol } from "./isSymbol";
6
+ import { isUndefined } from "./isUndefined";
7
+ export let isPrimitive = (payload) => isBoolean(payload) ||
8
+ isNull(payload) ||
9
+ isUndefined(payload) ||
10
+ isNumber(payload) ||
11
+ isString(payload) ||
12
+ isSymbol(payload);
13
+ export default isPrimitive;
package/isPromise.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isPromise: (payload: any) => payload is Promise<any>;
2
+ export default isPromise;
package/isPromise.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isPromise = (payload) => getType(payload) === "Promise";
3
+ export default isPromise;
package/isRegExp.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isRegExp: (payload: any) => payload is RegExp;
2
+ export default isRegExp;
package/isRegExp.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isRegExp = (payload) => getType(payload) === "RegExp";
3
+ export default isRegExp;
package/isServer.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isServer: boolean;
2
+ export default isServer;
package/isServer.js ADDED
@@ -0,0 +1,3 @@
1
+ import { isBrowser } from "./isBrowser";
2
+ export let isServer = !isBrowser;
3
+ export default isServer;
package/isServerNow.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isServerNow: () => boolean;
2
+ export default isServerNow;
package/isServerNow.js ADDED
@@ -0,0 +1,3 @@
1
+ import { isUndefined } from "./isUndefined";
2
+ export let isServerNow = () => isUndefined(window);
3
+ export default isServerNow;
package/isSet.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isSet: (payload: any) => payload is Set<any>;
2
+ export default isSet;
package/isSet.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isSet = (payload) => getType(payload) === "Set";
3
+ export default isSet;
package/isString.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isString: (payload: any) => payload is string;
2
+ export default isString;
package/isString.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isString = (payload) => getType(payload) === "String";
3
+ export default isString;
package/isSymbol.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isSymbol: (payload: any) => payload is symbol;
2
+ export default isSymbol;
package/isSymbol.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isSymbol = (payload) => getType(payload) === "Symbol";
3
+ export default isSymbol;
package/isType.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { AnyClass, AnyFunction } from "./getType";
2
2
  export declare let isType: <T extends AnyFunction | AnyClass>(payload: any, type: T) => payload is T;
3
+ export default isType;
package/isType.js ADDED
@@ -0,0 +1,13 @@
1
+ import { getType } from "./getType";
2
+ export let isType = (payload, type) => {
3
+ if (!(type instanceof Function)) {
4
+ throw new TypeError("Type must be a function");
5
+ }
6
+ if (!Object.prototype.hasOwnProperty.call(type, "prototype")) {
7
+ throw new TypeError("Type is not a class");
8
+ }
9
+ const name = type.name;
10
+ return (getType(payload) === name ||
11
+ Boolean(payload && payload.constructor === type));
12
+ };
13
+ export default isType;
package/isUndefined.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isUndefined: (payload: any) => payload is undefined;
2
+ export default isUndefined;
package/isUndefined.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isUndefined = (payload) => getType(payload) === "Undefined";
3
+ export default isUndefined;
package/isWeakMap.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isWeakMap: (payload: any) => payload is WeakMap<any, any>;
2
+ export default isWeakMap;
package/isWeakMap.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isWeakMap = (payload) => getType(payload) === "WeakMap";
3
+ export default isWeakMap;
package/isWeakSet.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let isWeakSet: (payload: any) => payload is WeakSet<any>;
2
+ export default isWeakSet;
package/isWeakSet.js ADDED
@@ -0,0 +1,3 @@
1
+ import { getType } from "./getType";
2
+ export let isWeakSet = (payload) => getType(payload) === "WeakSet";
3
+ export default isWeakSet;
package/kbToBytes.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let kbToBytes: (bytes: number) => number;
2
+ export default kbToBytes;
package/kbToBytes.js ADDED
@@ -0,0 +1,2 @@
1
+ export let kbToBytes = (bytes) => bytes * 1000;
2
+ export default kbToBytes;
package/location.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/lowercase.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let lowercase: <T extends string>(str?: T | null | undefined) => Lowercase<T>;
2
+ export default lowercase;
package/lowercase.js ADDED
@@ -0,0 +1,2 @@
1
+ export let lowercase = (str) => (str || "").toLowerCase();
2
+ export default lowercase;
package/mapListBy.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare let mapListBy: <T extends Record<string | number | symbol, any>>(array?: T[], key?: keyof T) => Record<T[keyof T], T>;
2
+ export default mapListBy;
package/mapListBy.js ADDED
@@ -0,0 +1,5 @@
1
+ export let mapListBy = (array = [], key = "") => array.reduce((obj, item) => {
2
+ obj[item[key]] = item;
3
+ return obj;
4
+ }, {});
5
+ export default mapListBy;
package/matchSorter.d.ts CHANGED
@@ -51,3 +51,4 @@ declare let defaultBaseSortFn: BaseSorter<unknown>;
51
51
  declare let matchSorter: <ItemType = string>(items: readonly ItemType[], value: string, options?: MatchSorterOptions<ItemType>) => ItemType[];
52
52
  export { matchSorter, defaultBaseSortFn };
53
53
  export type { MatchSorterOptions, KeyAttributesOptions, KeyOption, KeyAttributes, RankingInfo, ValueGetterKey, };
54
+ export default matchSorter;