cypress 15.8.2 → 15.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/errors.js CHANGED
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.errors = exports.exitWithError = exports.throwFormErrorText = exports.raise = exports.hr = void 0;
15
+ exports.errors = exports.exitWithError = exports.throwFormErrorText = void 0;
16
16
  exports.getError = getError;
17
17
  exports.formErrorText = formErrorText;
18
18
  const chalk_1 = __importDefault(require("chalk"));
@@ -26,7 +26,7 @@ const requiredDependenciesUrl = `${docsUrl}/required-dependencies`;
26
26
  const runDocumentationUrl = `${docsUrl}/cypress-run`;
27
27
  // TODO it would be nice if all error objects could be enforced via types
28
28
  // to only have description + solution properties
29
- exports.hr = '----------';
29
+ const hr = '----------';
30
30
  const genericErrorSolution = (0, common_tags_1.stripIndent) `
31
31
  Search for an existing issue or open a GitHub issue at
32
32
 
@@ -152,11 +152,11 @@ const invalidSmokeTestDisplayError = {
152
152
 
153
153
  The error logs we received were:
154
154
 
155
- ${exports.hr}
155
+ ${hr}
156
156
 
157
157
  ${msg}
158
158
 
159
- ${exports.hr}
159
+ ${hr}
160
160
 
161
161
  This may be due to a missing library or dependency. ${chalk_1.default.blue(requiredDependenciesUrl)}
162
162
 
@@ -306,7 +306,7 @@ function formErrorText(info, msg, prevMessage) {
306
306
  `);
