| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700 |
- import _ = require("../index");
- // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers, @typescript-eslint/no-unsafe-function-type
- type GlobalFunction = Function;
- declare module "../index" {
- type FunctionBase = GlobalFunction;
- interface LoDashStatic {
- /**
- * Casts value as an array if it’s not one.
- *
- * @param value The value to inspect.
- * @return Returns the cast array.
- */
- castArray<T>(value?: Many<T>): T[];
- }
- interface Collection<T> {
- /**
- * @see _.castArray
- */
- castArray(): Collection<T>;
- }
- interface String {
- /**
- * @see _.castArray
- */
- castArray(): Collection<string>;
- }
- interface Object<T> {
- /**
- * @see _.castArray
- */
- castArray(): Collection<T>;
- }
- interface Function<T extends (...args: any) => any> {
- /**
- * @see _.castArray
- */
- castArray(): Collection<T>;
- }
- interface Primitive<T> {
- /**
- * @see _.castArray
- */
- castArray(): Collection<T>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.castArray
- */
- castArray(): CollectionChain<T>;
- }
- interface StringChain {
- /**
- * @see _.castArray
- */
- castArray(): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.castArray
- */
- castArray(): CollectionChain<string | undefined>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.castArray
- */
- castArray(): CollectionChain<T>;
- }
- interface FunctionChain<T extends (...args: any) => any> {
- /**
- * @see _.castArray
- */
- castArray(): CollectionChain<T>;
- }
- interface PrimitiveChain<T> {
- /**
- * @see _.castArray
- */
- castArray(): CollectionChain<T>;
- }
- interface LoDashStatic {
- /**
- * Creates a shallow clone of value.
- *
- * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays,
- * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols,
- * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty
- * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps.
- *
- * @param value The value to clone.
- * @return Returns the cloned value.
- */
- clone<T>(value: T): T;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.clone
- */
- clone(): TValue;
- /**
- * @see _.cloneDeep
- */
- cloneDeep(): TValue;
- /**
- * @see _.cloneDeepWith
- */
- cloneDeepWith(customizer: CloneDeepWithCustomizer<TValue>): any;
- /**
- * @see _.cloneDeepWith
- */
- cloneDeepWith(): TValue;
- /**
- * @see _.cloneWith
- */
- cloneWith<TResult extends object | string | number | boolean | null>(customizer: CloneWithCustomizer<TValue, TResult>): TResult;
- /**
- * @see _.cloneWith
- */
- cloneWith<TResult>(customizer: CloneWithCustomizer<TValue, TResult | undefined>): TResult | TValue;
- /**
- * @see _.cloneWith
- */
- cloneWith(): TValue;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.clone
- */
- clone(): this;
- /**
- * @see _.cloneDeep
- */
- cloneDeep(): this;
- /**
- * @see _.cloneDeepWith
- */
- cloneDeepWith(customizer: CloneDeepWithCustomizer<TValue>): LoDashExplicitWrapper<any>;
- /**
- * @see _.cloneDeepWith
- */
- cloneDeepWith(): this;
- /**
- * @see _.cloneWith
- */
- cloneWith<TResult extends object | string | number | boolean | null>(customizer: CloneWithCustomizer<TValue, TResult>): ExpChain<TResult>;
- /**
- * @see _.cloneWith
- */
- cloneWith<TResult>(customizer: CloneWithCustomizer<TValue, TResult | undefined>): ExpChain<TResult | TValue>;
- /**
- * @see _.cloneWith
- */
- cloneWith(): this;
- }
- interface LoDashStatic {
- /**
- * This method is like _.clone except that it recursively clones value.
- *
- * @param value The value to recursively clone.
- * @return Returns the deep cloned value.
- */
- cloneDeep<T>(value: T): T;
- }
- type CloneDeepWithCustomizer<TObject> = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any;
- interface LoDashStatic {
- /**
- * This method is like _.cloneWith except that it recursively clones value.
- *
- * @param value The value to recursively clone.
- * @param customizer The function to customize cloning.
- * @return Returns the deep cloned value.
- */
- cloneDeepWith<T>(value: T, customizer: CloneDeepWithCustomizer<T>): any;
- /**
- * @see _.cloneDeepWith
- */
- cloneDeepWith<T>(value: T): T;
- }
- type CloneWithCustomizer<TValue, TResult> = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult;
- interface LoDashStatic {
- /**
- * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value.
- * If customizer returns undefined cloning is handled by the method instead.
- *
- * @param value The value to clone.
- * @param customizer The function to customize cloning.
- * @return Returns the cloned value.
- */
- cloneWith<T, TResult extends object | string | number | boolean | null>(value: T, customizer: CloneWithCustomizer<T, TResult>): TResult;
- /**
- * @see _.cloneWith
- */
- cloneWith<T, TResult>(value: T, customizer: CloneWithCustomizer<T, TResult | undefined>): TResult | T;
- /**
- * @see _.cloneWith
- */
- cloneWith<T>(value: T): T;
- }
- interface LoDashStatic {
- /**
- * Checks if object conforms to source by invoking the predicate properties of source with the
- * corresponding property values of object.
- *
- * Note: This method is equivalent to _.conforms when source is partially applied.
- */
- conformsTo<T>(object: T, source: ConformsPredicateObject<T>): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.conformsTo
- */
- conformsTo(source: ConformsPredicateObject<TValue>): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.conformsTo
- */
- conformsTo(source: ConformsPredicateObject<TValue>): PrimitiveChain<boolean>;
- }
- type CondPairNullary<R> = [() => boolean, () => R];
- type CondPairUnary<T, R> = [(val: T) => boolean, (val: T) => R];
- interface LoDashStatic {
- /**
- * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @category Lang
- * @param value The value to compare.
- * @param other The other value to compare.
- * @returns Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'fred' };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- eq(value: any, other: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.eq
- */
- eq(other: any): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.eq
- */
- eq(other: any): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is greater than other.
- *
- * @param value The value to compare.
- * @param other The other value to compare.
- * @return Returns true if value is greater than other, else false.
- */
- gt(value: any, other: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.gt
- */
- gt(other: any): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.gt
- */
- gt(other: any): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is greater than or equal to other.
- *
- * @param value The value to compare.
- * @param other The other value to compare.
- * @return Returns true if value is greater than or equal to other, else false.
- */
- gte(value: any, other: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.gte
- */
- gte(other: any): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.gte
- */
- gte(other: any): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as an arguments object.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isArguments(value?: any): value is IArguments;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isArguments
- */
- isArguments(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isArguments
- */
- isArguments(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as an Array object.
- * @param value The value to check.
- *
- * @return Returns true if value is correctly classified, else false.
- */
- isArray(value?: any): value is any[];
- /**
- * @see _.isArray
- */
- isArray<T>(value?: any): value is any[];
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isArray
- */
- isArray(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isArray
- */
- isArray(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as an ArrayBuffer object.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isArrayBuffer(value?: any): value is ArrayBuffer;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isArrayBuffer
- */
- isArrayBuffer(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isArrayBuffer
- */
- isArrayBuffer(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- isArrayLike<T extends { __lodashAnyHack: any }>(t: T): boolean;
- /**
- * @see _.isArrayLike
- */
- isArrayLike(value: ((...args: any[]) => any) | null | undefined): value is never;
- /**
- * @see _.isArrayLike
- */
- isArrayLike(value: any): value is { length: number };
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isArrayLike
- */
- isArrayLike(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isArrayLike
- */
- isArrayLike(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is an array-like object, else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
- isArrayLikeObject<T extends { __lodashAnyHack: any }>(value: T): boolean;
- /**
- * @see _.isArrayLikeObject
- */
- isArrayLikeObject(value: ((...args: any[]) => any) | FunctionBase | string | boolean | number | null | undefined): value is never;
- /**
- * @see _.isArrayLikeObject
- */
- isArrayLikeObject(value: any): value is object & { length: number };
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isArrayLikeObject
- */
- isArrayLikeObject(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isArrayLikeObject
- */
- isArrayLikeObject(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a boolean primitive or object.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isBoolean(value?: any): value is boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isBoolean
- */
- isBoolean(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isBoolean
- */
- isBoolean(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is a buffer.
- *
- * @param value The value to check.
- * @return Returns true if value is a buffer, else false.
- */
- isBuffer(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isBuffer
- */
- isBuffer(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isBuffer
- */
- isBuffer(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a Date object.
- * @param value The value to check.
- *
- * @return Returns true if value is correctly classified, else false.
- */
- isDate(value?: any): value is Date;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isDate
- */
- isDate(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isDate
- */
- isDate(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is a DOM element.
- *
- * @param value The value to check.
- * @return Returns true if value is a DOM element, else false.
- */
- isElement(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isElement
- */
- isElement(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isElement
- */
- isElement(): PrimitiveChain<boolean>;
- }
- type EmptyObject<T> = { [K in keyof T]?: never };
- type EmptyObjectOf<T> = EmptyObject<T> extends T ? EmptyObject<T> : never;
- interface LoDashStatic {
- /**
- * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
- * jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
- *
- * @param value The value to inspect.
- * @return Returns true if value is empty, else false.
- */
- isEmpty<T extends { __trapAny: any }>(value?: T): boolean;
- isEmpty(value: string): value is '';
- isEmpty(value: Map<any, any> | Set<any> | List<any> | null | undefined): boolean;
- isEmpty(value: object): boolean;
- isEmpty<T extends object>(value: T | null | undefined): value is EmptyObjectOf<T> | null | undefined;
- isEmpty(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isEmpty
- */
- isEmpty(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isEmpty
- */
- isEmpty(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent.
- *
- * **Note:** This method supports comparing arrays, array buffers, booleans,
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
- * by their own, not inherited, enumerable properties. Functions and DOM
- * nodes are **not** supported.
- *
- * @category Lang
- * @param value The value to compare.
- * @param other The other value to compare.
- * @returns Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'user': 'fred' };
- * var other = { 'user': 'fred' };
- *
- * _.isEqual(object, other);
- * // => true
- *
- * object === other;
- * // => false
- */
- isEqual(value: any, other: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isEqual
- */
- isEqual(other: any): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isEqual
- */
- isEqual(other: any): PrimitiveChain<boolean>;
- }
- type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean | undefined;
- interface LoDashStatic {
- /**
- * This method is like `_.isEqual` except that it accepts `customizer` which is
- * invoked to compare values. If `customizer` returns `undefined` comparisons are
- * handled by the method instead. The `customizer` is invoked with up to seven arguments:
- * (objValue, othValue [, index|key, object, other, stack]).
- *
- * @category Lang
- * @param value The value to compare.
- * @param other The other value to compare.
- * @param [customizer] The function to customize comparisons.
- * @returns Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, othValue) {
- * if (isGreeting(objValue) && isGreeting(othValue)) {
- * return true;
- * }
- * }
- *
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqualWith(array, other, customizer);
- * // => true
- */
- isEqualWith(value: any, other: any, customizer?: IsEqualCustomizer): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isEqualWith
- */
- isEqualWith(other: any, customizer?: IsEqualCustomizer): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isEqualWith
- */
- isEqualWith(other: any, customizer?: IsEqualCustomizer): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError
- * object.
- *
- * @param value The value to check.
- * @return Returns true if value is an error object, else false.
- */
- isError(value: any): value is Error;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isError
- */
- isError(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isError
- */
- isError(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is a finite primitive number.
- *
- * Note: This method is based on Number.isFinite.
- *
- * @param value The value to check.
- * @return Returns true if value is a finite number, else false.
- */
- isFinite(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isFinite
- */
- isFinite(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isFinite
- */
- isFinite(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is a callable function.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isFunction(value: any): value is (...args: any[]) => any;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isFunction
- */
- isFunction(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isFunction
- */
- isFunction(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is an integer.
- *
- * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger).
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is an integer, else `false`.
- * @example
- *
- * _.isInteger(3);
- * // => true
- *
- * _.isInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isInteger(Infinity);
- * // => false
- *
- * _.isInteger('3');
- * // => false
- */
- isInteger(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isInteger
- */
- isInteger(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isInteger
- */
- isInteger(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- isLength(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isLength
- */
- isLength(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isLength
- */
- isLength(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a Map object.
- *
- * @param value The value to check.
- * @returns Returns true if value is correctly classified, else false.
- */
- isMap(value?: any): value is Map<any, any>;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isMap
- */
- isMap(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isMap
- */
- isMap(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Performs a deep comparison between `object` and `source` to determine if
- * `object` contains equivalent property values.
- *
- * **Note:** This method supports comparing the same values as `_.isEqual`.
- *
- * @category Lang
- * @param object The object to inspect.
- * @param source The object of property values to match.
- * @returns Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'user': 'fred', 'age': 40 };
- *
- * _.isMatch(object, { 'age': 40 });
- * // => true
- *
- * _.isMatch(object, { 'age': 36 });
- * // => false
- */
- isMatch(object: object, source: object): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isMatch
- */
- isMatch(source: object): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isMatch
- */
- isMatch(source: object): PrimitiveChain<boolean>;
- }
- type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName, object: object, source: object) => boolean | undefined;
- interface LoDashStatic {
- /**
- * This method is like `_.isMatch` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined` comparisons
- * are handled by the method instead. The `customizer` is invoked with three
- * arguments: (objValue, srcValue, index|key, object, source).
- *
- * @category Lang
- * @param object The object to inspect.
- * @param source The object of property values to match.
- * @param [customizer] The function to customize comparisons.
- * @returns Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, srcValue) {
- * if (isGreeting(objValue) && isGreeting(srcValue)) {
- * return true;
- * }
- * }
- *
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatchWith(object, source, customizer);
- * // => true
- */
- isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isMatchWith
- */
- isMatchWith(source: object, customizer: isMatchWithCustomizer): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isMatchWith
- */
- isMatchWith(source: object, customizer: isMatchWithCustomizer): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is NaN.
- *
- * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.
- *
- * @param value The value to check.
- * @return Returns true if value is NaN, else false.
- */
- isNaN(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isNaN
- */
- isNaN(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isNaN
- */
- isNaN(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is a native function.
- * @param value The value to check.
- *
- * @return Returns true if value is a native function, else false.
- */
- isNative(value: any): value is (...args: any[]) => any;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isNative
- */
- isNative(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isNative
- */
- isNative(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is `null` or `undefined`.
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is nullish, else `false`.
- * @example
- *
- * _.isNil(null);
- * // => true
- *
- * _.isNil(void 0);
- * // => true
- *
- * _.isNil(NaN);
- * // => false
- */
- isNil(value: any): value is null | undefined;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isNil
- */
- isNil(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isNil
- */
- isNil(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is null.
- *
- * @param value The value to check.
- * @return Returns true if value is null, else false.
- */
- isNull(value: any): value is null;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isNull
- */
- isNull(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isNull
- */
- isNull(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a Number primitive or object.
- *
- * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isNumber(value?: any): value is number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isNumber
- */
- isNumber(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isNumber
- */
- isNumber(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
- * and new String(''))
- *
- * @param value The value to check.
- * @return Returns true if value is an object, else false.
- */
- isObject(value?: any): value is object;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isObject
- */
- isObject(): this is LoDashImplicitWrapper<object>;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isObject
- */
- isObject(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- isObjectLike(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isObjectLike
- */
- isObjectLike(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isObjectLike
- */
- isObjectLike(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is a plain object, that is, an object created by the Object constructor or one with a
- * [[Prototype]] of null.
- *
- * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.
- *
- * @param value The value to check.
- * @return Returns true if value is a plain object, else false.
- */
- isPlainObject(value?: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isPlainObject
- */
- isPlainObject(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isPlainObject
- */
- isPlainObject(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a RegExp object.
- * @param value The value to check.
- *
- * @return Returns true if value is correctly classified, else false.
- */
- isRegExp(value?: any): value is RegExp;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isRegExp
- */
- isRegExp(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isRegExp
- */
- isRegExp(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
- * double precision number which isn't the result of a rounded unsafe integer.
- *
- * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is a safe integer, else `false`.
- * @example
- *
- * _.isSafeInteger(3);
- * // => true
- *
- * _.isSafeInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isSafeInteger(Infinity);
- * // => false
- *
- * _.isSafeInteger('3');
- * // => false
- */
- isSafeInteger(value: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isSafeInteger
- */
- isSafeInteger(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isSafeInteger
- */
- isSafeInteger(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a Set object.
- *
- * @param value The value to check.
- * @returns Returns true if value is correctly classified, else false.
- */
- isSet(value?: any): value is Set<any>;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isSet
- */
- isSet(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isSet
- */
- isSet(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a String primitive or object.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isString(value?: any): value is string;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isString
- */
- isString(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isString
- */
- isString(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @category Lang
- * @param value The value to check.
- * @returns Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- isSymbol(value: any): value is symbol;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isSymbol
- */
- isSymbol(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isSymbol
- */
- isSymbol(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a typed array.
- *
- * @param value The value to check.
- * @return Returns true if value is correctly classified, else false.
- */
- isTypedArray(value: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isTypedArray
- */
- isTypedArray(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isTypedArray
- */
- isTypedArray(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is undefined.
- *
- * @param value The value to check.
- * @return Returns true if value is undefined, else false.
- */
- isUndefined(value: any): value is undefined;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isUndefined
- */
- isUndefined(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isUndefined
- */
- isUndefined(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a WeakMap object.
- *
- * @param value The value to check.
- * @returns Returns true if value is correctly classified, else false.
- */
- isWeakMap(value?: any): value is WeakMap<object, any>;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isWeakMap
- */
- isWeakMap(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isWeakMap
- */
- isWeakMap(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is classified as a WeakSet object.
- *
- * @param value The value to check.
- * @returns Returns true if value is correctly classified, else false.
- */
- isWeakSet(value?: any): value is WeakSet<object>;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.isWeakSet
- */
- isWeakSet(): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.isWeakSet
- */
- isWeakSet(): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is less than other.
- *
- * @param value The value to compare.
- * @param other The other value to compare.
- * @return Returns true if value is less than other, else false.
- */
- lt(value: any, other: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.lt
- */
- lt(other: any): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.lt
- */
- lt(other: any): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Checks if value is less than or equal to other.
- *
- * @param value The value to compare.
- * @param other The other value to compare.
- * @return Returns true if value is less than or equal to other, else false.
- */
- lte(value: any, other: any): boolean;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.lte
- */
- lte(other: any): boolean;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.lte
- */
- lte(other: any): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Converts value to an array.
- *
- * @param value The value to convert.
- * @return Returns the converted array.
- */
- toArray<T>(value: Dictionary<T> | NumericDictionary<T> | null | undefined): T[];
- /**
- * @see _.toArray
- */
- toArray<T>(value: T): Array<T[keyof T]>;
- /**
- * @see _.toArray
- */
- toArray(): any[];
- }
- interface String {
- /**
- * @see _.toArray
- */
- toArray(): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.toArray
- */
- toArray(): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.toArray
- */
- toArray(): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.toArray
- */
- toArray(): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.toArray
- */
- toArray(): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.toArray
- */
- toArray(): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.toArray
- */
- toArray(): CollectionChain<T[keyof T]>;
- }
- interface LoDashStatic {
- /**
- * Converts `value` to a finite number.
- *
- * @since 4.12.0
- * @category Lang
- * @param value The value to convert.
- * @returns Returns the converted number.
- * @example
- *
- * _.toFinite(3.2);
- * // => 3.2
- *
- * _.toFinite(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toFinite(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toFinite('3.2');
- * // => 3.2
- */
- toFinite(value: any): number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.toFinite
- */
- toFinite(): number;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.toFinite
- */
- toFinite(): PrimitiveChain<number>;
- }
- interface LoDashStatic {
- /**
- * Converts `value` to an integer.
- *
- * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
- *
- * @category Lang
- * @param value The value to convert.
- * @returns Returns the converted integer.
- * @example
- *
- * _.toInteger(3);
- * // => 3
- *
- * _.toInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toInteger(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toInteger('3');
- * // => 3
- */
- toInteger(value: any): number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.toInteger
- */
- toInteger(): number;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.toInteger
- */
- toInteger(): PrimitiveChain<number>;
- }
- interface LoDashStatic {
- /**
- * Converts `value` to an integer suitable for use as the length of an
- * array-like object.
- *
- * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @category Lang
- * @param value The value to convert.
- * @return Returns the converted integer.
- * @example
- *
- * _.toLength(3);
- * // => 3
- *
- * _.toLength(Number.MIN_VALUE);
- * // => 0
- *
- * _.toLength(Infinity);
- * // => 4294967295
- *
- * _.toLength('3');
- * // => 3
- */
- toLength(value: any): number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.toLength
- */
- toLength(): number;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.toLength
- */
- toLength(): PrimitiveChain<number>;
- }
- interface LoDashStatic {
- /**
- * Converts `value` to a number.
- *
- * @category Lang
- * @param value The value to process.
- * @returns Returns the number.
- * @example
- *
- * _.toNumber(3);
- * // => 3
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3');
- * // => 3
- */
- toNumber(value: any): number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.toNumber
- */
- toNumber(): number;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.toNumber
- */
- toNumber(): PrimitiveChain<number>;
- }
- interface LoDashStatic {
- /**
- * Converts value to a plain object flattening inherited enumerable properties of value to own properties
- * of the plain object.
- *
- * @param value The value to convert.
- * @return Returns the converted plain object.
- */
- toPlainObject(value?: any): any;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.toPlainObject
- */
- toPlainObject(): Object<any>;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.toPlainObject
- */
- toPlainObject(): ObjectChain<any>;
- }
- interface LoDashStatic {
- /**
- * Converts `value` to a safe integer. A safe integer can be compared and
- * represented correctly.
- *
- * @category Lang
- * @param value The value to convert.
- * @returns Returns the converted integer.
- * @example
- *
- * _.toSafeInteger(3);
- * // => 3
- *
- * _.toSafeInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toSafeInteger(Infinity);
- * // => 9007199254740991
- *
- * _.toSafeInteger('3');
- * // => 3
- */
- toSafeInteger(value: any): number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.toSafeInteger
- */
- toSafeInteger(): number;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.toSafeInteger
- */
- toSafeInteger(): PrimitiveChain<number>;
- }
- interface LoDashStatic {
- /**
- * Converts `value` to a string if it's not one. An empty string is returned
- * for `null` and `undefined` values. The sign of `-0` is preserved.
- *
- * @category Lang
- * @param value The value to process.
- * @returns Returns the string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- toString(value: any): string;
- }
- }
|