@koine/utils 1.1.9 → 1.1.11

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 (340) hide show
  1. package/Defer.js +6 -2
  2. package/{node/Defer.js → Defer.mjs} +2 -6
  3. package/Emitter.js +6 -2
  4. package/{node/Emitter.js → Emitter.mjs} +2 -6
  5. package/accentSets.js +5 -2
  6. package/{node/accentSets.js → accentSets.mjs} +2 -5
  7. package/addOrReplaceAtIdx.js +8 -4
  8. package/addOrReplaceAtIdx.mjs +19 -0
  9. package/areEqual.js +10 -6
  10. package/{node/areEqual.js → areEqual.mjs} +6 -10
  11. package/arrayOfAll.d.ts +0 -2
  12. package/arrayOfAll.js +6 -4
  13. package/{node/arrayOfAll.js → arrayOfAll.mjs} +2 -8
  14. package/arraySum.js +6 -2
  15. package/arraySum.mjs +9 -0
  16. package/arrayToLookup.js +6 -2
  17. package/{node/arrayToLookup.js → arrayToLookup.mjs} +2 -6
  18. package/buildUrlQueryString.js +12 -7
  19. package/{node/buildUrlQueryString.js → buildUrlQueryString.mjs} +7 -12
  20. package/capitalize.js +6 -2
  21. package/{node/capitalize.js → capitalize.mjs} +2 -6
  22. package/changeUrlPath.js +11 -6
  23. package/changeUrlPath.mjs +18 -0
  24. package/chunkByChunks.js +6 -2
  25. package/{node/chunkByChunks.js → chunkByChunks.mjs} +2 -6
  26. package/chunkBySize.js +6 -2
  27. package/{node/chunkBySize.js → chunkBySize.mjs} +2 -6
  28. package/clamp.js +6 -2
  29. package/{node/clamp.js → clamp.mjs} +2 -6
  30. package/clsx.js +6 -2
  31. package/{node/clsx.js → clsx.mjs} +2 -6
  32. package/convertRange.js +6 -2
  33. package/{node/convertRange.js → convertRange.mjs} +2 -6
  34. package/cookie.js +4 -1
  35. package/{node/cookie.js → cookie.mjs} +1 -4
  36. package/debounce.js +6 -2
  37. package/{node/debounce.js → debounce.mjs} +2 -6
  38. package/debouncePromise.js +6 -3
  39. package/debouncePromise.mjs +9 -0
  40. package/debounceRaf.js +6 -2
  41. package/{node/debounceRaf.js → debounceRaf.mjs} +2 -6
  42. package/decode.js +6 -2
  43. package/{node/decode.js → decode.mjs} +2 -6
  44. package/encode.js +6 -2
  45. package/{node/encode.js → encode.mjs} +2 -6
  46. package/ensureInt.js +6 -2
  47. package/ensureInt.mjs +9 -0
  48. package/{node/env.js → env.mjs} +0 -0
  49. package/findDuplicatedIndexes.js +6 -2
  50. package/{node/findDuplicatedIndexes.js → findDuplicatedIndexes.mjs} +2 -6
  51. package/forin.js +6 -2
  52. package/forin.mjs +11 -0
  53. package/gbToBytes.js +6 -2
  54. package/gbToBytes.mjs +7 -0
  55. package/getEmptyArray.js +9 -4
  56. package/getEmptyArray.mjs +15 -0
  57. package/getKeys.js +5 -2
  58. package/{node/getKeys.js → getKeys.mjs} +2 -5
  59. package/getMediaQueryWidthResolvers.js +8 -4
  60. package/{node/getMediaQueryWidthResolvers.js → getMediaQueryWidthResolvers.mjs} +4 -8
  61. package/getMediaQueryWidthTailwindScreens.js +8 -4
  62. package/{node/getMediaQueryWidthTailwindScreens.js → getMediaQueryWidthTailwindScreens.mjs} +4 -8
  63. package/getNonce.js +8 -4
  64. package/getNonce.mjs +9 -0
  65. package/getParamAmong.js +9 -4
  66. package/{node/getParamAmong.js → getParamAmong.mjs} +4 -9
  67. package/getParamAsInt.js +9 -4
  68. package/{node/getParamAsInt.js → getParamAsInt.mjs} +4 -9
  69. package/getParamAsString.js +9 -4
  70. package/getParamAsString.mjs +14 -0
  71. package/getType.js +6 -2
  72. package/{node/getType.js → getType.mjs} +2 -6
  73. package/getUrlHashParams.js +6 -2
  74. package/{node/getUrlHashParams.js → getUrlHashParams.mjs} +2 -6
  75. package/getUrlHashPathname.js +6 -2
  76. package/{node/getUrlHashPathname.js → getUrlHashPathname.mjs} +2 -6
  77. package/getUrlPathnameParts.js +9 -4
  78. package/{node/getUrlPathnameParts.js → getUrlPathnameParts.mjs} +4 -9
  79. package/getUrlQueryParams.js +9 -4
  80. package/{node/getUrlQueryParams.js → getUrlQueryParams.mjs} +4 -9
  81. package/imgEmptyPixel.js +5 -2
  82. package/imgEmptyPixel.mjs +7 -0
  83. package/index.js +132 -129
  84. package/index.mjs +131 -0
  85. package/invariant.js +6 -2
  86. package/{node/invariant.js → invariant.mjs} +2 -6
  87. package/isAnyObject.js +9 -4
  88. package/isAnyObject.mjs +10 -0
  89. package/isArray.js +9 -4
  90. package/isArray.mjs +10 -0
  91. package/isBlob.js +9 -4
  92. package/isBlob.mjs +10 -0
  93. package/isBoolean.js +9 -4
  94. package/isBoolean.mjs +10 -0
  95. package/isBrowser.js +5 -2
  96. package/isBrowser.mjs +8 -0
  97. package/isDate.js +9 -4
  98. package/isDate.mjs +10 -0
  99. package/isEmptyArray.js +9 -4
  100. package/isEmptyArray.mjs +10 -0
  101. package/isEmptyObject.js +9 -4
  102. package/isEmptyObject.mjs +10 -0
  103. package/isEmptyString.js +6 -2
  104. package/isEmptyString.mjs +9 -0
  105. package/isError.js +9 -4
  106. package/isError.mjs +10 -0
  107. package/isExternalUrl.js +9 -4
  108. package/{node/isExternalUrl.js → isExternalUrl.mjs} +4 -9
  109. package/isFile.js +9 -4
  110. package/isFile.mjs +10 -0
  111. package/isFloat.js +9 -4
  112. package/isFloat.mjs +10 -0
  113. package/isFormData.js +9 -4
  114. package/isFormData.mjs +10 -0
  115. package/isFullArray.js +9 -4
  116. package/isFullArray.mjs +10 -0
  117. package/isFullObject.js +9 -4
  118. package/isFullObject.mjs +10 -0
  119. package/isFullString.js +9 -4
  120. package/isFullString.mjs +10 -0
  121. package/isFunction.js +6 -2
  122. package/isFunction.mjs +9 -0
  123. package/isInt.js +9 -4
  124. package/isInt.mjs +10 -0
  125. package/isMap.js +9 -4
  126. package/isMap.mjs +10 -0
  127. package/isNaNValue.js +9 -4
  128. package/isNaNValue.mjs +10 -0
  129. package/isNegativeNumber.js +9 -4
  130. package/isNegativeNumber.mjs +10 -0
  131. package/isNull.js +9 -4
  132. package/isNull.mjs +10 -0
  133. package/isNullOrUndefined.js +9 -5
  134. package/isNullOrUndefined.mjs +10 -0
  135. package/isNumber.js +9 -4
  136. package/isNumber.mjs +12 -0
  137. package/isObject.js +9 -4
  138. package/isObject.mjs +10 -0
  139. package/isObjectLike.js +9 -4
  140. package/isObjectLike.mjs +12 -0
  141. package/isOneOf.js +6 -2
  142. package/isOneOf.mjs +10 -0
  143. package/isPlainObject.js +9 -4
  144. package/isPlainObject.mjs +13 -0
  145. package/isPositiveNumber.js +9 -4
  146. package/isPositiveNumber.mjs +10 -0
  147. package/isPrimitive.js +19 -14
  148. package/isPrimitive.mjs +20 -0
  149. package/isPromise.js +9 -4
  150. package/isPromise.mjs +10 -0
  151. package/isRegExp.js +9 -4
  152. package/isRegExp.mjs +10 -0
  153. package/isServer.js +7 -3
  154. package/isServer.mjs +9 -0
  155. package/isSet.js +9 -4
  156. package/isSet.mjs +10 -0
  157. package/isString.js +9 -4
  158. package/isString.mjs +10 -0
  159. package/isSymbol.js +9 -4
  160. package/isSymbol.mjs +10 -0
  161. package/isType.js +9 -4
  162. package/{node/isType.js → isType.mjs} +4 -9
  163. package/isUndefined.js +9 -4
  164. package/isUndefined.mjs +10 -0
  165. package/isWeakMap.js +9 -4
  166. package/isWeakMap.mjs +10 -0
  167. package/isWeakSet.js +9 -4
  168. package/isWeakSet.mjs +10 -0
  169. package/kbToBytes.js +6 -2
  170. package/kbToBytes.mjs +7 -0
  171. package/location.js +2 -1
  172. package/location.mjs +1 -0
  173. package/lowercase.js +6 -2
  174. package/lowercase.mjs +9 -0
  175. package/mapListBy.js +6 -2
  176. package/{node/mapListBy.js → mapListBy.mjs} +2 -6
  177. package/matchSorter.js +11 -7
  178. package/{node/matchSorter.js → matchSorter.mjs} +7 -11
  179. package/mbToBytes.js +6 -2
  180. package/mbToBytes.mjs +7 -0
  181. package/mergeObjects.js +11 -7
  182. package/{node/mergeObjects.js → mergeObjects.mjs} +7 -11
  183. package/mergeUrlQueryParams.js +9 -4
  184. package/{node/mergeUrlQueryParams.js → mergeUrlQueryParams.mjs} +4 -9
  185. package/moveSortableArrayItemByKey.js +8 -4
  186. package/{node/moveSortableArrayItemByKey.js → moveSortableArrayItemByKey.mjs} +4 -8
  187. package/noop.js +6 -2
  188. package/noop.mjs +7 -0
  189. package/normaliseUrl.js +9 -4
  190. package/normaliseUrl.mjs +15 -0
  191. package/normaliseUrlPathname.js +9 -4
  192. package/normaliseUrlPathname.mjs +14 -0
  193. package/objectOmit.js +6 -2
  194. package/{node/objectOmit.js → objectOmit.mjs} +2 -6
  195. package/objectPick.js +6 -2
  196. package/{node/objectPick.js → objectPick.mjs} +2 -6
  197. package/package.json +4 -3
  198. package/parseCookie.js +6 -2
  199. package/{node/parseCookie.js → parseCookie.mjs} +2 -6
  200. package/parseURL.js +6 -2
  201. package/{node/parseURL.js → parseURL.mjs} +2 -6
  202. package/quaranteneProps.js +6 -2
  203. package/{node/quaranteneProps.js → quaranteneProps.mjs} +2 -6
  204. package/randomInt.js +6 -2
  205. package/randomInt.mjs +9 -0
  206. package/randomKey.js +6 -2
  207. package/{node/randomKey.js → randomKey.mjs} +2 -6
  208. package/readCookie.js +6 -2
  209. package/{node/readCookie.js → readCookie.mjs} +2 -6
  210. package/removeAccents.js +8 -4
  211. package/removeAccents.mjs +15 -0
  212. package/removeCookie.js +10 -6
  213. package/removeCookie.mjs +15 -0
  214. package/{node/removeDuplicates.js → removeDuplicates.mjs} +0 -0
  215. package/removeDuplicatesByKey.js +6 -2
  216. package/{node/removeDuplicatesByKey.js → removeDuplicatesByKey.mjs} +2 -6
  217. package/removeDuplicatesComparing.js +10 -6
  218. package/removeDuplicatesComparing.mjs +10 -0
  219. package/removeIndexesFromArray.js +6 -2
  220. package/removeIndexesFromArray.mjs +14 -0
  221. package/removeTrailingSlash.js +6 -2
  222. package/removeTrailingSlash.mjs +10 -0
  223. package/removeUrlQueryParams.js +11 -6
  224. package/removeUrlQueryParams.mjs +21 -0
  225. package/roundTo.js +6 -2
  226. package/{node/roundTo.js → roundTo.mjs} +2 -6
  227. package/serializeCookie.js +8 -4
  228. package/{node/serializeCookie.js → serializeCookie.mjs} +4 -8
  229. package/setCookie.js +14 -10
  230. package/{node/setCookie.js → setCookie.mjs} +10 -14
  231. package/shuffle.js +8 -4
  232. package/{node/shuffle.js → shuffle.mjs} +4 -8
  233. package/slugify.js +9 -5
  234. package/{node/slugify.js → slugify.mjs} +5 -9
  235. package/swapMap.js +6 -2
  236. package/{node/swapMap.js → swapMap.mjs} +2 -6
  237. package/throttle.js +8 -4
  238. package/{node/throttle.js → throttle.mjs} +4 -8
  239. package/titleCase.js +6 -2
  240. package/{node/titleCase.js → titleCase.mjs} +2 -6
  241. package/toNumber.js +8 -4
  242. package/toNumber.mjs +8 -0
  243. package/toRgba.js +6 -2
  244. package/{node/toRgba.js → toRgba.mjs} +2 -6
  245. package/transformToUrlPathname.js +9 -4
  246. package/transformToUrlPathname.mjs +16 -0
  247. package/truncate.js +6 -2
  248. package/truncate.mjs +13 -0
  249. package/tryUntil.js +6 -2
  250. package/{node/tryUntil.js → tryUntil.mjs} +2 -6
  251. package/types.js +2 -1
  252. package/types.mjs +1 -0
  253. package/uid.js +6 -2
  254. package/{node/uid.js → uid.mjs} +2 -6
  255. package/updateLinkParams.js +9 -4
  256. package/updateLinkParams.mjs +14 -0
  257. package/updateUrlQueryParams.js +12 -7
  258. package/updateUrlQueryParams.mjs +18 -0
  259. package/uppercase.js +6 -2
  260. package/uppercase.mjs +9 -0
  261. package/uuid.js +6 -2
  262. package/{node/uuid.js → uuid.mjs} +2 -6
  263. package/uuidNumeric.js +6 -2
  264. package/uuidNumeric.mjs +6 -0
  265. package/wait.js +6 -2
  266. package/wait.mjs +9 -0
  267. package/node/addOrReplaceAtIdx.js +0 -23
  268. package/node/arraySum.js +0 -13
  269. package/node/changeUrlPath.js +0 -23
  270. package/node/debouncePromise.js +0 -12
  271. package/node/ensureInt.js +0 -13
  272. package/node/forin.js +0 -15
  273. package/node/gbToBytes.js +0 -11
  274. package/node/getEmptyArray.js +0 -20
  275. package/node/getNonce.js +0 -13
  276. package/node/getParamAsString.js +0 -19
  277. package/node/imgEmptyPixel.js +0 -10
  278. package/node/index.js +0 -134
  279. package/node/isAnyObject.js +0 -15
  280. package/node/isArray.js +0 -15
  281. package/node/isBlob.js +0 -15
  282. package/node/isBoolean.js +0 -15
  283. package/node/isBrowser.js +0 -11
  284. package/node/isDate.js +0 -15
  285. package/node/isEmptyArray.js +0 -15
  286. package/node/isEmptyObject.js +0 -15
  287. package/node/isEmptyString.js +0 -13
  288. package/node/isError.js +0 -15
  289. package/node/isFile.js +0 -15
  290. package/node/isFloat.js +0 -15
  291. package/node/isFormData.js +0 -15
  292. package/node/isFullArray.js +0 -15
  293. package/node/isFullObject.js +0 -15
  294. package/node/isFullString.js +0 -15
  295. package/node/isFunction.js +0 -13
  296. package/node/isInt.js +0 -15
  297. package/node/isMap.js +0 -15
  298. package/node/isNaNValue.js +0 -15
  299. package/node/isNegativeNumber.js +0 -15
  300. package/node/isNull.js +0 -15
  301. package/node/isNullOrUndefined.js +0 -14
  302. package/node/isNumber.js +0 -17
  303. package/node/isObject.js +0 -15
  304. package/node/isObjectLike.js +0 -17
  305. package/node/isOneOf.js +0 -14
  306. package/node/isPlainObject.js +0 -18
  307. package/node/isPositiveNumber.js +0 -15
  308. package/node/isPrimitive.js +0 -25
  309. package/node/isPromise.js +0 -15
  310. package/node/isRegExp.js +0 -15
  311. package/node/isServer.js +0 -13
  312. package/node/isSet.js +0 -15
  313. package/node/isString.js +0 -15
  314. package/node/isSymbol.js +0 -15
  315. package/node/isUndefined.js +0 -15
  316. package/node/isWeakMap.js +0 -15
  317. package/node/isWeakSet.js +0 -15
  318. package/node/kbToBytes.js +0 -11
  319. package/node/location.js +0 -2
  320. package/node/lowercase.js +0 -13
  321. package/node/mbToBytes.js +0 -11
  322. package/node/noop.js +0 -11
  323. package/node/normaliseUrl.js +0 -20
  324. package/node/normaliseUrlPathname.js +0 -19
  325. package/node/randomInt.js +0 -13
  326. package/node/removeAccents.js +0 -19
  327. package/node/removeCookie.js +0 -19
  328. package/node/removeDuplicatesComparing.js +0 -14
  329. package/node/removeIndexesFromArray.js +0 -18
  330. package/node/removeTrailingSlash.js +0 -14
  331. package/node/removeUrlQueryParams.js +0 -26
  332. package/node/toNumber.js +0 -12
  333. package/node/transformToUrlPathname.js +0 -21
  334. package/node/truncate.js +0 -17
  335. package/node/types.js +0 -2
  336. package/node/updateLinkParams.js +0 -19
  337. package/node/updateUrlQueryParams.js +0 -23
  338. package/node/uppercase.js +0 -13
  339. package/node/uuidNumeric.js +0 -10
  340. package/node/wait.js +0 -13
