/** * @description * Checks if `value` is classified as an `Array` object. * * @example * ``` ts * isArray([]); * // => true * isArray(null); * // => false * isArray(undefined); * // => false * isArray({ length: 5 }); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is an array, else false. * * @docsCategory preference/lang * @codeFilter is-array */ export declare const isArray: (value: any) => boolean; /** * @description * Checks if `value` is classified as an `ArrayBuffer` object. * * @example * ``` ts * isArrayBuffer(new ArrayBuffer(2)); * // => true * isArrayBuffer(new Array(2)); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is an array buffer, else false. * * @docsCategory preference/lang * @codeFilter is-array-buffer */ export declare const isArrayBuffer: (value: any) => value is ArrayBuffer; /** * @description * Determine if a value is a view on an ArrayBuffer * * @example * ``` ts * isArrayBufferView(new DataView(new ArrayBuffer(2))); * // => true * ``` * * @param {Object} value The value to test * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false * * @docsCategory preference/lang * @codeFilter is-array-buffer-view */ export declare function isArrayBufferView(value: any): value is ArrayBufferView; /** * @description * Checks if `value` is classified as an `Blob` object. * * @example * ``` ts * isBlob(new Blob()); * // => true * ``` * * @param value The value to check. * @returns Returns true if value is a Blob object, else false. * * @docsCategory preference/lang * @codeFilter is-blob */ export declare const isBlob: (value: any) => value is Blob; /** * @description * Determines whether the given value is a boolean. * * @example * ``` ts * isBoolean(false); * // => true * isBoolean(() => {}); * // => false * ``` * * @param value The value to check. * @returns True if the value is a boolean, false otherwise. * * @docsCategory preference/lang * @codeFilter is-boolean */ export declare const isBoolean: (value: any) => value is boolean; /** * @description * Checks if `value` is classified as a `Date` object. * * @example * ``` ts * isDate(new Date()); * // => true * isDate(Date.now()); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a date object, else false. * * @docsCategory preference/lang * @codeFilter is-date */ export declare const isDate: (value: any) => value is Date; /** * @description * Deep comparison of two variables a and b, returning whether they are equal according to a recursive equality algorithm. * * @example * ``` ts * isDeepEqual({ a: [2, 3], b: [4] }, { a: [2, 3], b: [4] }); * // => true * isDeepEqual([null, null, null], [null, null, null]); * // => true * isDeepEqual([{ a: 3 }, { b: 4 }], [{ a: '3' }, { b: '4' }]); * // => false * isDeepEqual(NaN, 'abc'); * // => false * ``` * * @param a The a to check. * @param b The b to check. * @returns Returns true if value is a equal, else false. * * @docsCategory preference/lang * @codeFilter is-deep-equal */ export declare function isDeepEqual(a: any, b: any): boolean; /** * @description * Checks if a `value` is `empty`. * `{}, null, undefined, [] ` is empty; `0, false` is not empty. * * @example * ``` ts * isEmpty(undefined); * // => true * isEmpty([]); * // => true * isEmpty({}); * // => true * isEmpty(null); * // => true * isEmpty(0); * // => false * isEmpty(false); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a `empty`, else false. * * @docsCategory preference/lang * @codeFilter is-empty */ export declare const isEmpty: (value: any) => boolean; /** * @description * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @example * ``` ts * isError(new Error()); * // => true * isError(Error); * // => false * ``` * * @param value The value to check. * @returns Returns `true` if `value` is an error object, else `false`. * * @docsCategory preference/lang * @codeFilter is-error */ export declare const isError: (value: any) => value is Error; /** * @description * Checks if `value` is an `File` * * @example * ``` ts * const file = new File(['content'], 'filename.txt', { type: 'text/plain' }); * isFile(file); * // => true * isFile('filename.txt'); * // => false * ``` * * @param value value The value to check. * @returns Returns `true` if `value` is an File object, else `false`. * * @docsCategory preference/lang * @codeFilter is-file */ export declare const isFile: (value: any) => value is File; /** * @description * Checks if `value` is an `FormData` * * @example * ``` ts * isFormData(new FormData()); * // => true * isFormData('form'); * // => false * ``` * * @warning * Note `miniprogram` don't support `Blob`, upload please use `wx.uploadFile()` * * @param value The value to check. * @returns Returns `true` if `value` is an FormData object, else `false`. * * @docsCategory preference/lang * @codeFilter is-form-data */ export declare const isFormData: (value: any) => value is FormData; /** * @description * Checks if `value` is classified as a `Function` object. * * @example * ``` ts * isFunction(() => {}); * // => true * isFunction(undefined); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a function, else false. * * @docsCategory preference/lang * @codeFilter is-function */ export declare const isFunction: (value: any) => value is () => void; /** * @description * Checks if `value` is `NaN`. * * @example * ``` ts * isNaN(NaN); * // => true * isNaN(new Number(NaN)); * // => true * isNaN(undefined); * // => false * isNaN('1111'); * // => false * ``` * * @note * This method is based on Number.isNaN and is not the same as global isNaN which returns true for undefined and other non-number values. * * * @param value The value to check. * @returns Returns `true` if value is `NaN`, else `false`. * * @docsCategory preference/lang * @codeFilter is-nan */ declare const isNaN$1: (value: any) => value is File; /** * @description * Checks if `value` is `null`. * * @example * ``` ts * isNull(null); * // => true * isNull(undefined); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is null, else false. * * @docsCategory preference/lang * @codeFilter is-null */ export declare const isNull: (value: any) => boolean; /** * @description * Checks if `value` is classified as a `Number` primitive or object. * * @example * ``` ts * isNumber(123); * // => true * isNumber(NaN); * // => true * isNumber(Number.MIN_VALUE); * // => true * isNumber('123'); * // => false * ``` * * @note * To exclude Infinity, -Infinity, and NaN, which are classified as numbers * * @param value The value to check. * @returns Returns true if value is a number, else false. * * @docsCategory preference/lang * @codeFilter is-number */ export declare const isNumber: (value: any) => value is number; /** * @description * Checks if `value` is the language type of Object. (e.g. arrays, objects, regexes, new Number(0), and new String('')) * * @example * ``` ts * isObject(() => {}); * // => true * isObject(new A()); * // => true * isObject({}); * // => true * isObject(null); * // => false * ``` * * @param value The value to check. * @param failfn The value indicate if function is Object?, default false * @returns Returns true if value is an object, else false. * * @docsCategory preference/lang * @codeFilter is-object */ export declare const isObject: (value: any, failfn?: boolean) => boolean; /** * @description * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @example * ``` ts * isObjectLike({}); * // => true * isObjectLike([1, 2, 3]); * // => true * isObjectLike(() => ({})); * // => false * ``` * * @param value The value to check. * @returns Returns `true` if `value` is object-like, else `false`. * * @docsCategory preference/lang * @codeFilter is-object-like */ export declare const isObjectLike: (value: any) => boolean; /** * @description * Checks if `value` is a `plain object`, that is, an object created by the Object constructor or one with a [[Prototype]] of null. * * @example * ``` ts * isPlainObject({ array: [] }); * // => true * isPlainObject({}); * // => true * isPlainObject(new A()); * // => false * isPlainObject(null); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a plain object, else false. * * @docsCategory preference/lang * @codeFilter is-plain-object */ export declare const isPlainObject: (value: any) => boolean; /** * @description * Checks if `value` is a `Promise` * * @example * ``` ts * async function testAsync() { * await Promise.resolve(1); * } * * function test() { * return 1; * } * isPromise(testAsync()); * // => true * isPromise(test()); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a `Promise`, else false. * * @docsCategory preference/lang * @codeFilter is-promise */ export declare const isPromise: (value: any) => value is Promise; /** * @description * Checks if `value` is a `RegExp` * * @example * ``` ts * isRegexp(/test/); * // => true * isRegexp('test'); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a `RegExp`, else false. * * @docsCategory preference/lang * @codeFilter is-regexp */ export declare const isRegexp: (value: any) => value is RegExp; /** * @description * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. * * @example * ``` ts * isShallowEqual([1, 2, 3], [1, 2, 3]); * // => true * isShallowEqual({ a: 5, b: {} }, { a: 5, b: {} }); * // => false * ``` * * @param objA - The first object to compare. * @param objB - The second object to compare. * @returns Returns true when the values of all keys are strictly equal. * * @docsCategory preference/lang * @codeFilter is-shallow-equal * */ export declare function isShallowEqual(objA: any, objB: any): boolean; /** * @description * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * - typeof window -> undefined * - typeof document -> undefined * * react-native: * - navigator.product -> 'ReactNative' * * nativescript * - navigator.product -> 'NativeScript' or 'NS' * * @docsCategory preference/lang * @codeFilter is-standard-browser-env */ export declare function isStandardBrowserEnv(): boolean; /** * @description * Checks if `value` is classified as a `String` primitive or object. * * @example * ``` ts * isString(''); * // => true * isString(1); * // => false * isString({toString() {return '';}}) * // => false * ``` * * @param value The value to check. * @returns Returns true if value is a string, else false. * * @docsCategory preference/lang * @codeFilter is-string */ export declare const isString: (value: any) => value is string; /** * @description * Checks if value is undefined. * * @example * ``` ts * isUndefined(undefined); * // => true * isUndefined(null); * // => false * isUndefined({}); * // => false * ``` * * @param value The value to check. * @returns Returns true if value is `undefined`, else false. * * @docsCategory preference/lang * @codeFilter is-undefined */ export declare const isUndefined: (value?: any) => boolean; /** * @description * Determine if a value is a URLSearchParams object * * @example * ``` ts * isUrlSearchParams(new URLSearchParams()); * // => true * isUrlSearchParams('foo=1&bar=2'); * // => false * ``` * * @param value The value to test * @returns True if value is a URLSearchParams object, otherwise false * * @docsCategory preference/lang * @codeFilter is-url-search-params */ export declare function isUrlSearchParams(value: any): value is URLSearchParams; export { isNaN$1 as isNaN, }; export {};