@juisy/utils 3.0.0-beta.0
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/LICENSE +661 -0
- package/README.md +51 -0
- package/dist/assert/argsert.d.ts +92 -0
- package/dist/assert/argsert.js +45 -0
- package/dist/assert/assert.d.ts +457 -0
- package/dist/assert/assert.js +100 -0
- package/dist/constructor/apply-mixins.d.ts +15 -0
- package/dist/constructor/apply-mixins.js +23 -0
- package/dist/constructor/get-constructor-name.d.ts +19 -0
- package/dist/constructor/get-constructor-name.js +18 -0
- package/dist/date/date-format.d.ts +18 -0
- package/dist/date/date-format.js +15 -0
- package/dist/date/get-date-range.d.ts +38 -0
- package/dist/date/get-date-range.js +32 -0
- package/dist/date/get-duration-between-times.d.ts +13 -0
- package/dist/date/get-duration-between-times.js +20 -0
- package/dist/date/get-duration-between.d.ts +12 -0
- package/dist/date/get-duration-between.js +16 -0
- package/dist/date/get-i18n-timezone-value.d.ts +19 -0
- package/dist/date/get-i18n-timezone-value.js +27 -0
- package/dist/date/get-next-date-for-time.d.ts +10 -0
- package/dist/date/get-next-date-for-time.js +16 -0
- package/dist/date/get-utc-offset.d.ts +10 -0
- package/dist/date/get-utc-offset.js +15 -0
- package/dist/fs/get-file-urls.d.ts +12 -0
- package/dist/fs/get-file-urls.js +13 -0
- package/dist/fs/get-files-sync.d.ts +19 -0
- package/dist/fs/get-files-sync.js +23 -0
- package/dist/fs/get-files.d.ts +23 -0
- package/dist/fs/get-files.js +21 -0
- package/dist/fs/get-root-dir.d.ts +15 -0
- package/dist/fs/get-root-dir.js +12 -0
- package/dist/fs/is-directory.d.ts +13 -0
- package/dist/fs/is-directory.js +17 -0
- package/dist/fs/is-file.d.ts +13 -0
- package/dist/fs/is-file.js +17 -0
- package/dist/is/is-def.d.ts +20 -0
- package/dist/is/is-def.js +10 -0
- package/dist/is/is-valid-css-color.d.ts +11 -0
- package/dist/is/is-valid-css-color.js +10 -0
- package/dist/is/is.d.ts +456 -0
- package/dist/is/is.js +102 -0
- package/dist/misc/compose.d.ts +18 -0
- package/dist/misc/compose.js +31 -0
- package/dist/misc/detect-browser.d.ts +19 -0
- package/dist/misc/detect-browser.js +12 -0
- package/dist/misc/type-check.d.ts +19 -0
- package/dist/misc/type-check.js +39 -0
- package/dist/object/deep-merge.d.ts +21 -0
- package/dist/object/deep-merge.js +10 -0
- package/dist/object/deep-parse.d.ts +18 -0
- package/dist/object/deep-parse.js +15 -0
- package/dist/object/get.d.ts +24 -0
- package/dist/object/get.js +12 -0
- package/dist/path/is-posix.d.ts +17 -0
- package/dist/path/is-posix.js +12 -0
- package/dist/path/is-same-as.d.ts +21 -0
- package/dist/path/is-same-as.js +13 -0
- package/dist/path/is-win32.d.ts +17 -0
- package/dist/path/is-win32.js +10 -0
- package/dist/path/normalize.d.ts +16 -0
- package/dist/path/normalize.js +22 -0
- package/dist/path/resolve-abs-from-root.d.ts +14 -0
- package/dist/path/resolve-abs-from-root.js +17 -0
- package/dist/path/resolve-rel-from-root.d.ts +14 -0
- package/dist/path/resolve-rel-from-root.js +13 -0
- package/dist/path/resolve-rel.d.ts +21 -0
- package/dist/path/resolve-rel.js +16 -0
- package/dist/path/to-os-format.d.ts +12 -0
- package/dist/path/to-os-format.js +14 -0
- package/dist/path/to-posix.d.ts +16 -0
- package/dist/path/to-posix.js +12 -0
- package/dist/path/to-win32.d.ts +16 -0
- package/dist/path/to-win32.js +12 -0
- package/dist/random/random-alpha-numeric.d.ts +22 -0
- package/dist/random/random-alpha-numeric.js +12 -0
- package/dist/random/random-number.d.ts +23 -0
- package/dist/random/random-number.js +12 -0
- package/dist/string/camelcase.d.ts +22 -0
- package/dist/string/camelcase.js +12 -0
- package/dist/string/capitalize.d.ts +23 -0
- package/dist/string/capitalize.js +18 -0
- package/dist/string/constantcase.d.ts +16 -0
- package/dist/string/constantcase.js +12 -0
- package/dist/string/kebabcase.d.ts +22 -0
- package/dist/string/kebabcase.js +12 -0
- package/dist/string/lowercase.d.ts +22 -0
- package/dist/string/lowercase.js +12 -0
- package/dist/string/pascalcase.d.ts +16 -0
- package/dist/string/pascalcase.js +13 -0
- package/dist/string/snakecase.d.ts +22 -0
- package/dist/string/snakecase.js +12 -0
- package/dist/string/uppercase.d.ts +22 -0
- package/dist/string/uppercase.js +12 -0
- package/package.json +123 -0
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @juisy/utils
|
|
2
|
+
|
|
3
|
+
<!-- markdownlint-disable line-length -->
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](http://herve-perchec.com/)
|
|
7
|
+
|
|
8
|
+
[](https://gitlab.com/hperchec/juisy/-/releases)
|
|
9
|
+
[](https://gitlab.com/hperchec/juisy/commits/v3.0.0-beta.0)
|
|
10
|
+

|
|
11
|
+
[](https://www.npmjs.com/package/@juisy/utils)
|
|
12
|
+
[](https://www.npmjs.com/package/@juisy/utils)
|
|
13
|
+
[](https://gitlab.com/hperchec/juisy/issues)
|
|
14
|
+
[](https://gitlab.com/hperchec/juisy/-/blob/v3.0.0-beta.0/LICENSE)
|
|
15
|
+
|
|
16
|
+
<!-- markdownlint-enable line-length -->
|
|
17
|
+
|
|
18
|
+
## Table of contents
|
|
19
|
+
|
|
20
|
+
* [🚀 Get started](#-get-started)
|
|
21
|
+
* [📙 Documentation](#-documentation)
|
|
22
|
+
* [✍ Author](#-author)
|
|
23
|
+
* [📄 License](#-license)
|
|
24
|
+
|
|
25
|
+
## 🚀 Get started
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install @juisy/utils
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 📙 Documentation
|
|
32
|
+
|
|
33
|
+
Please read the online [Juisy documentation](https://hperchec.gitlab.io/juisy)
|
|
34
|
+
|
|
35
|
+
## ✍ Author
|
|
36
|
+
|
|
37
|
+
[Hervé Perchec](https://gitlab.com/herveperchec)
|
|
38
|
+
|
|
39
|
+
## 📄 License
|
|
40
|
+
|
|
41
|
+
GPL-3.0-only
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
Made with ❤ by [Hervé Perchec](https://gitlab.com/herveperchec)
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
<!-- markdownlint-disable-next-line line-length -->
|
|
50
|
+
|
|
51
|
+
*README.md - this file was auto generated with [juisy](https://www.npmjs.com/package/juisy) README templater. Don't edit it.*
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module assert/argsert
|
|
3
|
+
* @importTarget ./assert/argsert
|
|
4
|
+
* @author Hervé Perchec
|
|
5
|
+
*/
|
|
6
|
+
import type * as ow from 'ow';
|
|
7
|
+
/**
|
|
8
|
+
* An object to pass as predicate validator ({@link ow.Predicate Predicate}.{@link ow.Predicate.addValidator addValidator})
|
|
9
|
+
*/
|
|
10
|
+
export type PredicateAsObject<T = unknown> = Partial<Parameters<ow.Predicate<T>['addValidator']>[0]> & {
|
|
11
|
+
validator: (val: T) => any;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Can be:
|
|
15
|
+
* - a {@link OWPredicate Predicate} instance (ex: `argsert.string`)
|
|
16
|
+
* - an object that satisfies {@link PredicateAsObject}
|
|
17
|
+
* - the path to argsert predicate as string in the lodash.get format (ex: `"string.nonBlank"` is equivalent to `argsert.string.nonBlank`)
|
|
18
|
+
* See also argsert util documentation
|
|
19
|
+
*/
|
|
20
|
+
export type ArgsertPredicate<T = unknown> = ow.Predicate<T> | ow.AnyPredicate<T> | PredicateAsObject<T> | string;
|
|
21
|
+
/**
|
|
22
|
+
* Argument assert interface. It extends `Ow` interface from [ow](https://github.com/sindresorhus/ow) package and add some custom properties.
|
|
23
|
+
* @see https://github.com/sindresorhus/ow
|
|
24
|
+
*/
|
|
25
|
+
export interface Argsert extends Pick<ow.Ow, keyof ow.Ow> {
|
|
26
|
+
<T>(value: any, label: string, predicates: ArgsertPredicate<T>[]): asserts value is T;
|
|
27
|
+
/**
|
|
28
|
+
* Get the Predicate constructor
|
|
29
|
+
* @returns The Predicate class
|
|
30
|
+
* @see https://github.com/sindresorhus/ow
|
|
31
|
+
*/
|
|
32
|
+
getPredicateConstructor(): typeof ow.Predicate;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Assert that the given argument value satisfies types constraints.
|
|
36
|
+
* It's a wrapper of {@link ow} package with some additional features.
|
|
37
|
+
* @function
|
|
38
|
+
* @param value - Argument value to check
|
|
39
|
+
* @param label - The argument name
|
|
40
|
+
* @param predicates - An array of predicates or type as string
|
|
41
|
+
* @see {@link ow}
|
|
42
|
+
* @envCompat Browser
|
|
43
|
+
* @envCompat Node
|
|
44
|
+
* @example
|
|
45
|
+
* argsert('Chuck Norris', 'name', ['string']) // true
|
|
46
|
+
* argsert(42, 'age', ['number']) // true
|
|
47
|
+
* argsert(null, 'name', ['string']) // Error: Argument "name" is not a string
|
|
48
|
+
* @example
|
|
49
|
+
* Usage examples
|
|
50
|
+
*
|
|
51
|
+
* ```js
|
|
52
|
+
* // Provide predicate like `ow` package
|
|
53
|
+
* function hello (name) {
|
|
54
|
+
* argsert(name, 'name', [ argsert.string ])
|
|
55
|
+
* console.log(`Hello ${name}!`)
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* // Predicate as string
|
|
59
|
+
* argsert(name, 'name', [ 'string' ]) // equivalent to argsert.string
|
|
60
|
+
*
|
|
61
|
+
* // Custom validator
|
|
62
|
+
* argsert(name, 'name', [
|
|
63
|
+
* { validator: (value) => value === 'Chuck Norris' }
|
|
64
|
+
* ])
|
|
65
|
+
*
|
|
66
|
+
* // Complete example
|
|
67
|
+
* argsert(name, 'name', [
|
|
68
|
+
* argsert.string,
|
|
69
|
+
* 'string.nonBlank',
|
|
70
|
+
* {
|
|
71
|
+
* validator: (value) => value === 'Chuck Norris',
|
|
72
|
+
* message: (value, label) => `Only Chuck Norris can be welcomed 😡`
|
|
73
|
+
* }
|
|
74
|
+
* ])
|
|
75
|
+
*
|
|
76
|
+
* ```
|
|
77
|
+
* @example
|
|
78
|
+
* You can use TypeScript and even type guard exactly like [ow](https://github.com/sindresorhus/ow)
|
|
79
|
+
*
|
|
80
|
+
* ```ts
|
|
81
|
+
* // TypeScript
|
|
82
|
+
* function hello (name: string) {
|
|
83
|
+
* argsert<string>(name, 'name', [
|
|
84
|
+
* argsert.string,
|
|
85
|
+
* argsert.string.nonBlank
|
|
86
|
+
* ])
|
|
87
|
+
* console.log(`Hello ${name}!`)
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare const argsert: Argsert;
|
|
92
|
+
export default argsert;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* juisy v3.0.0-beta.0
|
|
3
|
+
* Copyright © 2022-Present Hervé Perchec
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import _ow, { Predicate, AnyPredicate } from 'ow';
|
|
7
|
+
import ErrorStackParser from 'error-stack-parser';
|
|
8
|
+
import get from '@juisy/utils/object/get';
|
|
9
|
+
|
|
10
|
+
class UnknownPredicateError extends Error {
|
|
11
|
+
// ...
|
|
12
|
+
}
|
|
13
|
+
const argsert = function(value, label, predicates) {
|
|
14
|
+
try {
|
|
15
|
+
for (const predicate of predicates) {
|
|
16
|
+
if (predicate instanceof argsert.getPredicateConstructor() || predicate instanceof AnyPredicate) {
|
|
17
|
+
_ow(value, label, predicate);
|
|
18
|
+
} else if (typeof predicate === "object") {
|
|
19
|
+
_ow(value, label, new Predicate(typeof value).addValidator({
|
|
20
|
+
message: (val, lbl) => `[No predicate message defined] Expected \`${label}\` to be valid but received type \`${typeof value}\``,
|
|
21
|
+
...predicate
|
|
22
|
+
}));
|
|
23
|
+
} else {
|
|
24
|
+
const foundPredicate = get(_ow, predicate);
|
|
25
|
+
if (foundPredicate) {
|
|
26
|
+
_ow(value, label, foundPredicate);
|
|
27
|
+
} else {
|
|
28
|
+
throw new UnknownPredicateError("Trying to access to unkown predicate ow." + predicate, get(_ow, predicate));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error instanceof UnknownPredicateError) throw error;
|
|
34
|
+
const newError = new TypeError("", { cause: error });
|
|
35
|
+
const stackFrames = ErrorStackParser.parse(newError);
|
|
36
|
+
stackFrames.splice(0, 1);
|
|
37
|
+
const callerName = stackFrames[0].getFunctionName();
|
|
38
|
+
newError.message = `Argument assertion error for "${callerName}" ⇒ ${error.message}`;
|
|
39
|
+
throw newError;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperties(argsert, Object.getOwnPropertyDescriptors(_ow));
|
|
43
|
+
argsert.getPredicateConstructor = () => Predicate;
|
|
44
|
+
|
|
45
|
+
export { argsert, argsert as default };
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import { assert as _assert, assertAll as _assertAll, assertAny as _assertAny, assertArray as _assertArray, assertArrayBuffer as _assertArrayBuffer, assertArrayLike as _assertArrayLike, assertAsyncFunction as _assertAsyncFunction, assertAsyncGenerator as _assertAsyncGenerator, assertAsyncGeneratorFunction as _assertAsyncGeneratorFunction, assertAsyncIterable as _assertAsyncIterable, assertBigint as _assertBigint, assertBigInt64Array as _assertBigInt64Array, assertBigUint64Array as _assertBigUint64Array, assertBlob as _assertBlob, assertBoolean as _assertBoolean, assertBoundFunction as _assertBoundFunction, assertBuffer as _assertBuffer, assertClass as _assertClass, assertDataView as _assertDataView, assertDate as _assertDate, assertDirectInstanceOf as _assertDirectInstanceOf, assertEmptyArray as _assertEmptyArray, assertEmptyMap as _assertEmptyMap, assertEmptyObject as _assertEmptyObject, assertEmptySet as _assertEmptySet, assertEmptyString as _assertEmptyString, assertEmptyStringOrWhitespace as _assertEmptyStringOrWhitespace, assertEnumCase as _assertEnumCase, assertError as _assertError, assertEvenInteger as _assertEvenInteger, assertFalsy as _assertFalsy, assertFloat32Array as _assertFloat32Array, assertFloat64Array as _assertFloat64Array, assertFormData as _assertFormData, assertFunction as _assertFunction, assertGenerator as _assertGenerator, assertGeneratorFunction as _assertGeneratorFunction, assertHtmlElement as _assertHtmlElement, assertInfinite as _assertInfinite, assertInRange as _assertInRange, assertInt16Array as _assertInt16Array, assertInt32Array as _assertInt32Array, assertInt8Array as _assertInt8Array, assertInteger as _assertInteger, assertIterable as _assertIterable, assertMap as _assertMap, assertNan as _assertNan, assertNativePromise as _assertNativePromise, assertNegativeNumber as _assertNegativeNumber, assertNodeStream as _assertNodeStream, assertNonEmptyArray as _assertNonEmptyArray, assertNonEmptyMap as _assertNonEmptyMap, assertNonEmptyObject as _assertNonEmptyObject, assertNonEmptySet as _assertNonEmptySet, assertNonEmptyString as _assertNonEmptyString, assertNonEmptyStringAndNotWhitespace as _assertNonEmptyStringAndNotWhitespace, assertNull as _assertNull, assertNullOrUndefined as _assertNullOrUndefined, assertNumber as _assertNumber, assertNumericString as _assertNumericString, assertObject as _assertObject, assertObservable as _assertObservable, assertOddInteger as _assertOddInteger, assertPlainObject as _assertPlainObject, assertPositiveNumber as _assertPositiveNumber, assertPrimitive as _assertPrimitive, assertPromise as _assertPromise, assertPropertyKey as _assertPropertyKey, assertRegExp as _assertRegExp, assertSafeInteger as _assertSafeInteger, assertSet as _assertSet, assertSharedArrayBuffer as _assertSharedArrayBuffer, assertString as _assertString, assertSymbol as _assertSymbol, assertTruthy as _assertTruthy, assertTupleLike as _assertTupleLike, assertTypedArray as _assertTypedArray, assertUint16Array as _assertUint16Array, assertUint32Array as _assertUint32Array, assertUint8Array as _assertUint8Array, assertUint8ClampedArray as _assertUint8ClampedArray, assertUndefined as _assertUndefined, assertUrlInstance as _assertUrlInstance, assertUrlSearchParams as _assertUrlSearchParams, assertUrlString as _assertUrlString, assertValidDate as _assertValidDate, assertValidLength as _assertValidLength, assertWeakMap as _assertWeakMap, assertWeakRef as _assertWeakRef, assertWeakSet as _assertWeakSet, assertWhitespaceString as _assertWhitespaceString } from '@sindresorhus/is';
|
|
2
|
+
/**
|
|
3
|
+
* @function
|
|
4
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
5
|
+
*/
|
|
6
|
+
export declare const assert: typeof _assert;
|
|
7
|
+
/**
|
|
8
|
+
* @function
|
|
9
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
10
|
+
*/
|
|
11
|
+
export declare const assertAll: typeof _assertAll;
|
|
12
|
+
/**
|
|
13
|
+
* @function
|
|
14
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
15
|
+
*/
|
|
16
|
+
export declare const assertAny: typeof _assertAny;
|
|
17
|
+
/**
|
|
18
|
+
* @function
|
|
19
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
20
|
+
*/
|
|
21
|
+
export declare const assertArray: typeof _assertArray;
|
|
22
|
+
/**
|
|
23
|
+
* @function
|
|
24
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
25
|
+
*/
|
|
26
|
+
export declare const assertArrayBuffer: typeof _assertArrayBuffer;
|
|
27
|
+
/**
|
|
28
|
+
* @function
|
|
29
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
30
|
+
*/
|
|
31
|
+
export declare const assertArrayLike: typeof _assertArrayLike;
|
|
32
|
+
/**
|
|
33
|
+
* @function
|
|
34
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
35
|
+
*/
|
|
36
|
+
export declare const assertAsyncFunction: typeof _assertAsyncFunction;
|
|
37
|
+
/**
|
|
38
|
+
* @function
|
|
39
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
40
|
+
*/
|
|
41
|
+
export declare const assertAsyncGenerator: typeof _assertAsyncGenerator;
|
|
42
|
+
/**
|
|
43
|
+
* @function
|
|
44
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
45
|
+
*/
|
|
46
|
+
export declare const assertAsyncGeneratorFunction: typeof _assertAsyncGeneratorFunction;
|
|
47
|
+
/**
|
|
48
|
+
* @function
|
|
49
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
50
|
+
*/
|
|
51
|
+
export declare const assertAsyncIterable: typeof _assertAsyncIterable;
|
|
52
|
+
/**
|
|
53
|
+
* @function
|
|
54
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
55
|
+
*/
|
|
56
|
+
export declare const assertBigint: typeof _assertBigint;
|
|
57
|
+
/**
|
|
58
|
+
* @function
|
|
59
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
60
|
+
*/
|
|
61
|
+
export declare const assertBigInt64Array: typeof _assertBigInt64Array;
|
|
62
|
+
/**
|
|
63
|
+
* @function
|
|
64
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
65
|
+
*/
|
|
66
|
+
export declare const assertBigUint64Array: typeof _assertBigUint64Array;
|
|
67
|
+
/**
|
|
68
|
+
* @function
|
|
69
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
70
|
+
*/
|
|
71
|
+
export declare const assertBlob: typeof _assertBlob;
|
|
72
|
+
/**
|
|
73
|
+
* @function
|
|
74
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
75
|
+
*/
|
|
76
|
+
export declare const assertBoolean: typeof _assertBoolean;
|
|
77
|
+
/**
|
|
78
|
+
* @function
|
|
79
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
80
|
+
*/
|
|
81
|
+
export declare const assertBoundFunction: typeof _assertBoundFunction;
|
|
82
|
+
/**
|
|
83
|
+
* @function
|
|
84
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
85
|
+
*/
|
|
86
|
+
export declare const assertBuffer: typeof _assertBuffer;
|
|
87
|
+
/**
|
|
88
|
+
* @function
|
|
89
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
90
|
+
*/
|
|
91
|
+
export declare const assertClass: typeof _assertClass;
|
|
92
|
+
/**
|
|
93
|
+
* @function
|
|
94
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
95
|
+
*/
|
|
96
|
+
export declare const assertDataView: typeof _assertDataView;
|
|
97
|
+
/**
|
|
98
|
+
* @function
|
|
99
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
100
|
+
*/
|
|
101
|
+
export declare const assertDate: typeof _assertDate;
|
|
102
|
+
/**
|
|
103
|
+
* @function
|
|
104
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
105
|
+
*/
|
|
106
|
+
export declare const assertDirectInstanceOf: typeof _assertDirectInstanceOf;
|
|
107
|
+
/**
|
|
108
|
+
* @function
|
|
109
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
110
|
+
*/
|
|
111
|
+
export declare const assertEmptyArray: typeof _assertEmptyArray;
|
|
112
|
+
/**
|
|
113
|
+
* @function
|
|
114
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
115
|
+
*/
|
|
116
|
+
export declare const assertEmptyMap: typeof _assertEmptyMap;
|
|
117
|
+
/**
|
|
118
|
+
* @function
|
|
119
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
120
|
+
*/
|
|
121
|
+
export declare const assertEmptyObject: typeof _assertEmptyObject;
|
|
122
|
+
/**
|
|
123
|
+
* @function
|
|
124
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
125
|
+
*/
|
|
126
|
+
export declare const assertEmptySet: typeof _assertEmptySet;
|
|
127
|
+
/**
|
|
128
|
+
* @function
|
|
129
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
130
|
+
*/
|
|
131
|
+
export declare const assertEmptyString: typeof _assertEmptyString;
|
|
132
|
+
/**
|
|
133
|
+
* @function
|
|
134
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
135
|
+
*/
|
|
136
|
+
export declare const assertEmptyStringOrWhitespace: typeof _assertEmptyStringOrWhitespace;
|
|
137
|
+
/**
|
|
138
|
+
* @function
|
|
139
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
140
|
+
*/
|
|
141
|
+
export declare const assertEnumCase: typeof _assertEnumCase;
|
|
142
|
+
/**
|
|
143
|
+
* @function
|
|
144
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
145
|
+
*/
|
|
146
|
+
export declare const assertError: typeof _assertError;
|
|
147
|
+
/**
|
|
148
|
+
* @function
|
|
149
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
150
|
+
*/
|
|
151
|
+
export declare const assertEvenInteger: typeof _assertEvenInteger;
|
|
152
|
+
/**
|
|
153
|
+
* @function
|
|
154
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
155
|
+
*/
|
|
156
|
+
export declare const assertFalsy: typeof _assertFalsy;
|
|
157
|
+
/**
|
|
158
|
+
* @function
|
|
159
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
160
|
+
*/
|
|
161
|
+
export declare const assertFloat32Array: typeof _assertFloat32Array;
|
|
162
|
+
/**
|
|
163
|
+
* @function
|
|
164
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
165
|
+
*/
|
|
166
|
+
export declare const assertFloat64Array: typeof _assertFloat64Array;
|
|
167
|
+
/**
|
|
168
|
+
* @function
|
|
169
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
170
|
+
*/
|
|
171
|
+
export declare const assertFormData: typeof _assertFormData;
|
|
172
|
+
/**
|
|
173
|
+
* @function
|
|
174
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
175
|
+
*/
|
|
176
|
+
export declare const assertFunction: typeof _assertFunction;
|
|
177
|
+
/**
|
|
178
|
+
* @function
|
|
179
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
180
|
+
*/
|
|
181
|
+
export declare const assertGenerator: typeof _assertGenerator;
|
|
182
|
+
/**
|
|
183
|
+
* @function
|
|
184
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
185
|
+
*/
|
|
186
|
+
export declare const assertGeneratorFunction: typeof _assertGeneratorFunction;
|
|
187
|
+
/**
|
|
188
|
+
* @function
|
|
189
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
190
|
+
*/
|
|
191
|
+
export declare const assertHtmlElement: typeof _assertHtmlElement;
|
|
192
|
+
/**
|
|
193
|
+
* @function
|
|
194
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
195
|
+
*/
|
|
196
|
+
export declare const assertInfinite: typeof _assertInfinite;
|
|
197
|
+
/**
|
|
198
|
+
* @function
|
|
199
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
200
|
+
*/
|
|
201
|
+
export declare const assertInRange: typeof _assertInRange;
|
|
202
|
+
/**
|
|
203
|
+
* @function
|
|
204
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
205
|
+
*/
|
|
206
|
+
export declare const assertInt16Array: typeof _assertInt16Array;
|
|
207
|
+
/**
|
|
208
|
+
* @function
|
|
209
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
210
|
+
*/
|
|
211
|
+
export declare const assertInt32Array: typeof _assertInt32Array;
|
|
212
|
+
/**
|
|
213
|
+
* @function
|
|
214
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
215
|
+
*/
|
|
216
|
+
export declare const assertInt8Array: typeof _assertInt8Array;
|
|
217
|
+
/**
|
|
218
|
+
* @function
|
|
219
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
220
|
+
*/
|
|
221
|
+
export declare const assertInteger: typeof _assertInteger;
|
|
222
|
+
/**
|
|
223
|
+
* @function
|
|
224
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
225
|
+
*/
|
|
226
|
+
export declare const assertIterable: typeof _assertIterable;
|
|
227
|
+
/**
|
|
228
|
+
* @function
|
|
229
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
230
|
+
*/
|
|
231
|
+
export declare const assertMap: typeof _assertMap;
|
|
232
|
+
/**
|
|
233
|
+
* @function
|
|
234
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
235
|
+
*/
|
|
236
|
+
export declare const assertNan: typeof _assertNan;
|
|
237
|
+
/**
|
|
238
|
+
* @function
|
|
239
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
240
|
+
*/
|
|
241
|
+
export declare const assertNativePromise: typeof _assertNativePromise;
|
|
242
|
+
/**
|
|
243
|
+
* @function
|
|
244
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
245
|
+
*/
|
|
246
|
+
export declare const assertNegativeNumber: typeof _assertNegativeNumber;
|
|
247
|
+
/**
|
|
248
|
+
* @function
|
|
249
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
250
|
+
*/
|
|
251
|
+
export declare const assertNodeStream: typeof _assertNodeStream;
|
|
252
|
+
/**
|
|
253
|
+
* @function
|
|
254
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
255
|
+
*/
|
|
256
|
+
export declare const assertNonEmptyArray: typeof _assertNonEmptyArray;
|
|
257
|
+
/**
|
|
258
|
+
* @function
|
|
259
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
260
|
+
*/
|
|
261
|
+
export declare const assertNonEmptyMap: typeof _assertNonEmptyMap;
|
|
262
|
+
/**
|
|
263
|
+
* @function
|
|
264
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
265
|
+
*/
|
|
266
|
+
export declare const assertNonEmptyObject: typeof _assertNonEmptyObject;
|
|
267
|
+
/**
|
|
268
|
+
* @function
|
|
269
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
270
|
+
*/
|
|
271
|
+
export declare const assertNonEmptySet: typeof _assertNonEmptySet;
|
|
272
|
+
/**
|
|
273
|
+
* @function
|
|
274
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
275
|
+
*/
|
|
276
|
+
export declare const assertNonEmptyString: typeof _assertNonEmptyString;
|
|
277
|
+
/**
|
|
278
|
+
* @function
|
|
279
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
280
|
+
*/
|
|
281
|
+
export declare const assertNonEmptyStringAndNotWhitespace: typeof _assertNonEmptyStringAndNotWhitespace;
|
|
282
|
+
/**
|
|
283
|
+
* @function
|
|
284
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
285
|
+
*/
|
|
286
|
+
export declare const assertNull: typeof _assertNull;
|
|
287
|
+
/**
|
|
288
|
+
* @function
|
|
289
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
290
|
+
*/
|
|
291
|
+
export declare const assertNullOrUndefined: typeof _assertNullOrUndefined;
|
|
292
|
+
/**
|
|
293
|
+
* @function
|
|
294
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
295
|
+
*/
|
|
296
|
+
export declare const assertNumber: typeof _assertNumber;
|
|
297
|
+
/**
|
|
298
|
+
* @function
|
|
299
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
300
|
+
*/
|
|
301
|
+
export declare const assertNumericString: typeof _assertNumericString;
|
|
302
|
+
/**
|
|
303
|
+
* @function
|
|
304
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
305
|
+
*/
|
|
306
|
+
export declare const assertObject: typeof _assertObject;
|
|
307
|
+
/**
|
|
308
|
+
* @function
|
|
309
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
310
|
+
*/
|
|
311
|
+
export declare const assertObservable: typeof _assertObservable;
|
|
312
|
+
/**
|
|
313
|
+
* @function
|
|
314
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
315
|
+
*/
|
|
316
|
+
export declare const assertOddInteger: typeof _assertOddInteger;
|
|
317
|
+
/**
|
|
318
|
+
* @function
|
|
319
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
320
|
+
*/
|
|
321
|
+
export declare const assertPlainObject: typeof _assertPlainObject;
|
|
322
|
+
/**
|
|
323
|
+
* @function
|
|
324
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
325
|
+
*/
|
|
326
|
+
export declare const assertPositiveNumber: typeof _assertPositiveNumber;
|
|
327
|
+
/**
|
|
328
|
+
* @function
|
|
329
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
330
|
+
*/
|
|
331
|
+
export declare const assertPrimitive: typeof _assertPrimitive;
|
|
332
|
+
/**
|
|
333
|
+
* @function
|
|
334
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
335
|
+
*/
|
|
336
|
+
export declare const assertPromise: typeof _assertPromise;
|
|
337
|
+
/**
|
|
338
|
+
* @function
|
|
339
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
340
|
+
*/
|
|
341
|
+
export declare const assertPropertyKey: typeof _assertPropertyKey;
|
|
342
|
+
/**
|
|
343
|
+
* @function
|
|
344
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
345
|
+
*/
|
|
346
|
+
export declare const assertRegExp: typeof _assertRegExp;
|
|
347
|
+
/**
|
|
348
|
+
* @function
|
|
349
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
350
|
+
*/
|
|
351
|
+
export declare const assertSafeInteger: typeof _assertSafeInteger;
|
|
352
|
+
/**
|
|
353
|
+
* @function
|
|
354
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
355
|
+
*/
|
|
356
|
+
export declare const assertSet: typeof _assertSet;
|
|
357
|
+
/**
|
|
358
|
+
* @function
|
|
359
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
360
|
+
*/
|
|
361
|
+
export declare const assertSharedArrayBuffer: typeof _assertSharedArrayBuffer;
|
|
362
|
+
/**
|
|
363
|
+
* @function
|
|
364
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
365
|
+
*/
|
|
366
|
+
export declare const assertString: typeof _assertString;
|
|
367
|
+
/**
|
|
368
|
+
* @function
|
|
369
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
370
|
+
*/
|
|
371
|
+
export declare const assertSymbol: typeof _assertSymbol;
|
|
372
|
+
/**
|
|
373
|
+
* @function
|
|
374
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
375
|
+
*/
|
|
376
|
+
export declare const assertTruthy: typeof _assertTruthy;
|
|
377
|
+
/**
|
|
378
|
+
* @function
|
|
379
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
380
|
+
*/
|
|
381
|
+
export declare const assertTupleLike: typeof _assertTupleLike;
|
|
382
|
+
/**
|
|
383
|
+
* @function
|
|
384
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
385
|
+
*/
|
|
386
|
+
export declare const assertTypedArray: typeof _assertTypedArray;
|
|
387
|
+
/**
|
|
388
|
+
* @function
|
|
389
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
390
|
+
*/
|
|
391
|
+
export declare const assertUint16Array: typeof _assertUint16Array;
|
|
392
|
+
/**
|
|
393
|
+
* @function
|
|
394
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
395
|
+
*/
|
|
396
|
+
export declare const assertUint32Array: typeof _assertUint32Array;
|
|
397
|
+
/**
|
|
398
|
+
* @function
|
|
399
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
400
|
+
*/
|
|
401
|
+
export declare const assertUint8Array: typeof _assertUint8Array;
|
|
402
|
+
/**
|
|
403
|
+
* @function
|
|
404
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
405
|
+
*/
|
|
406
|
+
export declare const assertUint8ClampedArray: typeof _assertUint8ClampedArray;
|
|
407
|
+
/**
|
|
408
|
+
* @function
|
|
409
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
410
|
+
*/
|
|
411
|
+
export declare const assertUndefined: typeof _assertUndefined;
|
|
412
|
+
/**
|
|
413
|
+
* @function
|
|
414
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
415
|
+
*/
|
|
416
|
+
export declare const assertUrlInstance: typeof _assertUrlInstance;
|
|
417
|
+
/**
|
|
418
|
+
* @function
|
|
419
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
420
|
+
*/
|
|
421
|
+
export declare const assertUrlSearchParams: typeof _assertUrlSearchParams;
|
|
422
|
+
/**
|
|
423
|
+
* @function
|
|
424
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
425
|
+
*/
|
|
426
|
+
export declare const assertUrlString: typeof _assertUrlString;
|
|
427
|
+
/**
|
|
428
|
+
* @function
|
|
429
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
430
|
+
*/
|
|
431
|
+
export declare const assertValidDate: typeof _assertValidDate;
|
|
432
|
+
/**
|
|
433
|
+
* @function
|
|
434
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
435
|
+
*/
|
|
436
|
+
export declare const assertValidLength: typeof _assertValidLength;
|
|
437
|
+
/**
|
|
438
|
+
* @function
|
|
439
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
440
|
+
*/
|
|
441
|
+
export declare const assertWeakMap: typeof _assertWeakMap;
|
|
442
|
+
/**
|
|
443
|
+
* @function
|
|
444
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
445
|
+
*/
|
|
446
|
+
export declare const assertWeakRef: typeof _assertWeakRef;
|
|
447
|
+
/**
|
|
448
|
+
* @function
|
|
449
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
450
|
+
*/
|
|
451
|
+
export declare const assertWeakSet: typeof _assertWeakSet;
|
|
452
|
+
/**
|
|
453
|
+
* @function
|
|
454
|
+
* @see [\@sindresorhus/is](https://www.npmjs.com/package/\@sindresorhus/is) package
|
|
455
|
+
*/
|
|
456
|
+
export declare const assertWhitespaceString: typeof _assertWhitespaceString;
|
|
457
|
+
export default assert;
|