package/isEmptyArray.js CHANGED
@@ -1,10 +1,15 @@
1
- import isArray from "./isArray";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmptyArray = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isArray_1 = tslib_1.__importDefault(require("./isArray"));
2
6
  /**
3
7
  * Returns whether the payload is a an empty array
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isEmptyArray(payload) {
8
- return isArray(payload) && payload.length === 0;
11
+ function isEmptyArray(payload) {
12
+ return (0, isArray_1.default)(payload) && payload.length === 0;
9
13
  }
10
- export default isEmptyArray;
14
+ exports.isEmptyArray = isEmptyArray;
15
+ exports.default = isEmptyArray;
@@ -0,0 +1,10 @@
1
+ import isArray from "./isArray";
2
+ /**
3
+ * Returns whether the payload is a an empty array
4
+ *
5
+ * @category is
6
+ */
7
+ export function isEmptyArray(payload) {
8
+ return isArray(payload) && payload.length === 0;
9
+ }
10
+ export default isEmptyArray;
package/isEmptyObject.js CHANGED
@@ -1,10 +1,15 @@
1
- import isPlainObject from "./isPlainObject";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmptyObject = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isPlainObject_1 = tslib_1.__importDefault(require("./isPlainObject"));
2
6
  /**
3
7
  * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isEmptyObject(payload) {
8
- return isPlainObject(payload) && Object.keys(payload).length === 0;
11
+ function isEmptyObject(payload) {
12
+ return (0, isPlainObject_1.default)(payload) && Object.keys(payload).length === 0;
9
13
  }
10
- export default isEmptyObject;
14
+ exports.isEmptyObject = isEmptyObject;
15
+ exports.default = isEmptyObject;
@@ -0,0 +1,10 @@
1
+ import isPlainObject from "./isPlainObject";
2
+ /**
3
+ * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
4
+ *
5
+ * @category is
6
+ */
7
+ export function isEmptyObject(payload) {
8
+ return isPlainObject(payload) && Object.keys(payload).length === 0;
9
+ }
10
+ export default isEmptyObject;
package/isEmptyString.js CHANGED
@@ -1,9 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmptyString = void 0;
1
4
  /**
2
5
  * Returns whether the payload is ''
3
6
  *
4
7
  * @category is
5
8
  */