307
307
  if (msg) {
308
308
  add(`
309
- ${exports.hr}
309
+ ${hr}
310
310
 
311
311
  ${msg}
312
312
 
@@ -314,14 +314,14 @@ function formErrorText(info, msg, prevMessage) {
314
314
  }
315
315
  }
316
316
  add(`
317
- ${exports.hr}
317
+ ${hr}
318
318
 
319
319
  ${infoWithPlatform.platform}
320
320
  `);
321
321
  if (infoWithPlatform.footer) {
322
322
  add(`
323
323
 
324
- ${exports.hr}
324
+ ${hr}
325
325
 
326
326
  ${infoWithPlatform.footer}
327
327
  `);
@@ -339,11 +339,10 @@ const raise = (info) => {
339
339
  throw err;
340
340
  };
341
341
  };
342
- exports.raise = raise;
343
342
  const throwFormErrorText = (info) => {
344
343
  return (msg, prevMessage) => __awaiter(void 0, void 0, void 0, function* () {
345
344
  const errorText = yield formErrorText(info, msg, prevMessage);
346
- (0, exports.raise)(info)(errorText);
345
+ raise(info)(errorText);
347
346
  });
348
347
  };
349
348
  exports.throwFormErrorText = throwFormErrorText;
@@ -356,7 +355,6 @@ exports.throwFormErrorText = throwFormErrorText;
356
355
  const exitWithError = (info) => {
357
356
  return (msg) => __awaiter(void 0, void 0, void 0, function* () {
358
357
  const text = yield formErrorText(info, msg);
359
- // eslint-disable-next-line no-console
360
358
  console.error(text);
361
359
  process.exit(info.exitCode || 1);
362
360
  });
package/dist/exec/open.js CHANGED
@@ -12,7 +12,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.start = exports.processOpenOptions = void 0;
16
15
  const debug_1 = __importDefault(require("debug"));
17
16
  const util_1 = __importDefault(require("../util"));
18
17
  const spawn_1 = require("./spawn");
@@ -73,11 +72,10 @@ const processOpenOptions = (options = {}) => {
73
72
  debug('command line arguments %j', args);
74
73
  return args;
75
74
  };
76
- exports.processOpenOptions = processOpenOptions;
77
75
  const start = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (options = {}) {
78
76
  function open() {
79
77
  try {
80
- const args = (0, exports.processOpenOptions)(options);
78
+ const args = processOpenOptions(options);
81
79
  return (0, spawn_1.start)(args, {
82
80
  dev: options.dev,
83
81
  detached: Boolean(options.detached),
@@ -96,8 +94,7 @@ const start = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (o
96
94
  yield (0, verify_1.start)();
97
95
  return open();
98
96
  });
99
- exports.start = start;
100
97
  exports.default = {
101
- start: exports.start,
102
- processOpenOptions: exports.processOpenOptions,
98
+ start,
99
+ processOpenOptions,
103
100
  };
@@ -16,6 +16,7 @@
16
16
  "@rollup/plugin-commonjs": "^17.1.0",
17
17
  "@rollup/plugin-node-resolve": "^11.2.1",
18
18
  "eslint": "^9.31.0",
19
+ "lodash": "^4.17.21",
19
20
  "rollup": "3.29.5",
20
21
  "rollup-plugin-dts": "5.0.0",
21
22
  "rollup-plugin-typescript2": "^0.29.0",
@@ -16,6 +16,7 @@
16
16
  "@rollup/plugin-commonjs": "^17.1.0",
17
17
  "@rollup/plugin-node-resolve": "^11.2.1",
18
18
  "eslint": "^9.31.0",
19
+ "lodash": "^4.17.21",
19
20
  "rollup": "3.29.5",
20
21
  "rollup-plugin-dts": "5.0.0",
21
22
  "rollup-plugin-typescript2": "^0.29.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress",
3
- "version": "15.8.2",
3
+ "version": "15.9.0",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node dist/index.js --exec install",
@@ -132,8 +132,8 @@
132
132
  },
133
133
  "buildInfo": {
134
134
  "commitBranch": "develop",
135
- "commitSha": "09170d866873be100f1b6ee3c007babc14a24246",
136
- "commitDate": "2026-01-05T23:14:49.000Z",
135
+ "commitSha": "2b07fd10b0b4899893346b8da834cac1f2eb3eea",
136
+ "commitDate": "2026-01-12T21:04:46.000Z",
137
137
  "stable": true
138
138
  },
139
139
  "description": "Cypress is a next generation front end testing tool built for the modern web",
@@ -17,7 +17,6 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cypress/mount-utils": "0.0.0-development",
20
- "@types/semver": "7.7.1",
21
20
  "@vitejs/plugin-react": "4.6.0",
22
21
  "axios": "1.8.2",
23
22
  "cypress": "0.0.0-development",
@@ -27,10 +26,8 @@
27
26
  "react-router": "6.28.0",
28
27
  "react-router-dom": "6.28.0",
29
28
  "rollup": "3.29.5",
30
- "semver": "^7.7.3",
31
29
  "typescript": "~5.4.5",
32
- "vite": "6.3.5",
33
- "vite-plugin-require-transform": "1.0.21"
30
+ "vite": "6.3.5"
34
31
  },
35
32
  "peerDependencies": {
36
33
  "@types/react": "^18 || ^19",
@@ -17,7 +17,6 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cypress/mount-utils": "0.0.0-development",
20
- "@types/semver": "7.7.1",
21
20
  "@vitejs/plugin-react": "4.6.0",
22
21
  "axios": "1.8.2",
23
22
  "cypress": "0.0.0-development",
@@ -27,10 +26,8 @@
27
26
  "react-router": "6.28.0",
28
27
  "react-router-dom": "6.28.0",
29
28
  "rollup": "3.29.5",
30
- "semver": "^7.7.3",
31
29
  "typescript": "~5.4.5",
32
- "vite": "6.3.5",
33
- "vite-plugin-require-transform": "1.0.21"
30
+ "vite": "6.3.5"
34
31
  },
35
32
  "peerDependencies": {
36
33
  "@types/react": "^18 || ^19",
@@ -3173,6 +3173,11 @@ declare namespace Cypress {
3173
3173
  * @default false
3174
3174
  */
3175
3175
  injectDocumentDomain: boolean
3176
+ /**
3177
+ * Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially.
3178
+ * @default false
3179
+ */
3180
+ experimentalRunAllSpecs?: boolean
3176
3181
  /**
3177
3182
  * Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.
3178
3183
  * @default false
@@ -3274,11 +3279,6 @@ declare namespace Cypress {
3274
3279
  }
3275
3280
 
3276
3281
  interface EndToEndConfigOptions extends Omit<CoreConfigOptions, 'indexHtmlFile'> {
3277
- /**
3278
- * Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially.
3279
- * @default false
3280
- */
3281
- experimentalRunAllSpecs?: boolean
3282
3282
  /**
3283
3283
  * Enables support for `Cypress.require()` for including dependencies within the `cy.origin()` callback.
3284
3284
  * @default false
@@ -1,4 +1,12 @@
1
1
  import _ = require("../index");
2
+
3
+ // Helper types to reject readonly arrays
4
+ type _Eq<T, U> = (<X>() => X extends T ? 1 : 2) extends (<X>() => X extends U ? 1 : 2) ? true : false
5
+ type _IsWritable<T> = _Eq<{ [K in keyof T]: T[K] }, { -readonly [K in keyof T]: T[K] }>
6
+ type RejectReadonly<T extends _.MutableList<unknown>> = _IsWritable<T> extends true ? T : never
7
+
8
+ export {}
9
+
2
10
  declare module "../index" {
3
11
  interface LoDashStatic {
4
12
  /**
@@ -25,16 +33,17 @@ declare module "../index" {
25
33
  }
26
34
  interface LoDashStatic {
27
35
  /**
28
- * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are
36
+ * Creates an array with all falsey values removed. The values false, null, 0, 0n, "", undefined, and NaN are
29
37
  * falsey.
30
38
  *
31
39
  * @param array The array to compact.
32
40
  * @return Returns the new array of filtered values.
33
41
  */
34
- compact<T>(array: List<T | null | undefined | false | "" | 0> | null | undefined): T[];
42
+ compact<T>(array: List<T | Falsey> | null | undefined): T[];
35
43
  }
36
44
 
37
- type Truthy<T> = T extends null | undefined | false | "" | 0 ? never : T;
45
+ type Falsey = null | undefined | false | "" | 0 | 0n;
46
+ type Truthy<T> = T extends Falsey ? never : T;
38
47
  interface Collection<T> {
39
48
  /**
40
49
  * @see _.compact
@@ -53,8 +62,7 @@ declare module "../index" {
53
62
  * and/or values.
54
63
  *
55
64
  * @category Array
56
- * @param array The array to concatenate.
57
- * @param [values] The values to concatenate.
65
+ * @param [values] The array values to concatenate.
58
66
  * @returns Returns the new concatenated array.
59
67
  * @example
60
68
  *
@@ -67,7 +75,7 @@ declare module "../index" {
67
75
  * console.log(array);
68
76
  * // => [1]
69
77
  */
70
- concat<T>(array: Many<T>, ...values: Array<Many<T>>): T[];
78
+ concat<T>(...values: Array<Many<T>>): T[];
71
79
  }
72
80
  interface Primitive<T> {
73
81
  /**
@@ -107,8 +115,8 @@ declare module "../index" {
107
115
  }
108
116
  interface LoDashStatic {
109
117
  /**
110
- * Creates an array of unique array values not included in the other provided arrays using SameValueZero for
111
- * equality comparisons.
118
+ * Creates an array of `array` values not included in the other provided arrays using SameValueZero for
119
+ * equality comparisons. The order and references of result values are determined by the first array.
112
120
  *
113
121
  * @param array The array to inspect.
114
122
  * @param values The arrays of values to exclude.
@@ -130,9 +138,9 @@ declare module "../index" {
130
138
  }
131
139
  interface LoDashStatic {
132
140
  /**
133
- * This method is like _.difference except that it accepts iteratee which is invoked for each element of array
134
- * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one
135
- * argument: (value).
141
+ * This method is like _.difference except that it accepts iteratee which is invoked for each element
142
+ * of array and values to generate the criterion by which they're compared. The order and references
143
+ * of result values are determined by the first array. The iteratee is invoked with one argument: (value).
136
144
  *
137
145
  * @param array The array to inspect.
138
146
  * @param values The values to exclude.
@@ -187,9 +195,9 @@ declare module "../index" {
187
195
  }
188
196
  interface LoDashStatic {
189
197
  /**
190
- * Creates an array of unique `array` values not included in the other
191
- * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
192
- * for equality comparisons.
198
+ * This method is like _.difference except that it accepts comparator which is invoked to compare elements
199
+ * of array to values. The order and references of result values are determined by the first array. The
200
+ * comparator is invoked with two arguments: (arrVal, othVal).
193
201
  *
194
202
  * @category Array
195
203
  * @param [values] The arrays to inspect.
@@ -342,7 +350,7 @@ declare module "../index" {
342
350
  /**
343
351
  * @see _.fill
344
352
  */
345
- fill<T>(array: List<any> | null | undefined, value: T): List<T>;
353
+ fill<T, AnyList extends MutableList<any>>(array: RejectReadonly<AnyList> | null | undefined, value: T): List<T>;
346
354
  /**
347
355
  * @see _.fill
348
356
  */
@@ -350,7 +358,7 @@ declare module "../index" {
350
358
  /**
351
359
  * @see _.fill
352
360
  */
353
- fill<T, U>(array: List<U> | null | undefined, value: T, start?: number, end?: number): List<T | U>;
361
+ fill<T, UList extends MutableList<any>>(array: RejectReadonly<UList> | null | undefined, value: T, start?: number, end?: number): List<T | UList[0]>;
354
362
  }
355
363
  interface Collection<T> {
356
364
  /**
@@ -574,6 +582,7 @@ declare module "../index" {
574
582
  * @param array The array to query.
575
583
  * @return Returns the first element of array.
576
584
  */
585
+ head<T>(array: readonly [T, ...unknown[]]): T;
577
586
  head<T>(array: List<T> | null | undefined): T | undefined;
578
587
  }
579
588
  interface String {
@@ -759,15 +768,15 @@ declare module "../index" {
759
768
  * _.intersectionWith(objects, others, _.isEqual);
760
769
  * // => [{ 'x': 1, 'y': 2 }]
761
770
  */
762
- intersectionWith<T1, T2>(array: List<T1> | null | undefined, values: List<T2>, comparator: Comparator2<T1, T2>): T1[];
771
+ intersectionWith<T1, T2>(array: List<T1> | null | undefined, values: List<T2>, comparator: Comparator2<T1, T1 | T2>): T1[];
763
772
  /**
764
773
  * @see _.intersectionWith
765
774
  */
766
- intersectionWith<T1, T2, T3>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, comparator: Comparator2<T1, T2 | T3>): T1[];
775
+ intersectionWith<T1, T2, T3>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, comparator: Comparator2<T1, T1 | T2 | T3>): T1[];
767
776
  /**
768
777
  * @see _.intersectionWith
769
778
  */
770
- intersectionWith<T1, T2, T3, T4>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, ...values: Array<List<T4> | Comparator2<T1, T2 | T3 | T4>>): T1[];
779
+ intersectionWith<T1, T2, T3, T4>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, ...values: Array<List<T4> | Comparator2<T1, T1 | T2 | T3 | T4>>): T1[];
771
780
  /**
772
781
  * @see _.intersectionWith
773
782
  */
@@ -777,7 +786,7 @@ declare module "../index" {
777
786
  /**
778
787
  * @see _.intersectionWith
779
788
  */
780
- intersectionWith<T2>(values: List<T2>, comparator: Comparator2<T, T2>): Collection<T>;
789
+ intersectionWith<T2>(values: List<T2>, comparator: Comparator2<T, T | T2>): Collection<T>;
781
790
  /**
782
791
  * @see _.intersectionWith
783
792
  */
@@ -787,7 +796,7 @@ declare module "../index" {
787
796
  /**
788
797
  * @see _.intersectionWith
789
798
  */
790
- intersectionWith<T2>(values: List<T2>, comparator: Comparator2<T, T2>): CollectionChain<T>;
799
+ intersectionWith<T2>(values: List<T2>, comparator: Comparator2<T, T | T2>): CollectionChain<T>;
791
800
  /**
792
801
  * @see _.intersectionWith
793
802
  */
@@ -840,6 +849,7 @@ declare module "../index" {
840
849
  * @param array The array to query.
841
850
  * @return Returns the last element of array.
842
851
  */
852
+ last<T>(array: readonly [...unknown[], T]): T;
843
853
  last<T>(array: List<T> | null | undefined): T | undefined;
844
854
  }
845
855
  interface Collection<T> {
@@ -931,7 +941,7 @@ declare module "../index" {
931
941
  /**
932
942
  * @see _.pull
933
943
  */
934
- pull<T>(array: List<T>, ...values: T[]): List<T>;
944
+ pull<TList extends MutableList<any>>(array: RejectReadonly<TList>, ...values: TList[0][]): TList;
935
945
  }
936
946
  interface Collection<T> {
937
947
  /**
@@ -967,7 +977,7 @@ declare module "../index" {
967
977
  /**
968
978
  * @see _.pullAll
969
979
  */
970
- pullAll<T>(array: List<T>, values?: List<T>): List<T>;
980
+ pullAll<TList extends MutableList<any>>(array: RejectReadonly<TList>, values?: List<TList[0]>): TList;
971
981
  }
972
982
  interface Collection<T> {
973
983
  /**
@@ -1006,7 +1016,7 @@ declare module "../index" {
1006
1016
  /**
1007
1017
  * @see _.pullAllBy
1008
1018
  */
1009
- pullAllBy<T>(array: List<T>, values?: List<T>, iteratee?: ValueIteratee<T>): List<T>;
1019
+ pullAllBy<TList extends MutableList<any>>(array: RejectReadonly<TList>, values?: List<TList[0]>, iteratee?: ValueIteratee<TList[0]>): TList;
1010
1020
  /**
1011
1021
  * @see _.pullAllBy
1012
1022
  */
@@ -1014,7 +1024,7 @@ declare module "../index" {
1014
1024
  /**
1015
1025
  * @see _.pullAllBy
1016
1026
  */
1017
- pullAllBy<T1, T2>(array: List<T1>, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): List<T1>;
1027
+ pullAllBy<T1List extends MutableList<any>, T2>(array: RejectReadonly<T1List>, values: List<T2>, iteratee: ValueIteratee<T1List[0] | T2>): T1List;
1018
1028
  }
1019
1029
  interface Collection<T> {
1020
1030
  /**
@@ -1053,7 +1063,7 @@ declare module "../index" {
1053
1063
  /**
1054
1064
  * @see _.pullAllWith
1055
1065
  */
1056
- pullAllWith<T>(array: List<T>, values?: List<T>, comparator?: Comparator<T>): List<T>;
1066
+ pullAllWith<TList extends MutableList<any>>(array: RejectReadonly<TList>, values?: List<TList[0]>, comparator?: Comparator<TList[0]>): TList;
1057
1067
  /**
1058
1068
  * @see _.pullAllWith
1059
1069
  */
@@ -1061,7 +1071,7 @@ declare module "../index" {
1061
1071
  /**
1062
1072
  * @see _.pullAllWith
1063
1073
  */
1064
- pullAllWith<T1, T2>(array: List<T1>, values: List<T2>, comparator: Comparator2<T1, T2>): List<T1>;
1074
+ pullAllWith<T1List extends MutableList<any>, T2>(array: RejectReadonly<T1List>, values: List<T2>, comparator: Comparator2<T1List[0], T2>): T1List;
1065
1075
  }
1066
1076
  interface Collection<T> {
1067
1077
  /**
@@ -1090,7 +1100,7 @@ declare module "../index" {
1090
1100
  /**
1091
1101
  * @see _.pullAt
1092
1102
  */
1093
- pullAt<T>(array: List<T>, ...indexes: Array<Many<number>>): List<T>;
1103
+ pullAt<TList extends MutableList<any>>(array: RejectReadonly<TList>, ...indexes: Array<Many<number>>): TList;
1094
1104
  }
1095
1105
  interface Collection<T> {
1096
1106
  /**
@@ -1115,7 +1125,7 @@ declare module "../index" {
1115
1125
  * @param predicate The function invoked per iteration.
1116
1126
  * @return Returns the new array of removed elements.
1117
1127
  */
1118
- remove<T>(array: List<T>, predicate?: ListIteratee<T>): T[];
1128
+ remove<TList extends MutableList<any>>(array: RejectReadonly<TList>, predicate?: ListIteratee<TList[0]>): TList[0][];
1119
1129
  }
1120
1130
  interface Collection<T> {
1121
1131
  /**
@@ -1149,7 +1159,7 @@ declare module "../index" {
1149
1159
  * console.log(array);
1150
1160
  * // => [3, 2, 1]
1151
1161
  */
1152
- reverse<TList extends List<any>>(array: TList): TList;
1162
+ reverse<TList extends MutableList<any>>(array: RejectReadonly<TList>): TList;
1153
1163
  }
1154
1164
  interface LoDashStatic {
1155
1165
  /**
@@ -1450,6 +1460,7 @@ declare module "../index" {
1450
1460
  * @param array The array to query.
1451
1461
  * @return Returns the slice of array.
1452
1462
  */
1463
+ tail<T extends unknown[]>(array: readonly [unknown, ...T]): T;
1453
1464
  tail<T>(array: List<T> | null | undefined): T[];
1454
1465
  }
1455
1466
  interface Collection<T> {
@@ -980,7 +980,7 @@ declare module "../index" {
980
980
  /**
981
981
  * @see _.groupBy
982
982
  */
983
- groupBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<string>>;
983
+ groupBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<string[]>>;
984
984
  }
985
985
  interface CollectionChain<T> {
986
986
  /**
@@ -1153,6 +1153,10 @@ declare module "../index" {
1153
1153
  * @param iteratee The function invoked per iteration.
1154
1154
  * @return Returns the new mapped array.
1155
1155
  */
1156
+ map<T extends readonly [unknown, ...unknown[]], TResult>(collection: T, iteratee: TupleIterator<T, TResult>): { [K in keyof T]: TResult };
1157
+ /**
1158
+ * @see _.map
1159
+ */
1156
1160
  map<T, TResult>(collection: T[] | null | undefined, iteratee: ArrayIterator<T, TResult>): TResult[];
1157
1161
  /**
1158
1162
  * @see _.map
@@ -1309,7 +1313,7 @@ declare module "../index" {
1309
1313
  * @param collection The collection to iterate over.
1310
1314
  * @param [iteratees=[_.identity]] The iteratees to sort by.
1311
1315
  * @param [orders] The sort orders of `iteratees`.
1312
- * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`.
1316
+ * @param [guard] Enables use as an iteratee for functions like `_.reduce`.
1313
1317
  * @returns Returns the new sorted array.
1314
1318
  * @example
1315
1319
  *
@@ -1645,6 +1649,10 @@ declare module "../index" {
1645
1649
  * @param collection The collection to sample.
1646
1650
  * @return Returns the random element.
1647
1651
  */
1652
+ sample<T>(collection: readonly [T, ...T[]]): T;
1653
+ /**
1654
+ * @see _.sample
1655
+ */
1648
1656
  sample<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined): T | undefined;
1649
1657
  /**
1650
1658
  * @see _.sample
@@ -1,14 +1,15 @@
1
1
  import _ = require("../index");
2
- // tslint:disable-next-line:strict-export-declare-modifiers
2
+ // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers
3
3
  type GlobalPartial<T> = Partial<T>;
4
+ export const uniqueSymbol: unique symbol;
4
5
  declare module "../index" {
5
6
  type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
6
7
  type PartialObject<T> = GlobalPartial<T>;
7
- type Many<T> = T | ReadonlyArray<T>;
8
+ type Many<T> = T | readonly T[];
8
9
  type ImpChain<T> =
9
10
  T extends { __trapAny: any } ? Collection<any> & Function<any> & Object<any> & Primitive<any> & String :
10
11
  T extends null | undefined ? never :
11
- T extends string | null | undefined ? String :
12
+ T extends string ? String<T> :
12
13
  T extends (...args: any) => any ? Function<T> :
13
14
  T extends List<infer U> | null | undefined ? Collection<U> :
14
15
  T extends object | null | undefined ? Object<T> :
@@ -16,8 +17,7 @@ declare module "../index" {
16
17
  type ExpChain<T> =
17
18
  T extends { __trapAny: any } ? CollectionChain<any> & FunctionChain<any> & ObjectChain<any> & PrimitiveChain<any> & StringChain :
18
19
  T extends null | undefined ? never :
19
- T extends string ? StringChain :
20
- T extends string | null | undefined ? StringNullableChain :
20
+ T extends string ? StringChain<T> :
21
21
  T extends (...args: any) => any ? FunctionChain<T> :
22
22
  T extends List<infer U> | null | undefined ? CollectionChain<U> :
23
23
  T extends object | null | undefined ? ObjectChain<T> :
@@ -92,6 +92,7 @@ declare module "../index" {
92
92
  * upperFirst, value, and words.
93
93
  **/
94
94
  <TrapAny extends { __trapAny: any }>(value: TrapAny): Collection<any> & Function<any> & Object<any> & Primitive<any> & String;
95
+ <T extends string>(value: T): String<T>;
95
96
  <T extends null | undefined>(value: T): Primitive<T>;
96
97
  (value: string | null | undefined): String;
97
98
  <T extends (...args: any) => any>(value: T): Function<T>;
@@ -116,23 +117,23 @@ declare module "../index" {
116
117
  /**
117
118
  * The "escape" delimiter.
118
119
  **/
119
- escape?: RegExp;
120
+ escape?: RegExp | null | undefined;
120
121
  /**
121
122
  * The "evaluate" delimiter.
122
123
  **/
123
- evaluate?: RegExp;
124
+ evaluate?: RegExp | null | undefined;
124
125
  /**
125
126
  * An object to import into the template as local variables.
126
127
  */
127
- imports?: Dictionary<any>;
128
+ imports?: Dictionary<any> | undefined;
128
129
  /**
129
130
  * The "interpolate" delimiter.
130
131
  */
131
- interpolate?: RegExp;
132
+ interpolate?: RegExp | null | undefined;
132
133
  /**
133
134
  * Used to reference the data object in the template text.
134
135
  */
135
- variable?: string;
136
+ variable?: string | undefined;
136
137
  }
137
138
  /**
138
139
  * Creates a cache object to store key/value pairs.
@@ -166,7 +167,7 @@ declare module "../index" {
166
167
  /**
167
168
  * Removes all key-value entries from the map.
168
169
  */
169
- clear?: () => void;
170
+ clear?: (() => void) | undefined;
170
171
  }
171
172
  interface MapCacheConstructor {
172
173
  new (): MapCache;
@@ -189,7 +190,7 @@ declare module "../index" {
189
190
  }
190
191
  interface Function<T extends (...args: any) => any> extends LoDashImplicitWrapper<T> {
191
192
  }
192
- interface String extends LoDashImplicitWrapper<string> {
193
+ interface String<T extends string = string> extends LoDashImplicitWrapper<T> {
193
194
  }
194
195
  interface Object<T> extends LoDashImplicitWrapper<T> {
195
196
  }
@@ -199,7 +200,7 @@ declare module "../index" {
199
200
  }
200
201
  interface FunctionChain<T extends (...args: any) => any> extends LoDashExplicitWrapper<T> {
201
202
  }
202
- interface StringChain extends LoDashExplicitWrapper<string> {
203
+ interface StringChain<T extends string = string> extends LoDashExplicitWrapper<T> {
203
204
  }
204
205
  interface StringNullableChain extends LoDashExplicitWrapper<string | undefined> {
205
206
  }
@@ -212,6 +213,7 @@ declare module "../index" {
212
213
  type NotVoid = unknown;
213
214
  type IterateeShorthand<T> = PropertyName | [PropertyName, any] | PartialShallow<T>;
214
215
  type ArrayIterator<T, TResult> = (value: T, index: number, collection: T[]) => TResult;
216
+ type TupleIterator<T extends readonly unknown[], TResult> = (value: T[number], index: StringToNumber<keyof T>, collection: T) => TResult;
215
217
  type ListIterator<T, TResult> = (value: T, index: number, collection: List<T>) => TResult;
216
218
  type ListIteratee<T> = ListIterator<T, NotVoid> | IterateeShorthand<T>;
217
219
  type ListIterateeCustom<T, TResult> = ListIterator<T, TResult> | IterateeShorthand<T>;
@@ -244,6 +246,10 @@ declare module "../index" {
244
246
  type PropertyPath = Many<PropertyName>;
245
247
  /** Common interface between Arrays and jQuery objects */
246
248
  type List<T> = ArrayLike<T>;
249
+ interface MutableList<T> { // Needed since ArrayLike is readonly
250
+ length: number;
251
+ [k: number]: T;
252
+ }
247
253
  interface Dictionary<T> {
248
254
  [index: string]: T;
249
255
  }
@@ -257,6 +263,7 @@ declare module "../index" {
257
263
  type PartialShallow<T> = {
258
264
  [P in keyof T]?: T[P] extends object ? object : T[P]
259
265
  };
266
+ type StringToNumber<T> = T extends `${infer N extends number}` ? N : never;
260
267
  // For backwards compatibility
261
268
  type LoDashImplicitArrayWrapper<T> = LoDashImplicitWrapper<T[]>;
262
269
  type LoDashImplicitNillableArrayWrapper<T> = LoDashImplicitWrapper<T[] | null | undefined>;