@koine/utils 1.1.10 → 1.1.12
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.
- package/Defer.js +6 -2
- package/{node/Defer.js → Defer.mjs} +2 -6
- package/Emitter.js +6 -2
- package/{node/Emitter.js → Emitter.mjs} +2 -6
- package/accentSets.js +5 -2
- package/{node/accentSets.js → accentSets.mjs} +2 -5
- package/addOrReplaceAtIdx.js +8 -4
- package/addOrReplaceAtIdx.mjs +19 -0
- package/areEqual.js +10 -6
- package/{node/areEqual.js → areEqual.mjs} +6 -10
- package/arrayOfAll.js +6 -2
- package/{node/arrayOfAll.js → arrayOfAll.mjs} +2 -6
- package/arraySum.js +6 -2
- package/arraySum.mjs +9 -0
- package/arrayToLookup.js +6 -2
- package/{node/arrayToLookup.js → arrayToLookup.mjs} +2 -6
- package/buildUrlQueryString.js +12 -7
- package/{node/buildUrlQueryString.js → buildUrlQueryString.mjs} +7 -12
- package/capitalize.js +6 -2
- package/{node/capitalize.js → capitalize.mjs} +2 -6
- package/changeUrlPath.js +11 -6
- package/changeUrlPath.mjs +18 -0
- package/chunkByChunks.js +6 -2
- package/{node/chunkByChunks.js → chunkByChunks.mjs} +2 -6
- package/chunkBySize.js +6 -2
- package/{node/chunkBySize.js → chunkBySize.mjs} +2 -6
- package/clamp.js +6 -2
- package/{node/clamp.js → clamp.mjs} +2 -6
- package/clsx.js +6 -2
- package/{node/clsx.js → clsx.mjs} +2 -6
- package/convertRange.js +6 -2
- package/{node/convertRange.js → convertRange.mjs} +2 -6
- package/cookie.js +4 -1
- package/{node/cookie.js → cookie.mjs} +1 -4
- package/debounce.js +6 -2
- package/{node/debounce.js → debounce.mjs} +2 -6
- package/debouncePromise.js +6 -3
- package/debouncePromise.mjs +9 -0
- package/debounceRaf.js +6 -2
- package/{node/debounceRaf.js → debounceRaf.mjs} +2 -6
- package/decode.js +6 -2
- package/{node/decode.js → decode.mjs} +2 -6
- package/encode.js +6 -2
- package/{node/encode.js → encode.mjs} +2 -6
- package/ensureInt.js +6 -2
- package/ensureInt.mjs +9 -0
- package/{node/env.js → env.mjs} +0 -0
- package/findDuplicatedIndexes.js +6 -2
- package/{node/findDuplicatedIndexes.js → findDuplicatedIndexes.mjs} +2 -6
- package/forin.js +6 -2
- package/forin.mjs +11 -0
- package/gbToBytes.js +6 -2
- package/gbToBytes.mjs +7 -0
- package/getEmptyArray.js +9 -4
- package/getEmptyArray.mjs +15 -0
- package/getKeys.js +5 -2
- package/{node/getKeys.js → getKeys.mjs} +2 -5
- package/getMediaQueryWidthResolvers.js +8 -4
- package/{node/getMediaQueryWidthResolvers.js → getMediaQueryWidthResolvers.mjs} +4 -8
- package/getMediaQueryWidthTailwindScreens.js +8 -4
- package/{node/getMediaQueryWidthTailwindScreens.js → getMediaQueryWidthTailwindScreens.mjs} +4 -8
- package/getNonce.js +8 -4
- package/getNonce.mjs +9 -0
- package/getParamAmong.js +9 -4
- package/{node/getParamAmong.js → getParamAmong.mjs} +4 -9
- package/getParamAsInt.js +9 -4
- package/{node/getParamAsInt.js → getParamAsInt.mjs} +4 -9
- package/getParamAsString.js +9 -4
- package/getParamAsString.mjs +14 -0
- package/getType.js +6 -2
- package/{node/getType.js → getType.mjs} +2 -6
- package/getUrlHashParams.js +6 -2
- package/{node/getUrlHashParams.js → getUrlHashParams.mjs} +2 -6
- package/getUrlHashPathname.js +6 -2
- package/{node/getUrlHashPathname.js → getUrlHashPathname.mjs} +2 -6
- package/getUrlPathnameParts.js +9 -4
- package/{node/getUrlPathnameParts.js → getUrlPathnameParts.mjs} +4 -9
- package/getUrlQueryParams.js +9 -4
- package/{node/getUrlQueryParams.js → getUrlQueryParams.mjs} +4 -9
- package/imgEmptyPixel.js +5 -2
- package/imgEmptyPixel.mjs +7 -0
- package/index.js +132 -129
- package/index.mjs +131 -0
- package/invariant.js +6 -2
- package/{node/invariant.js → invariant.mjs} +2 -6
- package/isAnyObject.js +9 -4
- package/isAnyObject.mjs +10 -0
- package/isArray.js +9 -4
- package/isArray.mjs +10 -0
- package/isBlob.js +9 -4
- package/isBlob.mjs +10 -0
- package/isBoolean.js +9 -4
- package/isBoolean.mjs +10 -0
- package/isBrowser.js +5 -2
- package/isBrowser.mjs +8 -0
- package/isDate.js +9 -4
- package/isDate.mjs +10 -0
- package/isEmptyArray.js +9 -4
- package/isEmptyArray.mjs +10 -0
- package/isEmptyObject.js +9 -4
- package/isEmptyObject.mjs +10 -0
- package/isEmptyString.js +6 -2
- package/isEmptyString.mjs +9 -0
- package/isError.js +9 -4
- package/isError.mjs +10 -0
- package/isExternalUrl.js +9 -4
- package/{node/isExternalUrl.js → isExternalUrl.mjs} +4 -9
- package/isFile.js +9 -4
- package/isFile.mjs +10 -0
- package/isFloat.js +9 -4
- package/isFloat.mjs +10 -0
- package/isFormData.js +9 -4
- package/isFormData.mjs +10 -0
- package/isFullArray.js +9 -4
- package/isFullArray.mjs +10 -0
- package/isFullObject.js +9 -4
- package/isFullObject.mjs +10 -0
- package/isFullString.js +9 -4
- package/isFullString.mjs +10 -0
- package/isFunction.js +6 -2
- package/isFunction.mjs +9 -0
- package/isInt.js +9 -4
- package/isInt.mjs +10 -0
- package/isMap.js +9 -4
- package/isMap.mjs +10 -0
- package/isNaNValue.js +9 -4
- package/isNaNValue.mjs +10 -0
- package/isNegativeNumber.js +9 -4
- package/isNegativeNumber.mjs +10 -0
- package/isNull.js +9 -4
- package/isNull.mjs +10 -0
- package/isNullOrUndefined.js +9 -5
- package/isNullOrUndefined.mjs +10 -0
- package/isNumber.js +9 -4
- package/isNumber.mjs +12 -0
- package/isObject.js +9 -4
- package/isObject.mjs +10 -0
- package/isObjectLike.js +9 -4
- package/isObjectLike.mjs +12 -0
- package/isOneOf.js +6 -2
- package/isOneOf.mjs +10 -0
- package/isPlainObject.js +9 -4
- package/isPlainObject.mjs +13 -0
- package/isPositiveNumber.js +9 -4
- package/isPositiveNumber.mjs +10 -0
- package/isPrimitive.js +19 -14
- package/isPrimitive.mjs +20 -0
- package/isPromise.js +9 -4
- package/isPromise.mjs +10 -0
- package/isRegExp.js +9 -4
- package/isRegExp.mjs +10 -0
- package/isServer.js +7 -3
- package/isServer.mjs +9 -0
- package/isSet.js +9 -4
- package/isSet.mjs +10 -0
- package/isString.js +9 -4
- package/isString.mjs +10 -0
- package/isSymbol.js +9 -4
- package/isSymbol.mjs +10 -0
- package/isType.js +9 -4
- package/{node/isType.js → isType.mjs} +4 -9
- package/isUndefined.js +9 -4
- package/isUndefined.mjs +10 -0
- package/isWeakMap.js +9 -4
- package/isWeakMap.mjs +10 -0
- package/isWeakSet.js +9 -4
- package/isWeakSet.mjs +10 -0
- package/kbToBytes.js +6 -2
- package/kbToBytes.mjs +7 -0
- package/location.js +2 -1
- package/location.mjs +1 -0
- package/lowercase.js +6 -2
- package/lowercase.mjs +9 -0
- package/mapListBy.js +6 -2
- package/{node/mapListBy.js → mapListBy.mjs} +2 -6
- package/matchSorter.js +11 -7
- package/{node/matchSorter.js → matchSorter.mjs} +7 -11
- package/mbToBytes.js +6 -2
- package/mbToBytes.mjs +7 -0
- package/mergeObjects.js +11 -7
- package/{node/mergeObjects.js → mergeObjects.mjs} +7 -11
- package/mergeUrlQueryParams.js +9 -4
- package/{node/mergeUrlQueryParams.js → mergeUrlQueryParams.mjs} +4 -9
- package/moveSortableArrayItemByKey.js +8 -4
- package/{node/moveSortableArrayItemByKey.js → moveSortableArrayItemByKey.mjs} +4 -8
- package/noop.js +6 -2
- package/noop.mjs +7 -0
- package/normaliseUrl.js +9 -4
- package/normaliseUrl.mjs +15 -0
- package/normaliseUrlPathname.js +9 -4
- package/normaliseUrlPathname.mjs +14 -0
- package/objectOmit.js +6 -2
- package/{node/objectOmit.js → objectOmit.mjs} +2 -6
- package/objectPick.js +6 -2
- package/{node/objectPick.js → objectPick.mjs} +2 -6
- package/package.json +10 -8
- package/parseCookie.js +6 -2
- package/{node/parseCookie.js → parseCookie.mjs} +2 -6
- package/parseURL.js +6 -2
- package/{node/parseURL.js → parseURL.mjs} +2 -6
- package/quaranteneProps.js +6 -2
- package/{node/quaranteneProps.js → quaranteneProps.mjs} +2 -6
- package/randomInt.js +6 -2
- package/randomInt.mjs +9 -0
- package/randomKey.js +6 -2
- package/{node/randomKey.js → randomKey.mjs} +2 -6
- package/readCookie.js +6 -2
- package/{node/readCookie.js → readCookie.mjs} +2 -6
- package/removeAccents.js +8 -4
- package/removeAccents.mjs +15 -0
- package/removeCookie.js +10 -6
- package/removeCookie.mjs +15 -0
- package/{node/removeDuplicates.js → removeDuplicates.mjs} +0 -0
- package/removeDuplicatesByKey.js +6 -2
- package/{node/removeDuplicatesByKey.js → removeDuplicatesByKey.mjs} +2 -6
- package/removeDuplicatesComparing.js +10 -6
- package/removeDuplicatesComparing.mjs +10 -0
- package/removeIndexesFromArray.js +6 -2
- package/removeIndexesFromArray.mjs +14 -0
- package/removeTrailingSlash.js +6 -2
- package/removeTrailingSlash.mjs +10 -0
- package/removeUrlQueryParams.js +11 -6
- package/removeUrlQueryParams.mjs +21 -0
- package/roundTo.js +6 -2
- package/{node/roundTo.js → roundTo.mjs} +2 -6
- package/serializeCookie.js +8 -4
- package/{node/serializeCookie.js → serializeCookie.mjs} +4 -8
- package/setCookie.js +14 -10
- package/{node/setCookie.js → setCookie.mjs} +10 -14
- package/shuffle.js +8 -4
- package/{node/shuffle.js → shuffle.mjs} +4 -8
- package/slugify.js +9 -5
- package/{node/slugify.js → slugify.mjs} +5 -9
- package/swapMap.js +6 -2
- package/{node/swapMap.js → swapMap.mjs} +2 -6
- package/throttle.js +8 -4
- package/{node/throttle.js → throttle.mjs} +4 -8
- package/titleCase.js +6 -2
- package/{node/titleCase.js → titleCase.mjs} +2 -6
- package/toNumber.js +8 -4
- package/toNumber.mjs +8 -0
- package/toRgba.js +6 -2
- package/{node/toRgba.js → toRgba.mjs} +2 -6
- package/transformToUrlPathname.js +9 -4
- package/transformToUrlPathname.mjs +16 -0
- package/truncate.js +6 -2
- package/truncate.mjs +13 -0
- package/tryUntil.js +6 -2
- package/{node/tryUntil.js → tryUntil.mjs} +2 -6
- package/types.js +2 -1
- package/types.mjs +1 -0
- package/uid.js +6 -2
- package/{node/uid.js → uid.mjs} +2 -6
- package/updateLinkParams.js +9 -4
- package/updateLinkParams.mjs +14 -0
- package/updateUrlQueryParams.js +12 -7
- package/updateUrlQueryParams.mjs +18 -0
- package/uppercase.js +6 -2
- package/uppercase.mjs +9 -0
- package/uuid.js +6 -2
- package/{node/uuid.js → uuid.mjs} +2 -6
- package/uuidNumeric.js +6 -2
- package/uuidNumeric.mjs +6 -0
- package/wait.js +6 -2
- package/wait.mjs +9 -0
- package/node/addOrReplaceAtIdx.js +0 -23
- package/node/arraySum.js +0 -13
- package/node/changeUrlPath.js +0 -23
- package/node/debouncePromise.js +0 -12
- package/node/ensureInt.js +0 -13
- package/node/forin.js +0 -15
- package/node/gbToBytes.js +0 -11
- package/node/getEmptyArray.js +0 -20
- package/node/getNonce.js +0 -13
- package/node/getParamAsString.js +0 -19
- package/node/imgEmptyPixel.js +0 -10
- package/node/index.js +0 -134
- package/node/isAnyObject.js +0 -15
- package/node/isArray.js +0 -15
- package/node/isBlob.js +0 -15
- package/node/isBoolean.js +0 -15
- package/node/isBrowser.js +0 -11
- package/node/isDate.js +0 -15
- package/node/isEmptyArray.js +0 -15
- package/node/isEmptyObject.js +0 -15
- package/node/isEmptyString.js +0 -13
- package/node/isError.js +0 -15
- package/node/isFile.js +0 -15
- package/node/isFloat.js +0 -15
- package/node/isFormData.js +0 -15
- package/node/isFullArray.js +0 -15
- package/node/isFullObject.js +0 -15
- package/node/isFullString.js +0 -15
- package/node/isFunction.js +0 -13
- package/node/isInt.js +0 -15
- package/node/isMap.js +0 -15
- package/node/isNaNValue.js +0 -15
- package/node/isNegativeNumber.js +0 -15
- package/node/isNull.js +0 -15
- package/node/isNullOrUndefined.js +0 -14
- package/node/isNumber.js +0 -17
- package/node/isObject.js +0 -15
- package/node/isObjectLike.js +0 -17
- package/node/isOneOf.js +0 -14
- package/node/isPlainObject.js +0 -18
- package/node/isPositiveNumber.js +0 -15
- package/node/isPrimitive.js +0 -25
- package/node/isPromise.js +0 -15
- package/node/isRegExp.js +0 -15
- package/node/isServer.js +0 -13
- package/node/isSet.js +0 -15
- package/node/isString.js +0 -15
- package/node/isSymbol.js +0 -15
- package/node/isUndefined.js +0 -15
- package/node/isWeakMap.js +0 -15
- package/node/isWeakSet.js +0 -15
- package/node/kbToBytes.js +0 -11
- package/node/location.js +0 -2
- package/node/lowercase.js +0 -13
- package/node/mbToBytes.js +0 -11
- package/node/noop.js +0 -11
- package/node/normaliseUrl.js +0 -20
- package/node/normaliseUrlPathname.js +0 -19
- package/node/randomInt.js +0 -13
- package/node/removeAccents.js +0 -19
- package/node/removeCookie.js +0 -19
- package/node/removeDuplicatesComparing.js +0 -14
- package/node/removeIndexesFromArray.js +0 -18
- package/node/removeTrailingSlash.js +0 -14
- package/node/removeUrlQueryParams.js +0 -26
- package/node/toNumber.js +0 -12
- package/node/transformToUrlPathname.js +0 -21
- package/node/truncate.js +0 -17
- package/node/types.js +0 -2
- package/node/updateLinkParams.js +0 -19
- package/node/updateUrlQueryParams.js +0 -23
- package/node/uppercase.js +0 -13
- package/node/uuidNumeric.js +0 -10
- package/node/wait.js +0 -13
package/isEmptyArray.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isEmptyArray(payload) {
|
|
12
|
+
return (0, isArray_1.default)(payload) && payload.length === 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isEmptyArray = isEmptyArray;
|
|
15
|
+
exports.default = isEmptyArray;
|
package/isEmptyArray.mjs
ADDED
package/isEmptyObject.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isEmptyObject(payload) {
|
|
12
|
+
return (0, isPlainObject_1.default)(payload) && Object.keys(payload).length === 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
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
|
-
|
|
9
|
+
function isEmptyString(payload) {
|
|
7
10
|
return payload === "";
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
exports.isEmptyString = isEmptyString;
|
|
13
|
+
exports.default = isEmptyString;
|
package/isError.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isError(payload) {
|
|
12
|
+
return (0, getType_1.default)(payload) === "Error";
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isError = isError;
|
|
15
|
+
exports.default = isError;
|
package/isError.mjs
ADDED
package/isExternalUrl.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 ||
|
|
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
|
-
|
|
25
|
+
exports.isExternalUrl = isExternalUrl;
|
|
26
|
+
exports.default = isExternalUrl;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
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 ||
|
|
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
|
-
|
|
26
|
-
exports.default = isExternalUrl;
|
|
21
|
+
export default isExternalUrl;
|
package/isFile.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isFile(payload) {
|
|
12
|
+
return (0, getType_1.default)(payload) === "File";
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isFile = isFile;
|
|
15
|
+
exports.default = isFile;
|
package/isFile.mjs
ADDED
package/isFloat.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isFloat(payload) {
|
|
12
|
+
return (0, isNumber_1.default)(payload) && payload % 1 !== 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isFloat = isFloat;
|
|
15
|
+
exports.default = isFloat;
|
package/isFloat.mjs
ADDED
package/isFormData.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isFormData(payload) {
|
|
12
|
+
return (0, getType_1.default)(payload) === "FormData";
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isFormData = isFormData;
|
|
15
|
+
exports.default = isFormData;
|
package/isFormData.mjs
ADDED
package/isFullArray.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isFullArray(payload) {
|
|
12
|
+
return (0, isArray_1.default)(payload) && payload.length > 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isFullArray = isFullArray;
|
|
15
|
+
exports.default = isFullArray;
|
package/isFullArray.mjs
ADDED
package/isFullObject.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isFullObject(payload) {
|
|
12
|
+
return (0, isPlainObject_1.default)(payload) && Object.keys(payload).length > 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isFullObject = isFullObject;
|
|
15
|
+
exports.default = isFullObject;
|
package/isFullObject.mjs
ADDED
|
@@ -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
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isFullString(payload) {
|
|
12
|
+
return (0, isString_1.default)(payload) && payload !== "";
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isFullString = isFullString;
|
|
15
|
+
exports.default = isFullString;
|
package/isFullString.mjs
ADDED
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
|
-
|
|
9
|
+
function isFunction(payload) {
|
|
7
10
|
return typeof payload === "function";
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
exports.isFunction = isFunction;
|
|
13
|
+
exports.default = isFunction;
|
package/isFunction.mjs
ADDED
package/isInt.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isInt(payload) {
|
|
12
|
+
return (0, isNumber_1.default)(payload) && payload % 1 === 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isInt = isInt;
|
|
15
|
+
exports.default = isInt;
|
package/isInt.mjs
ADDED
package/isMap.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isMap(payload) {
|
|
12
|
+
return (0, getType_1.default)(payload) === "Map";
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isMap = isMap;
|
|
15
|
+
exports.default = isMap;
|
package/isMap.mjs
ADDED
package/isNaNValue.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isNaNValue(payload) {
|
|
12
|
+
return (0, getType_1.default)(payload) === "Number" && isNaN(payload);
|
|
9
13
|
}
|
|
10
|
-
|
|
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;
|
package/isNegativeNumber.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isNegativeNumber(payload) {
|
|
12
|
+
return (0, isNumber_1.default)(payload) && payload < 0;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isNegativeNumber = isNegativeNumber;
|
|
15
|
+
exports.default = isNegativeNumber;
|
package/isNull.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
8
|
-
return
|
|
11
|
+
function isNull(payload) {
|
|
12
|
+
return (0, getType_1.default)(payload) === "Null";
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
exports.isNull = isNull;
|
|
15
|
+
exports.default = isNull;
|
package/isNull.mjs
ADDED
package/isNullOrUndefined.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
10
|
-
return
|
|
13
|
+
function isNumber(payload) {
|
|
14
|
+
return (0, getType_1.default)(payload) === "Number" && !isNaN(payload);
|
|
11
15
|
}
|
|
12
|
-
|
|
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;
|