6
- export function isEmptyString(payload) {
9
+ function isEmptyString(payload) {
7
10
  return payload === "";
8
11
  }
9
- export default isEmptyString;
12
+ exports.isEmptyString = isEmptyString;
13
+ exports.default = isEmptyString;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns whether the payload is ''
3
+ *
4
+ * @category is
5
+ */
6
+ export function isEmptyString(payload) {
7
+ return payload === "";
8
+ }
9
+ export default isEmptyString;
package/isError.js CHANGED
@@ -1,10 +1,15 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isError = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is an Error
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isError(payload) {
8
- return getType(payload) === "Error";
11
+ function isError(payload) {
12
+ return (0, getType_1.default)(payload) === "Error";
9
13
  }
10
- export default isError;
14
+ exports.isError = isError;
15
+ exports.default = isError;
package/isError.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is an Error
4
+ *
5
+ * @category is
6
+ */
7
+ export function isError(payload) {
8
+ return getType(payload) === "Error";
9
+ }
10
+ export default isError;
package/isExternalUrl.js CHANGED
@@ -1,4 +1,8 @@
1
- import isBrowser from "./isBrowser";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isExternalUrl = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isBrowser_1 = tslib_1.__importDefault(require("./isBrowser"));
2
6
  /**
3
7
  * Is external url compared to the given current URL (if not provided it falls
4
8
  * back to `location.href`)
@@ -6,7 +10,7 @@ import isBrowser from "./isBrowser";
6
10
  * @category location
7
11
  *
8
12
  */
9
- export function isExternalUrl(url, currentUrl) {
13
+ function isExternalUrl(url, currentUrl) {
10
14
  var _a;
11
15
  var reg = /https?:\/\/((?:[\w\d-]+\.)+[\w\d]{2,})/i;
12
16
  var urlMatches = reg.exec(url);
@@ -15,7 +19,8 @@ export function isExternalUrl(url, currentUrl) {
15
19
  if (!urlMatches) {
16
20
  return false;
17
21
  }
18
- currentUrl = currentUrl || isBrowser ? location.href : "";
22
+ currentUrl = currentUrl || isBrowser_1.default ? location.href : "";
19
23
  return currentUrl ? ((_a = reg.exec(currentUrl)) === null || _a === void 0 ? void 0 : _a[1]) !== urlMatches[1] : true;
20
24
  }
21
- export default isExternalUrl;
25
+ exports.isExternalUrl = isExternalUrl;
26
+ exports.default = isExternalUrl;
@@ -1,8 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isExternalUrl = void 0;
4
- var tslib_1 = require("tslib");
5
- var isBrowser_1 = tslib_1.__importDefault(require("./isBrowser"));
1
+ import isBrowser from "./isBrowser";
6
2
  /**
7
3
  * Is external url compared to the given current URL (if not provided it falls
8
4
  * back to `location.href`)
@@ -10,7 +6,7 @@ var isBrowser_1 = tslib_1.__importDefault(require("./isBrowser"));
10
6
  * @category location
11
7
  *
12
8
  */
13
- function isExternalUrl(url, currentUrl) {
9
+ export function isExternalUrl(url, currentUrl) {
14
10
  var _a;
15
11
  var reg = /https?:\/\/((?:[\w\d-]+\.)+[\w\d]{2,})/i;
16
12
  var urlMatches = reg.exec(url);
@@ -19,8 +15,7 @@ function isExternalUrl(url, currentUrl) {
19
15
  if (!urlMatches) {
20
16
  return false;
21
17
  }
22
- currentUrl = currentUrl || isBrowser_1.default ? location.href : "";
18
+ currentUrl = currentUrl || isBrowser ? location.href : "";
23
19
  return currentUrl ? ((_a = reg.exec(currentUrl)) === null || _a === void 0 ? void 0 : _a[1]) !== urlMatches[1] : true;
24
20
  }
25
- exports.isExternalUrl = isExternalUrl;
26
- exports.default = isExternalUrl;
21
+ export default isExternalUrl;
package/isFile.js CHANGED
@@ -1,10 +1,15 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFile = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is a File
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isFile(payload) {
8
- return getType(payload) === "File";
11
+ function isFile(payload) {
12
+ return (0, getType_1.default)(payload) === "File";
9
13
  }
10
- export default isFile;
14
+ exports.isFile = isFile;
15
+ exports.default = isFile;
package/isFile.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is a File
4
+ *
5
+ * @category is
6
+ */
7
+ export function isFile(payload) {
8
+ return getType(payload) === "File";
9
+ }
10
+ export default isFile;
package/isFloat.js CHANGED
@@ -1,10 +1,15 @@
1
- import isNumber from "./isNumber";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFloat = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isNumber_1 = tslib_1.__importDefault(require("./isNumber"));
2
6
  /**
3
7
  * Returns whether the payload is a float number
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isFloat(payload) {
8
- return isNumber(payload) && payload % 1 !== 0;
11
+ function isFloat(payload) {
12
+ return (0, isNumber_1.default)(payload) && payload % 1 !== 0;
9
13
  }
10
- export default isFloat;
14
+ exports.isFloat = isFloat;
15
+ exports.default = isFloat;
package/isFloat.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import isNumber from "./isNumber";
2
+ /**
3
+ * Returns whether the payload is a float number
4
+ *
5
+ * @category is
6
+ */
7
+ export function isFloat(payload) {
8
+ return isNumber(payload) && payload % 1 !== 0;
9
+ }
10
+ export default isFloat;
package/isFormData.js CHANGED
@@ -1,10 +1,15 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFormData = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is a FormData
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isFormData(payload) {
8
- return getType(payload) === "FormData";
11
+ function isFormData(payload) {
12
+ return (0, getType_1.default)(payload) === "FormData";
9
13
  }
10
- export default isFormData;
14
+ exports.isFormData = isFormData;
15
+ exports.default = isFormData;
package/isFormData.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is a FormData
4
+ *
5
+ * @category is
6
+ */
7
+ export function isFormData(payload) {
8
+ return getType(payload) === "FormData";
9
+ }
10
+ export default isFormData;
package/isFullArray.js CHANGED
@@ -1,10 +1,15 @@
1
- import isArray from "./isArray";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFullArray = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isArray_1 = tslib_1.__importDefault(require("./isArray"));
2
6
  /**
3
7
  * Returns whether the payload is a an array with at least 1 item
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isFullArray(payload) {
8
- return isArray(payload) && payload.length > 0;
11
+ function isFullArray(payload) {
12
+ return (0, isArray_1.default)(payload) && payload.length > 0;
9
13
  }
10
- export default isFullArray;
14
+ exports.isFullArray = isFullArray;
15
+ exports.default = isFullArray;
@@ -0,0 +1,10 @@
1
+ import isArray from "./isArray";
2
+ /**
3
+ * Returns whether the payload is a an array with at least 1 item
4
+ *
5
+ * @category is
6
+ */
7
+ export function isFullArray(payload) {
8
+ return isArray(payload) && payload.length > 0;
9
+ }
10
+ export default isFullArray;
package/isFullObject.js CHANGED
@@ -1,10 +1,15 @@
1
- import isPlainObject from "./isPlainObject";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFullObject = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isPlainObject_1 = tslib_1.__importDefault(require("./isPlainObject"));
2
6
  /**
3
7
  * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isFullObject(payload) {
8
- return isPlainObject(payload) && Object.keys(payload).length > 0;
11
+ function isFullObject(payload) {
12
+ return (0, isPlainObject_1.default)(payload) && Object.keys(payload).length > 0;
9
13
  }
10
- export default isFullObject;
14
+ exports.isFullObject = isFullObject;
15
+ exports.default = isFullObject;
@@ -0,0 +1,10 @@
1
+ import isPlainObject from "./isPlainObject";
2
+ /**
3
+ * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
4
+ *
5
+ * @category is
6
+ */
7
+ export function isFullObject(payload) {
8
+ return isPlainObject(payload) && Object.keys(payload).length > 0;
9
+ }
10
+ export default isFullObject;
package/isFullString.js CHANGED
@@ -1,10 +1,15 @@
1
- import isString from "./isString";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFullString = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isString_1 = tslib_1.__importDefault(require("./isString"));
2
6
  /**
3
7
  * Returns whether the payload is a string, BUT returns false for ''
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isFullString(payload) {
8
- return isString(payload) && payload !== "";
11
+ function isFullString(payload) {
12
+ return (0, isString_1.default)(payload) && payload !== "";
9
13
  }
10
- export default isFullString;
14
+ exports.isFullString = isFullString;
15
+ exports.default = isFullString;
@@ -0,0 +1,10 @@
1
+ import isString from "./isString";
2
+ /**
3
+ * Returns whether the payload is a string, BUT returns false for ''
4
+ *
5
+ * @category is
6
+ */
7
+ export function isFullString(payload) {
8
+ return isString(payload) && payload !== "";
9
+ }
10
+ export default isFullString;
package/isFunction.js CHANGED
@@ -1,9 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFunction = void 0;
1
4
  /**
2
5
  * Returns whether the payload is a function (regular or async)
3
6
  *
4
7
  * @category is
5
8
  */
6
- export function isFunction(payload) {
9
+ function isFunction(payload) {
7
10
  return typeof payload === "function";
8
11
  }
9
- export default isFunction;
12
+ exports.isFunction = isFunction;
13
+ exports.default = isFunction;
package/isFunction.mjs ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns whether the payload is a function (regular or async)
3
+ *
4
+ * @category is
5
+ */
6
+ export function isFunction(payload) {
7
+ return typeof payload === "function";
8
+ }
9
+ export default isFunction;
package/isInt.js CHANGED
@@ -1,10 +1,15 @@
1
- import isNumber from "./isNumber";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInt = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isNumber_1 = tslib_1.__importDefault(require("./isNumber"));
2
6
  /**
3
7
  * Returns whether the payload is an integer number
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isInt(payload) {
8
- return isNumber(payload) && payload % 1 === 0;
11
+ function isInt(payload) {
12
+ return (0, isNumber_1.default)(payload) && payload % 1 === 0;
9
13
  }
10
- export default isInt;
14
+ exports.isInt = isInt;
15
+ exports.default = isInt;
package/isInt.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import isNumber from "./isNumber";
2
+ /**
3
+ * Returns whether the payload is an integer number
4
+ *
5
+ * @category is
6
+ */
7
+ export function isInt(payload) {
8
+ return isNumber(payload) && payload % 1 === 0;
9
+ }
10
+ export default isInt;
package/isMap.js CHANGED
@@ -1,10 +1,15 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isMap = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is a Map
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isMap(payload) {
8
- return getType(payload) === "Map";
11
+ function isMap(payload) {
12
+ return (0, getType_1.default)(payload) === "Map";
9
13
  }
10
- export default isMap;
14
+ exports.isMap = isMap;
15
+ exports.default = isMap;
package/isMap.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is a Map
4
+ *
5
+ * @category is
6
+ */
7
+ export function isMap(payload) {
8
+ return getType(payload) === "Map";
9
+ }
10
+ export default isMap;
package/isNaNValue.js CHANGED
@@ -1,10 +1,15 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNaNValue = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isNaNValue(payload) {
8
- return getType(payload) === "Number" && isNaN(payload);
11
+ function isNaNValue(payload) {
12
+ return (0, getType_1.default)(payload) === "Number" && isNaN(payload);
9
13
  }
10
- export default isNaNValue;
14
+ exports.isNaNValue = isNaNValue;
15
+ exports.default = isNaNValue;
package/isNaNValue.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
4
+ *
5
+ * @category is
6
+ */
7
+ export function isNaNValue(payload) {
8
+ return getType(payload) === "Number" && isNaN(payload);
9
+ }
10
+ export default isNaNValue;
@@ -1,10 +1,15 @@
1
- import isNumber from "./isNumber";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNegativeNumber = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isNumber_1 = tslib_1.__importDefault(require("./isNumber"));
2
6
  /**
3
7
  * Returns whether the payload is a negative number (but not 0)
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isNegativeNumber(payload) {
8
- return isNumber(payload) && payload < 0;
11
+ function isNegativeNumber(payload) {
12
+ return (0, isNumber_1.default)(payload) && payload < 0;
9
13
  }
10
- export default isNegativeNumber;
14
+ exports.isNegativeNumber = isNegativeNumber;
15
+ exports.default = isNegativeNumber;
@@ -0,0 +1,10 @@
1
+ import isNumber from "./isNumber";
2
+ /**
3
+ * Returns whether the payload is a negative number (but not 0)
4
+ *
5
+ * @category is
6
+ */
7
+ export function isNegativeNumber(payload) {
8
+ return isNumber(payload) && payload < 0;
9
+ }
10
+ export default isNegativeNumber;
package/isNull.js CHANGED
@@ -1,10 +1,15 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNull = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is null
4
8
  *
5
9
  * @category is
6
10
  */
7
- export function isNull(payload) {
8
- return getType(payload) === "Null";
11
+ function isNull(payload) {
12
+ return (0, getType_1.default)(payload) === "Null";
9
13
  }
10
- export default isNull;
14
+ exports.isNull = isNull;
15
+ exports.default = isNull;
package/isNull.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is null
4
+ *
5
+ * @category is
6
+ */
7
+ export function isNull(payload) {
8
+ return getType(payload) === "Null";
9
+ }
10
+ export default isNull;
@@ -1,10 +1,14 @@
1
- import isNull from "./isNull";
2
- import isOneOf from "./isOneOf";
3
- import isUndefined from "./isUndefined";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNullOrUndefined = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isNull_1 = tslib_1.__importDefault(require("./isNull"));
6
+ var isOneOf_1 = tslib_1.__importDefault(require("./isOneOf"));
7
+ var isUndefined_1 = tslib_1.__importDefault(require("./isUndefined"));
4
8
  /**
5
9
  * Returns true whether the payload is null or undefined
6
10
  *
7
11
  * @category is
8
12
  */
9
- export var isNullOrUndefined = isOneOf(isNull, isUndefined);
10
- export default isNullOrUndefined;
13
+ exports.isNullOrUndefined = (0, isOneOf_1.default)(isNull_1.default, isUndefined_1.default);
14
+ exports.default = exports.isNullOrUndefined;
@@ -0,0 +1,10 @@
1
+ import isNull from "./isNull";
2
+ import isOneOf from "./isOneOf";
3
+ import isUndefined from "./isUndefined";
4
+ /**
5
+ * Returns true whether the payload is null or undefined
6
+ *
7
+ * @category is
8
+ */
9
+ export var isNullOrUndefined = isOneOf(isNull, isUndefined);
10
+ export default isNullOrUndefined;
package/isNumber.js CHANGED
@@ -1,4 +1,8 @@
1
- import getType from "./getType";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNumber = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var getType_1 = tslib_1.__importDefault(require("./getType"));
2
6
  /**
3
7
  * Returns whether the payload is a number (but not NaN)
4
8
  *
@@ -6,7 +10,8 @@ import getType from "./getType";
6
10
  *
7
11
  * @category is
8
12
  */
9
- export function isNumber(payload) {
10
- return getType(payload) === "Number" && !isNaN(payload);
13
+ function isNumber(payload) {
14
+ return (0, getType_1.default)(payload) === "Number" && !isNaN(payload);
11
15
  }
12
- export default isNumber;
16
+ exports.isNumber = isNumber;
17
+ exports.default = isNumber;
package/isNumber.mjs ADDED
@@ -0,0 +1,12 @@
1
+ import getType from "./getType";
2
+ /**
3
+ * Returns whether the payload is a number (but not NaN)
4
+ *
5
+ * This will return `false` for `NaN`!!
6
+ *
7
+ * @category is
8
+ */
9
+ export function isNumber(payload) {
10
+ return getType(payload) === "Number" && !isNaN(payload);
11
+ }
12
+ export default isNumber;