@types/lodash 4.17.8 → 4.17.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
lodash/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for lodash (https://lodash.com).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 23 Sep 2024 18:09:31 GMT
11
+ * Last updated: Thu, 03 Oct 2024 08:39:34 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
lodash/common/array.d.ts CHANGED
@@ -574,6 +574,7 @@ declare module "../index" {
574
574
  * @param array The array to query.
575
575
  * @return Returns the first element of array.
576
576
  */
577
+ head<T>(array: readonly [T, ...unknown[]]): T;
577
578
  head<T>(array: List<T> | null | undefined): T | undefined;
578
579
  }
579
580
  interface String {
lodash/common/common.d.ts CHANGED
@@ -9,7 +9,7 @@ declare module "../index" {
9
9
  type ImpChain<T> =
10
10
  T extends { __trapAny: any } ? Collection<any> & Function<any> & Object<any> & Primitive<any> & String :
11
11
  T extends null | undefined ? never :
12
- T extends string | null | undefined ? String :
12
+ T extends string ? String<T> :
13
13
  T extends (...args: any) => any ? Function<T> :
14
14
  T extends List<infer U> | null | undefined ? Collection<U> :
15
15
  T extends object | null | undefined ? Object<T> :
@@ -17,8 +17,7 @@ declare module "../index" {
17
17
  type ExpChain<T> =
18
18
  T extends { __trapAny: any } ? CollectionChain<any> & FunctionChain<any> & ObjectChain<any> & PrimitiveChain<any> & StringChain :
19
19
  T extends null | undefined ? never :
20
- T extends string ? StringChain :
21
- T extends string | null | undefined ? StringNullableChain :
20
+ T extends string ? StringChain<T> :
22
21
  T extends (...args: any) => any ? FunctionChain<T> :
23
22
  T extends List<infer U> | null | undefined ? CollectionChain<U> :
24
23
  T extends object | null | undefined ? ObjectChain<T> :
@@ -93,6 +92,7 @@ declare module "../index" {
93
92
  * upperFirst, value, and words.
94
93
  **/
95
94
  <TrapAny extends { __trapAny: any }>(value: TrapAny): Collection<any> & Function<any> & Object<any> & Primitive<any> & String;
95
+ <T extends string>(value: T): String<T>;
96
96
  <T extends null | undefined>(value: T): Primitive<T>;
97
97
  (value: string | null | undefined): String;
98
98
  <T extends (...args: any) => any>(value: T): Function<T>;
@@ -190,7 +190,7 @@ declare module "../index" {
190
190
  }
191
191
  interface Function<T extends (...args: any) => any> extends LoDashImplicitWrapper<T> {
192
192
  }
193
- interface String extends LoDashImplicitWrapper<string> {
193
+ interface String<T extends string = string> extends LoDashImplicitWrapper<T> {
194
194
  }
195
195
  interface Object<T> extends LoDashImplicitWrapper<T> {
196
196
  }
@@ -200,7 +200,7 @@ declare module "../index" {
200
200
  }
201
201
  interface FunctionChain<T extends (...args: any) => any> extends LoDashExplicitWrapper<T> {
202
202
  }
203
- interface StringChain extends LoDashExplicitWrapper<string> {
203
+ interface StringChain<T extends string = string> extends LoDashExplicitWrapper<T> {
204
204
  }
205
205
  interface StringNullableChain extends LoDashExplicitWrapper<string | undefined> {
206
206
  }
lodash/common/seq.d.ts CHANGED
@@ -16,7 +16,7 @@ declare module "../index" {
16
16
  /**
17
17
  * @see _.chain
18
18
  */
19
- chain(value: string): StringChain;
19
+ chain<T extends string>(value: T): StringChain<T>;
20
20
  /**
21
21
  * @see _.chain
22
22
  */
@@ -48,7 +48,7 @@ declare module "../index" {
48
48
  /**
49
49
  * @see _.chain
50
50
  */
51
- chain(): StringChain;
51
+ chain<T extends string>(): StringChain<T>;
52
52
  }
53
53
  interface Object<T> {
54
54
  /**
lodash/common/string.d.ts CHANGED
@@ -198,19 +198,19 @@ declare module "../index" {
198
198
  * @param string The string to convert.
199
199
  * @return Returns the converted string.
200
200
  */
201
- lowerFirst(string?: string): string;
201
+ lowerFirst<T extends string = string>(string?: T): Uncapitalize<T>;
202
202
  }
203
203
  interface LoDashImplicitWrapper<TValue> {
204
204
  /**
205
205
  * @see _.lowerFirst
206
206
  */
207
- lowerFirst(): string;
207
+ lowerFirst(): TValue extends string ? Uncapitalize<TValue> : string;
208
208
  }
209
209
  interface LoDashExplicitWrapper<TValue> {
210
210
  /**
211
211
  * @see _.lowerFirst
212
212
  */
213
- lowerFirst(): StringChain;
213
+ lowerFirst(): StringChain<TValue extends string ? Uncapitalize<TValue> : string>;
214
214
  }
215
215
 
216
216
  interface LoDashStatic {
@@ -533,19 +533,19 @@ declare module "../index" {
533
533
  * @param string The string to convert.
534
534
  * @return Returns the lower cased string.
535
535
  */
536
- toLower(string?: string): string;
536
+ toLower<T extends string = string>(string?: T): Lowercase<T>;
537
537
  }
538
538
  interface LoDashImplicitWrapper<TValue> {
539
539
  /**
540
540
  * @see _.toLower
541
541
  */
542
- toLower(): string;
542
+ toLower(): TValue extends string ? Lowercase<TValue> : string;
543
543
  }
544
544
  interface LoDashExplicitWrapper<TValue> {
545
545
  /**
546
546
  * @see _.toLower
547
547
  */
548
- toLower(): StringChain;
548
+ toLower(): StringChain<TValue extends string ? Lowercase<TValue> : string>;
549
549
  }
550
550
 
551
551
  interface LoDashStatic {
@@ -555,19 +555,19 @@ declare module "../index" {
555
555
  * @param string The string to convert.
556
556
  * @return Returns the upper cased string.
557
557
  */
558
- toUpper(string?: string): string;
558
+ toUpper<T extends string = string>(string?: T): Uppercase<T>;
559
559
  }
560
560
  interface LoDashImplicitWrapper<TValue> {
561
561
  /**
562
562
  * @see _.toUpper
563
563
  */
564
- toUpper(): string;
564
+ toUpper(): TValue extends string ? Uppercase<TValue> : string;
565
565
  }
566
566
  interface LoDashExplicitWrapper<TValue> {
567
567
  /**
568
568
  * @see _.toUpper
569
569
  */
570
- toUpper(): StringChain;
570
+ toUpper(): StringChain<TValue extends string ? Uppercase<TValue> : string>;
571
571
  }
572
572
 
573
573
  interface LoDashStatic {
@@ -744,19 +744,19 @@ declare module "../index" {
744
744
  * @param string The string to convert.
745
745
  * @return Returns the converted string.
746
746
  */
747
- upperFirst(string?: string): string;
747
+ upperFirst<T extends string = string>(string?: T): Capitalize<T>;
748
748
  }
749
749
  interface LoDashImplicitWrapper<TValue> {
750
750
  /**
751
751
  * @see _.upperFirst
752
752
  */
753
- upperFirst(): string;
753
+ upperFirst(): TValue extends string ? Capitalize<TValue> : string;
754
754
  }
755
755
  interface LoDashExplicitWrapper<TValue> {
756
756
  /**
757
757
  * @see _.upperFirst
758
758
  */
759
- upperFirst(): StringChain;
759
+ upperFirst(): StringChain<TValue extends string ? Capitalize<TValue> : string>;
760
760
  }
761
761
 
762
762
  interface LoDashStatic {
lodash/fp.d.ts CHANGED
@@ -2066,7 +2066,7 @@ declare namespace _ {
2066
2066
  type LodashLastIndexOfFrom1x5 = (fromIndex: true|number) => number;
2067
2067
  type LodashLastIndexOfFrom1x6<T> = (value: T) => number;
2068
2068
  type LodashLowerCase = (string: string) => string;
2069
- type LodashLowerFirst = (string: string) => string;
2069
+ type LodashLowerFirst = <T extends string = string>(string: T) => Uncapitalize<T>;
2070
2070
  interface LodashLt {
2071
2071
  (value: any): LodashLt1x1;
2072
2072
  (value: lodash.__, other: any): LodashLt1x2;
@@ -4199,13 +4199,13 @@ declare namespace _ {
4199
4199
  type LodashToFinite = (value: any) => number;
4200
4200
  type LodashToInteger = (value: any) => number;
4201
4201
  type LodashToLength = (value: any) => number;
4202
- type LodashToLower = (string: string) => string;
4202
+ type LodashToLower = <T extends string = string>(string: T) => Lowercase<T>;
4203
4203
  type LodashToNumber = (value: any) => number;
4204
4204
  type LodashToPath = (value: any) => string[];
4205
4205
  type LodashToPlainObject = (value: any) => any;
4206
4206
  type LodashToSafeInteger = (value: any) => number;
4207
4207
  type LodashToString = (value: any) => string;
4208
- type LodashToUpper = (string: string) => string;
4208
+ type LodashToUpper = <T extends string = string>(string: T) => Uppercase<T>;
4209
4209
  interface LodashTransform {
4210
4210
  <T, TResult>(iteratee: lodash.MemoVoidIteratorCapped<T, TResult>): LodashTransform1x1<T, TResult>;
4211
4211
  <TResult>(iteratee: lodash.__, accumulator: TResult): LodashTransform1x2<TResult>;
@@ -4479,7 +4479,7 @@ declare namespace _ {
4479
4479
  type LodashUpdateWith1x13<T> = (path: lodash.PropertyPath) => T;
4480
4480
  type LodashUpdateWith1x14<T> = (customizer: lodash.SetWithCustomizer<T>) => T;
4481
4481
  type LodashUpperCase = (string: string) => string;
4482
- type LodashUpperFirst = (string: string) => string;
4482
+ type LodashUpperFirst = <T extends string = string>(string: T) => Capitalize<T>;
4483
4483
  interface LodashValues {
4484
4484
  <T>(object: lodash.Dictionary<T> | lodash.NumericDictionary<T> | lodash.List<T> | null | undefined): T[];
4485
4485
  <T extends object>(object: T | null | undefined): Array<T[keyof T]>;
lodash/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/lodash",
3
- "version": "4.17.8",
3
+ "version": "4.17.10",
4
4
  "description": "TypeScript definitions for lodash",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash",
6
6
  "license": "MIT",
@@ -50,6 +50,6 @@
50
50
  },
51
51
  "scripts": {},
52
52
  "dependencies": {},
53
- "typesPublisherContentHash": "a4faaa9bda478445b58a397f3f474245400ab53182914bcc8c2697130ae3afff",
53
+ "typesPublisherContentHash": "6c97e228438c94022b45a4f6177b866920ccb93a047aa0877228b95e97984060",
54
54
  "typeScriptVersion": "4.8"
55
55
  }