aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@sindresorhus/is/dist
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@sindresorhus/is/dist')
-rw-r--r--node_modules/@sindresorhus/is/dist/index.d.ts220
-rw-r--r--node_modules/@sindresorhus/is/dist/index.js418
-rw-r--r--node_modules/@sindresorhus/is/dist/types.d.ts24
-rw-r--r--node_modules/@sindresorhus/is/dist/types.js3
4 files changed, 665 insertions, 0 deletions
diff --git a/node_modules/@sindresorhus/is/dist/index.d.ts b/node_modules/@sindresorhus/is/dist/index.d.ts
new file mode 100644
index 0000000..3687767
--- /dev/null
+++ b/node_modules/@sindresorhus/is/dist/index.d.ts
@@ -0,0 +1,220 @@
+/// <reference types="node" />
+/// <reference lib="es2018" />
+/// <reference lib="dom" />
+import { Class, TypedArray, ObservableLike, Primitive } from './types';
+export { Class, TypedArray, ObservableLike, Primitive };
+declare const objectTypeNames: readonly ["Function", "Generator", "AsyncGenerator", "GeneratorFunction", "AsyncGeneratorFunction", "AsyncFunction", "Observable", "Array", "Buffer", "Object", "RegExp", "Date", "Error", "Map", "Set", "WeakMap", "WeakSet", "ArrayBuffer", "SharedArrayBuffer", "DataView", "Promise", "URL", "HTMLElement", ...("Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "BigInt64Array" | "BigUint64Array")[]];
+declare type ObjectTypeName = typeof objectTypeNames[number];
+declare const primitiveTypeNames: readonly ["null", "undefined", "string", "number", "bigint", "boolean", "symbol"];
+declare type PrimitiveTypeName = typeof primitiveTypeNames[number];
+export declare type TypeName = ObjectTypeName | PrimitiveTypeName;
+declare function is(value: unknown): TypeName;
+declare namespace is {
+ var undefined: (value: unknown) => value is undefined;
+ var string: (value: unknown) => value is string;
+ var number: (value: unknown) => value is number;
+ var bigint: (value: unknown) => value is bigint;
+ var function_: (value: unknown) => value is Function;
+ var null_: (value: unknown) => value is null;
+ var class_: (value: unknown) => value is Class<unknown, any[]>;
+ var boolean: (value: unknown) => value is boolean;
+ var symbol: (value: unknown) => value is symbol;
+ var numericString: (value: unknown) => value is string;
+ var array: <T = unknown>(value: unknown, assertion?: ((value: T) => value is T) | undefined) => value is T[];
+ var buffer: (value: unknown) => value is Buffer;
+ var nullOrUndefined: (value: unknown) => value is null | undefined;
+ var object: (value: unknown) => value is object;
+ var iterable: <T = unknown>(value: unknown) => value is IterableIterator<T>;
+ var asyncIterable: <T = unknown>(value: unknown) => value is AsyncIterableIterator<T>;
+ var generator: (value: unknown) => value is Generator<unknown, any, unknown>;
+ var asyncGenerator: (value: unknown) => value is AsyncGenerator<unknown, any, unknown>;
+ var nativePromise: <T = unknown>(value: unknown) => value is Promise<T>;
+ var promise: <T = unknown>(value: unknown) => value is Promise<T>;
+ var generatorFunction: (value: unknown) => value is GeneratorFunction;
+ var asyncGeneratorFunction: (value: unknown) => value is (...args: any[]) => Promise<unknown>;
+ var asyncFunction: <T = unknown>(value: unknown) => value is (...args: any[]) => Promise<T>;
+ var boundFunction: (value: unknown) => value is Function;
+ var regExp: (value: unknown) => value is RegExp;
+ var date: (value: unknown) => value is Date;
+ var error: (value: unknown) => value is Error;
+ var map: <Key = unknown, Value = unknown>(value: unknown) => value is Map<Key, Value>;
+ var set: <T = unknown>(value: unknown) => value is Set<T>;
+ var weakMap: <Key extends object = object, Value = unknown>(value: unknown) => value is WeakMap<Key, Value>;
+ var weakSet: (value: unknown) => value is WeakSet<object>;
+ var int8Array: (value: unknown) => value is Int8Array;
+ var uint8Array: (value: unknown) => value is Uint8Array;
+ var uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
+ var int16Array: (value: unknown) => value is Int16Array;
+ var uint16Array: (value: unknown) => value is Uint16Array;
+ var int32Array: (value: unknown) => value is Int32Array;
+ var uint32Array: (value: unknown) => value is Uint32Array;
+ var float32Array: (value: unknown) => value is Float32Array;
+ var float64Array: (value: unknown) => value is Float64Array;
+ var bigInt64Array: (value: unknown) => value is BigInt64Array;
+ var bigUint64Array: (value: unknown) => value is BigUint64Array;
+ var arrayBuffer: (value: unknown) => value is ArrayBuffer;
+ var sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
+ var dataView: (value: unknown) => value is DataView;
+ var directInstanceOf: <T>(instance: unknown, class_: Class<T, any[]>) => instance is T;
+ var urlInstance: (value: unknown) => value is URL;
+ var urlString: (value: unknown) => value is string;
+ var truthy: (value: unknown) => boolean;
+ var falsy: (value: unknown) => boolean;
+ var nan: (value: unknown) => boolean;
+ var primitive: (value: unknown) => value is Primitive;
+ var integer: (value: unknown) => value is number;
+ var safeInteger: (value: unknown) => value is number;
+ var plainObject: <Value = unknown>(value: unknown) => value is Record<string | number | symbol, Value>;
+ var typedArray: (value: unknown) => value is TypedArray;
+ var arrayLike: <T = unknown>(value: unknown) => value is ArrayLike<T>;
+ var inRange: (value: number, range: number | number[]) => value is number;
+ var domElement: (value: unknown) => value is HTMLElement;
+ var observable: (value: unknown) => value is ObservableLike;
+ var nodeStream: (value: unknown) => value is NodeStream;
+ var infinite: (value: unknown) => value is number;
+ var evenInteger: (value: number) => value is number;
+ var oddInteger: (value: number) => value is number;
+ var emptyArray: (value: unknown) => value is never[];
+ var nonEmptyArray: (value: unknown) => value is unknown[];
+ var emptyString: (value: unknown) => value is "";
+ var nonEmptyString: (value: unknown) => value is string;
+ var emptyStringOrWhitespace: (value: unknown) => value is string;
+ var emptyObject: <Key extends string | number | symbol = string>(value: unknown) => value is Record<Key, never>;
+ var nonEmptyObject: <Key extends string | number | symbol = string, Value = unknown>(value: unknown) => value is Record<Key, Value>;
+ var emptySet: (value: unknown) => value is Set<never>;
+ var nonEmptySet: <T = unknown>(value: unknown) => value is Set<T>;
+ var emptyMap: (value: unknown) => value is Map<never, never>;
+ var nonEmptyMap: <Key = unknown, Value = unknown>(value: unknown) => value is Map<Key, Value>;
+ var any: (predicate: Predicate | Predicate[], ...values: unknown[]) => boolean;
+ var all: (predicate: Predicate, ...values: unknown[]) => boolean;
+}
+declare type ObjectKey = string | number | symbol;
+export interface ArrayLike<T> {
+ readonly [index: number]: T;
+ readonly length: number;
+}
+export interface NodeStream extends NodeJS.EventEmitter {
+ pipe<T extends NodeJS.WritableStream>(destination: T, options?: {
+ end?: boolean;
+ }): T;
+}
+export declare type Predicate = (value: unknown) => boolean;
+export declare const enum AssertionTypeDescription {
+ class_ = "Class",
+ numericString = "string with a number",
+ nullOrUndefined = "null or undefined",
+ iterable = "Iterable",
+ asyncIterable = "AsyncIterable",
+ nativePromise = "native Promise",
+ urlString = "string with a URL",
+ truthy = "truthy",
+ falsy = "falsy",
+ nan = "NaN",
+ primitive = "primitive",
+ integer = "integer",
+ safeInteger = "integer",
+ plainObject = "plain object",
+ arrayLike = "array-like",
+ typedArray = "TypedArray",
+ domElement = "HTMLElement",
+ nodeStream = "Node.js Stream",
+ infinite = "infinite number",
+ emptyArray = "empty array",
+ nonEmptyArray = "non-empty array",
+ emptyString = "empty string",
+ nonEmptyString = "non-empty string",
+ emptyStringOrWhitespace = "empty string or whitespace",
+ emptyObject = "empty object",
+ nonEmptyObject = "non-empty object",
+ emptySet = "empty set",
+ nonEmptySet = "non-empty set",
+ emptyMap = "empty map",
+ nonEmptyMap = "non-empty map",
+ evenInteger = "even integer",
+ oddInteger = "odd integer",
+ directInstanceOf = "T",
+ inRange = "in range",
+ any = "predicate returns truthy for any value",
+ all = "predicate returns truthy for all values"
+}
+interface Assert {
+ undefined: (value: unknown) => asserts value is undefined;
+ string: (value: unknown) => asserts value is string;
+ number: (value: unknown) => asserts value is number;
+ bigint: (value: unknown) => asserts value is bigint;
+ function_: (value: unknown) => asserts value is Function;
+ null_: (value: unknown) => asserts value is null;
+ class_: (value: unknown) => asserts value is Class;
+ boolean: (value: unknown) => asserts value is boolean;
+ symbol: (value: unknown) => asserts value is symbol;
+ numericString: (value: unknown) => asserts value is string;
+ array: <T = unknown>(value: unknown, assertion?: (element: unknown) => asserts element is T) => asserts value is T[];
+ buffer: (value: unknown) => asserts value is Buffer;
+ nullOrUndefined: (value: unknown) => asserts value is null | undefined;
+ object: <Key extends keyof any = string, Value = unknown>(value: unknown) => asserts value is Record<Key, Value>;
+ iterable: <T = unknown>(value: unknown) => asserts value is Iterable<T>;
+ asyncIterable: <T = unknown>(value: unknown) => asserts value is AsyncIterable<T>;
+ generator: (value: unknown) => asserts value is Generator;
+ asyncGenerator: (value: unknown) => asserts value is AsyncGenerator;
+ nativePromise: <T = unknown>(value: unknown) => asserts value is Promise<T>;
+ promise: <T = unknown>(value: unknown) => asserts value is Promise<T>;
+ generatorFunction: (value: unknown) => asserts value is GeneratorFunction;
+ asyncGeneratorFunction: (value: unknown) => asserts value is AsyncGeneratorFunction;
+ asyncFunction: (value: unknown) => asserts value is Function;
+ boundFunction: (value: unknown) => asserts value is Function;
+ regExp: (value: unknown) => asserts value is RegExp;
+ date: (value: unknown) => asserts value is Date;
+ error: (value: unknown) => asserts value is Error;
+ map: <Key = unknown, Value = unknown>(value: unknown) => asserts value is Map<Key, Value>;
+ set: <T = unknown>(value: unknown) => asserts value is Set<T>;
+ weakMap: <Key extends object = object, Value = unknown>(value: unknown) => asserts value is WeakMap<Key, Value>;
+ weakSet: <T extends object = object>(value: unknown) => asserts value is WeakSet<T>;
+ int8Array: (value: unknown) => asserts value is Int8Array;
+ uint8Array: (value: unknown) => asserts value is Uint8Array;
+ uint8ClampedArray: (value: unknown) => asserts value is Uint8ClampedArray;
+ int16Array: (value: unknown) => asserts value is Int16Array;
+ uint16Array: (value: unknown) => asserts value is Uint16Array;
+ int32Array: (value: unknown) => asserts value is Int32Array;
+ uint32Array: (value: unknown) => asserts value is Uint32Array;
+ float32Array: (value: unknown) => asserts value is Float32Array;
+ float64Array: (value: unknown) => asserts value is Float64Array;
+ bigInt64Array: (value: unknown) => asserts value is BigInt64Array;
+ bigUint64Array: (value: unknown) => asserts value is BigUint64Array;
+ arrayBuffer: (value: unknown) => asserts value is ArrayBuffer;
+ sharedArrayBuffer: (value: unknown) => asserts value is SharedArrayBuffer;
+ dataView: (value: unknown) => asserts value is DataView;
+ urlInstance: (value: unknown) => asserts value is URL;
+ urlString: (value: unknown) => asserts value is string;
+ truthy: (value: unknown) => asserts value is unknown;
+ falsy: (value: unknown) => asserts value is unknown;
+ nan: (value: unknown) => asserts value is unknown;
+ primitive: (value: unknown) => asserts value is Primitive;
+ integer: (value: unknown) => asserts value is number;
+ safeInteger: (value: unknown) => asserts value is number;
+ plainObject: <Value = unknown>(value: unknown) => asserts value is Record<ObjectKey, Value>;
+ typedArray: (value: unknown) => asserts value is TypedArray;
+ arrayLike: <T = unknown>(value: unknown) => asserts value is ArrayLike<T>;
+ domElement: (value: unknown) => asserts value is HTMLElement;
+ observable: (value: unknown) => asserts value is ObservableLike;
+ nodeStream: (value: unknown) => asserts value is NodeStream;
+ infinite: (value: unknown) => asserts value is number;
+ emptyArray: (value: unknown) => asserts value is never[];
+ nonEmptyArray: (value: unknown) => asserts value is unknown[];
+ emptyString: (value: unknown) => asserts value is '';
+ nonEmptyString: (value: unknown) => asserts value is string;
+ emptyStringOrWhitespace: (value: unknown) => asserts value is string;
+ emptyObject: <Key extends keyof any = string>(value: unknown) => asserts value is Record<Key, never>;
+ nonEmptyObject: <Key extends keyof any = string, Value = unknown>(value: unknown) => asserts value is Record<Key, Value>;
+ emptySet: (value: unknown) => asserts value is Set<never>;
+ nonEmptySet: <T = unknown>(value: unknown) => asserts value is Set<T>;
+ emptyMap: (value: unknown) => asserts value is Map<never, never>;
+ nonEmptyMap: <Key = unknown, Value = unknown>(value: unknown) => asserts value is Map<Key, Value>;
+ evenInteger: (value: number) => asserts value is number;
+ oddInteger: (value: number) => asserts value is number;
+ directInstanceOf: <T>(instance: unknown, class_: Class<T>) => asserts instance is T;
+ inRange: (value: number, range: number | number[]) => asserts value is number;
+ any: (predicate: Predicate | Predicate[], ...values: unknown[]) => void | never;
+ all: (predicate: Predicate, ...values: unknown[]) => void | never;
+}
+export declare const assert: Assert;
+export default is;
diff --git a/node_modules/@sindresorhus/is/dist/index.js b/node_modules/@sindresorhus/is/dist/index.js
new file mode 100644
index 0000000..f86cf5c
--- /dev/null
+++ b/node_modules/@sindresorhus/is/dist/index.js
@@ -0,0 +1,418 @@
+"use strict";
+/// <reference lib="es2018"/>
+/// <reference lib="dom"/>
+/// <reference types="node"/>
+Object.defineProperty(exports, "__esModule", { value: true });
+const typedArrayTypeNames = [
+ 'Int8Array',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'Int16Array',
+ 'Uint16Array',
+ 'Int32Array',
+ 'Uint32Array',
+ 'Float32Array',
+ 'Float64Array',
+ 'BigInt64Array',
+ 'BigUint64Array'
+];
+function isTypedArrayName(name) {
+ return typedArrayTypeNames.includes(name);
+}
+const objectTypeNames = [
+ 'Function',
+ 'Generator',
+ 'AsyncGenerator',
+ 'GeneratorFunction',
+ 'AsyncGeneratorFunction',
+ 'AsyncFunction',
+ 'Observable',
+ 'Array',
+ 'Buffer',
+ 'Object',
+ 'RegExp',
+ 'Date',
+ 'Error',
+ 'Map',
+ 'Set',
+ 'WeakMap',
+ 'WeakSet',
+ 'ArrayBuffer',
+ 'SharedArrayBuffer',
+ 'DataView',
+ 'Promise',
+ 'URL',
+ 'HTMLElement',
+ ...typedArrayTypeNames
+];
+function isObjectTypeName(name) {
+ return objectTypeNames.includes(name);
+}
+const primitiveTypeNames = [
+ 'null',
+ 'undefined',
+ 'string',
+ 'number',
+ 'bigint',
+ 'boolean',
+ 'symbol'
+];
+function isPrimitiveTypeName(name) {
+ return primitiveTypeNames.includes(name);
+}
+// eslint-disable-next-line @typescript-eslint/ban-types
+function isOfType(type) {
+ return (value) => typeof value === type;
+}
+const { toString } = Object.prototype;
+const getObjectType = (value) => {
+ const objectTypeName = toString.call(value).slice(8, -1);
+ if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) {
+ return 'HTMLElement';
+ }
+ if (isObjectTypeName(objectTypeName)) {
+ return objectTypeName;
+ }
+ return undefined;
+};
+const isObjectOfType = (type) => (value) => getObjectType(value) === type;
+function is(value) {
+ if (value === null) {
+ return 'null';
+ }
+ switch (typeof value) {
+ case 'undefined':
+ return 'undefined';
+ case 'string':
+ return 'string';
+ case 'number':
+ return 'number';
+ case 'boolean':
+ return 'boolean';
+ case 'function':
+ return 'Function';
+ case 'bigint':
+ return 'bigint';
+ case 'symbol':
+ return 'symbol';
+ default:
+ }
+ if (is.observable(value)) {
+ return 'Observable';
+ }
+ if (is.array(value)) {
+ return 'Array';
+ }
+ if (is.buffer(value)) {
+ return 'Buffer';
+ }
+ const tagType = getObjectType(value);
+ if (tagType) {
+ return tagType;
+ }
+ if (value instanceof String || value instanceof Boolean || value instanceof Number) {
+ throw new TypeError('Please don\'t use object wrappers for primitive types');
+ }
+ return 'Object';
+}
+is.undefined = isOfType('undefined');
+is.string = isOfType('string');
+const isNumberType = isOfType('number');
+is.number = (value) => isNumberType(value) && !is.nan(value);
+is.bigint = isOfType('bigint');
+// eslint-disable-next-line @typescript-eslint/ban-types
+is.function_ = isOfType('function');
+is.null_ = (value) => value === null;
+is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
+is.boolean = (value) => value === true || value === false;
+is.symbol = isOfType('symbol');
+is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value));
+is.array = (value, assertion) => {
+ if (!Array.isArray(value)) {
+ return false;
+ }
+ if (!is.function_(assertion)) {
+ return true;
+ }
+ return value.every(assertion);
+};
+is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; };
+is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
+is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value));
+is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); };
+is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); };
+is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
+is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw);
+is.nativePromise = (value) => isObjectOfType('Promise')(value);
+const hasPromiseAPI = (value) => {
+ var _a, _b;
+ return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) &&
+ is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch);
+};
+is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
+is.generatorFunction = isObjectOfType('GeneratorFunction');
+is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction';
+is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction';
+// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types
+is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
+is.regExp = isObjectOfType('RegExp');
+is.date = isObjectOfType('Date');
+is.error = isObjectOfType('Error');
+is.map = (value) => isObjectOfType('Map')(value);
+is.set = (value) => isObjectOfType('Set')(value);
+is.weakMap = (value) => isObjectOfType('WeakMap')(value);
+is.weakSet = (value) => isObjectOfType('WeakSet')(value);
+is.int8Array = isObjectOfType('Int8Array');
+is.uint8Array = isObjectOfType('Uint8Array');
+is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');
+is.int16Array = isObjectOfType('Int16Array');
+is.uint16Array = isObjectOfType('Uint16Array');
+is.int32Array = isObjectOfType('Int32Array');
+is.uint32Array = isObjectOfType('Uint32Array');
+is.float32Array = isObjectOfType('Float32Array');
+is.float64Array = isObjectOfType('Float64Array');
+is.bigInt64Array = isObjectOfType('BigInt64Array');
+is.bigUint64Array = isObjectOfType('BigUint64Array');
+is.arrayBuffer = isObjectOfType('ArrayBuffer');
+is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');
+is.dataView = isObjectOfType('DataView');
+is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype;
+is.urlInstance = (value) => isObjectOfType('URL')(value);
+is.urlString = (value) => {
+ if (!is.string(value)) {
+ return false;
+ }
+ try {
+ new URL(value); // eslint-disable-line no-new
+ return true;
+ }
+ catch (_a) {
+ return false;
+ }
+};
+// TODO: Use the `not` operator with a type guard here when it's available.
+// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);`
+is.truthy = (value) => Boolean(value);
+// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);`
+is.falsy = (value) => !value;
+is.nan = (value) => Number.isNaN(value);
+is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value);
+is.integer = (value) => Number.isInteger(value);
+is.safeInteger = (value) => Number.isSafeInteger(value);
+is.plainObject = (value) => {
+ // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
+ if (toString.call(value) !== '[object Object]') {
+ return false;
+ }
+ const prototype = Object.getPrototypeOf(value);
+ return prototype === null || prototype === Object.getPrototypeOf({});
+};
+is.typedArray = (value) => isTypedArrayName(getObjectType(value));
+const isValidLength = (value) => is.safeInteger(value) && value >= 0;
+is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
+is.inRange = (value, range) => {
+ if (is.number(range)) {
+ return value >= Math.min(0, range) && value <= Math.max(range, 0);
+ }
+ if (is.array(range) && range.length === 2) {
+ return value >= Math.min(...range) && value <= Math.max(...range);
+ }
+ throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
+};
+const NODE_TYPE_ELEMENT = 1;
+const DOM_PROPERTIES_TO_CHECK = [
+ 'innerHTML',
+ 'ownerDocument',
+ 'style',
+ 'attributes',
+ 'nodeValue'
+];
+is.domElement = (value) => {
+ return is.object(value) &&
+ value.nodeType === NODE_TYPE_ELEMENT &&
+ is.string(value.nodeName) &&
+ !is.plainObject(value) &&
+ DOM_PROPERTIES_TO_CHECK.every(property => property in value);
+};
+is.observable = (value) => {
+ var _a, _b, _c, _d;
+ if (!value) {
+ return false;
+ }
+ // eslint-disable-next-line no-use-extend-native/no-use-extend-native
+ if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) {
+ return true;
+ }
+ if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) {
+ return true;
+ }
+ return false;
+};
+is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value);
+is.infinite = (value) => value === Infinity || value === -Infinity;
+const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder;
+is.evenInteger = isAbsoluteMod2(0);
+is.oddInteger = isAbsoluteMod2(1);
+is.emptyArray = (value) => is.array(value) && value.length === 0;
+is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
+is.emptyString = (value) => is.string(value) && value.length === 0;
+// TODO: Use `not ''` when the `not` operator is available.
+is.nonEmptyString = (value) => is.string(value) && value.length > 0;
+const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value);
+is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
+is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
+// TODO: Use `not` operator here to remove `Map` and `Set` from type guard:
+// - https://github.com/Microsoft/TypeScript/pull/29317
+is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
+is.emptySet = (value) => is.set(value) && value.size === 0;
+is.nonEmptySet = (value) => is.set(value) && value.size > 0;
+is.emptyMap = (value) => is.map(value) && value.size === 0;
+is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
+const predicateOnArray = (method, predicate, values) => {
+ if (!is.function_(predicate)) {
+ throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
+ }
+ if (values.length === 0) {
+ throw new TypeError('Invalid number of values');
+ }
+ return method.call(values, predicate);
+};
+is.any = (predicate, ...values) => {
+ const predicates = is.array(predicate) ? predicate : [predicate];
+ return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values));
+};
+is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
+const assertType = (condition, description, value, options = {}) => {
+ if (!condition) {
+ const { multipleValues } = options;
+ const valuesMessage = multipleValues ?
+ `received values of types ${[
+ ...new Set(value.map(singleValue => `\`${is(singleValue)}\``))
+ ].join(', ')}` :
+ `received value of type \`${is(value)}\``;
+ throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`);
+ }
+};
+exports.assert = {
+ // Unknowns.
+ undefined: (value) => assertType(is.undefined(value), 'undefined', value),
+ string: (value) => assertType(is.string(value), 'string', value),
+ number: (value) => assertType(is.number(value), 'number', value),
+ bigint: (value) => assertType(is.bigint(value), 'bigint', value),
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ function_: (value) => assertType(is.function_(value), 'Function', value),
+ null_: (value) => assertType(is.null_(value), 'null', value),
+ class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value),
+ boolean: (value) => assertType(is.boolean(value), 'boolean', value),
+ symbol: (value) => assertType(is.symbol(value), 'symbol', value),
+ numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value),
+ array: (value, assertion) => {
+ const assert = assertType;
+ assert(is.array(value), 'Array', value);
+ if (assertion) {
+ value.forEach(assertion);
+ }
+ },
+ buffer: (value) => assertType(is.buffer(value), 'Buffer', value),
+ nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value),
+ object: (value) => assertType(is.object(value), 'Object', value),
+ iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value),
+ asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value),
+ generator: (value) => assertType(is.generator(value), 'Generator', value),
+ asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value),
+ nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value),
+ promise: (value) => assertType(is.promise(value), 'Promise', value),
+ generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value),
+ asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value),
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value),
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value),
+ regExp: (value) => assertType(is.regExp(value), 'RegExp', value),
+ date: (value) => assertType(is.date(value), 'Date', value),
+ error: (value) => assertType(is.error(value), 'Error', value),
+ map: (value) => assertType(is.map(value), 'Map', value),
+ set: (value) => assertType(is.set(value), 'Set', value),
+ weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value),
+ weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value),
+ int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value),
+ uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value),
+ uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value),
+ int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value),
+ uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value),
+ int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value),
+ uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value),
+ float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value),
+ float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value),
+ bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value),
+ bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value),
+ arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value),
+ sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value),
+ dataView: (value) => assertType(is.dataView(value), 'DataView', value),
+ urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value),
+ urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value),
+ truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value),
+ falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value),
+ nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value),
+ primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value),
+ integer: (value) => assertType(is.integer(value), "integer" /* integer */, value),
+ safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value),
+ plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value),
+ typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value),
+ arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value),
+ domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value),
+ observable: (value) => assertType(is.observable(value), 'Observable', value),
+ nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value),
+ infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value),
+ emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value),
+ nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value),
+ emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value),
+ nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value),
+ emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value),
+ emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value),
+ nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value),
+ emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value),
+ nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value),
+ emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value),
+ nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value),
+ // Numbers.
+ evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value),
+ oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value),
+ // Two arguments.
+ directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance),
+ inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value),
+ // Variadic functions.
+ any: (predicate, ...values) => {
+ return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true });
+ },
+ all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true })
+};
+// Some few keywords are reserved, but we'll populate them for Node.js users
+// See https://github.com/Microsoft/TypeScript/issues/2536
+Object.defineProperties(is, {
+ class: {
+ value: is.class_
+ },
+ function: {
+ value: is.function_
+ },
+ null: {
+ value: is.null_
+ }
+});
+Object.defineProperties(exports.assert, {
+ class: {
+ value: exports.assert.class_
+ },
+ function: {
+ value: exports.assert.function_
+ },
+ null: {
+ value: exports.assert.null_
+ }
+});
+exports.default = is;
+// For CommonJS default export support
+module.exports = is;
+module.exports.default = is;
+module.exports.assert = exports.assert;
diff --git a/node_modules/@sindresorhus/is/dist/types.d.ts b/node_modules/@sindresorhus/is/dist/types.d.ts
new file mode 100644
index 0000000..a63acda
--- /dev/null
+++ b/node_modules/@sindresorhus/is/dist/types.d.ts
@@ -0,0 +1,24 @@
+/**
+Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
+*/
+export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
+/**
+Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
+*/
+export declare type Class<T = unknown, Arguments extends any[] = any[]> = new (...arguments_: Arguments) => T;
+/**
+Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
+*/
+export declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
+declare global {
+ interface SymbolConstructor {
+ readonly observable: symbol;
+ }
+}
+/**
+Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
+*/
+export interface ObservableLike {
+ subscribe(observer: (value: unknown) => void): void;
+ [Symbol.observable](): ObservableLike;
+}
diff --git a/node_modules/@sindresorhus/is/dist/types.js b/node_modules/@sindresorhus/is/dist/types.js
new file mode 100644
index 0000000..0930323
--- /dev/null
+++ b/node_modules/@sindresorhus/is/dist/types.js
@@ -0,0 +1,3 @@
+"use strict";
+// Extracted from https://github.com/sindresorhus/type-fest/blob/78019f42ea888b0cdceb41a4a78163868de57555/index.d.ts
+Object.defineProperty(exports, "__esModule", { value: true });