type-fest 4.27.0 → 4.28.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "type-fest",
3
- "version": "4.27.0",
3
+ "version": "4.28.0",
4
4
  "description": "A collection of essential TypeScript types",
5
5
  "license": "(MIT OR CC0-1.0)",
6
6
  "repository": "sindresorhus/type-fest",
package/readme.md CHANGED
@@ -20,12 +20,6 @@
20
20
  <sup>Special thanks to:</sup>
21
21
  <br>
22
22
  <br>
23
- <a href="https://standardresume.co/tech">
24
- <img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="180"/>
25
- </a>
26
- <br>
27
- <br>
28
- <br>
29
23
  <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=type-fest&utm_source=github">
30
24
  <div>
31
25
  <img src="https://sindresorhus.com/assets/thanks/workos-logo-white-bg.svg" width="220" alt="WorkOS">
@@ -39,7 +33,6 @@
39
33
  </a>
40
34
  <br>
41
35
  <br>
42
- <br>
43
36
  <a href="https://transloadit.com?utm_source=sindresorhus&utm_medium=referral&utm_campaign=sponsorship&utm_content=type-fest">
44
37
  <picture>
45
38
  <source width="350" media="(prefers-color-scheme: dark)" srcset="https://sindresorhus.com/assets/thanks/transloadit-logo-dark.svg">
@@ -65,6 +58,15 @@
65
58
  </a>
66
59
  <br>
67
60
  <br>
61
+ <a href="https://nitric.io/?utm_campaign=github_repo&utm_medium=referral&utm_content=sindresorhus&utm_source=github">
62
+ <div>
63
+ <img width="230" src="https://sindresorhus.com/assets/thanks/nitric-logo.svg" alt="nitric logo">
64
+ </div>
65
+ <b>Effortless backends with infrastructure from code</b>
66
+ <div>
67
+ <sup>An open-source framework that supports any programming language, cloud provider, or deployment automation tool.</sup>
68
+ </div>
69
+ </a>
68
70
  </p>
69
71
  </div>
70
72
  <br>
@@ -1051,4 +1053,7 @@ You can find some examples in the [TypeScript docs](https://www.typescriptlang.o
1051
1053
 
1052
1054
  ## License
1053
1055
 
1056
+ - [MIT](license-mit)
1057
+ - [CC0-1.0](license-cc0)
1058
+
1054
1059
  SPDX-License-Identifier: (MIT OR CC0-1.0)
@@ -59,11 +59,13 @@ export type ArraySlice<
59
59
  Array_ extends readonly unknown[],
60
60
  Start extends number = never,
61
61
  End extends number = never,
62
- > = And<IsEqual<Start, never>, IsEqual<End, never>> extends true
63
- ? Array_
64
- : number extends Array_['length']
65
- ? VariableLengthArraySliceHelper<Array_, Start, End>
66
- : ArraySliceHelper<Array_, IsEqual<Start, never> extends true ? 0 : Start, IsEqual<End, never> extends true ? Array_['length'] : End>;
62
+ > = Array_ extends unknown // To distributive type
63
+ ? And<IsEqual<Start, never>, IsEqual<End, never>> extends true
64
+ ? Array_
65
+ : number extends Array_['length']
66
+ ? VariableLengthArraySliceHelper<Array_, Start, End>
67
+ : ArraySliceHelper<Array_, IsEqual<Start, never> extends true ? 0 : Start, IsEqual<End, never> extends true ? Array_['length'] : End>
68
+ : never; // Never happens
67
69
 
68
70
  type VariableLengthArraySliceHelper<
69
71
  Array_ extends readonly unknown[],
@@ -81,13 +81,10 @@ function displayPetInfo(petInfo: SharedUnionFieldsDeep<Cat | Dog>['info']) {
81
81
  @category Union
82
82
  */
83
83
  export type SharedUnionFieldsDeep<Union, Options extends SharedUnionFieldsDeepOptions = {recurseIntoArrays: false}> =
84
- // If `Union` is not a union type, return `Union` directly.
85
- IsUnion<Union> extends false
86
- ? Union
87
84
  // `Union extends` will convert `Union`
88
85
  // to a [distributive conditionaltype](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
89
86
  // But this is not what we want, so we need to wrap `Union` with `[]` to prevent it.
90
- : [Union] extends [NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>]
87
+ [Union] extends [NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>]
91
88
  ? Union
92
89
  : [Union] extends [UnknownArray]
93
90
  ? Options['recurseIntoArrays'] extends true
@@ -55,6 +55,8 @@ declare namespace TsConfigJson {
55
55
  | 'ES2020'
56
56
  | 'ES2021'
57
57
  | 'ES2022'
58
+ | 'ES2023'
59
+ | 'ES2024'
58
60
  | 'ESNext'
59
61
  // Lowercase alternatives
60
62
  | 'es3'
@@ -68,6 +70,8 @@ declare namespace TsConfigJson {
68
70
  | 'es2020'
69
71
  | 'es2021'
70
72
  | 'es2022'
73
+ | 'es2023'
74
+ | 'es2024'
71
75
  | 'esnext';
72
76
 
73
77
  // eslint-disable-next-line unicorn/prevent-abbreviations
@@ -88,6 +92,8 @@ declare namespace TsConfigJson {
88
92
  | 'ES2016'
89
93
  | 'ES2016.Array.Include'
90
94
  | 'ES2017'
95
+ | 'ES2017.ArrayBuffer'
96
+ | 'ES2017.Date'
91
97
  | 'ES2017.Intl'
92
98
  | 'ES2017.Object'
93
99
  | 'ES2017.SharedMemory'
@@ -112,6 +118,7 @@ declare namespace TsConfigJson {
112
118
  | 'ES2020.SharedMemory'
113
119
  | 'ES2020.Intl'
114
120
  | 'ES2021'
121
+ | 'ES2021.Intl'
115
122
  | 'ES2021.Promise'
116
123
  | 'ES2021.String'
117
124
  | 'ES2021.WeakRef'
@@ -120,14 +127,29 @@ declare namespace TsConfigJson {
120
127
  | 'ES2022.Error'
121
128
  | 'ES2022.Intl'
122
129
  | 'ES2022.Object'
123
- | 'ES2022.SharedMemory'
124
- | 'ES2022.String'
125
130
  | 'ES2022.RegExp'
131
+ | 'ES2022.String'
132
+ | 'ES2023'
133
+ | 'ES2023.Array'
134
+ | 'ES2023.Collection'
135
+ | 'ES2023.Intl'
136
+ | 'ES2024'
137
+ | 'ES2024.ArrayBuffer'
138
+ | 'ES2024.Collection'
139
+ | 'ES2024.Object'
140
+ | 'ES2024.Promise'
141
+ | 'ES2024.Regexp'
142
+ | 'ES2024.SharedMemory'
143
+ | 'ES2024.String'
126
144
  | 'ESNext'
127
145
  | 'ESNext.Array'
128
146
  | 'ESNext.AsyncIterable'
129
147
  | 'ESNext.BigInt'
148
+ | 'ESNext.Collection'
149
+ | 'ESNext.Decorators'
150
+ | 'ESNext.Disposable'
130
151
  | 'ESNext.Intl'
152
+ | 'ESNext.Iterator'
131
153
  | 'ESNext.Promise'
132
154
  | 'ESNext.String'
133
155
  | 'ESNext.Symbol'
@@ -136,6 +158,7 @@ declare namespace TsConfigJson {
136
158
  | 'DOM.Iterable'
137
159
  | 'ScriptHost'
138
160
  | 'WebWorker'
161
+ | 'WebWorker.AsyncIterable'
139
162
  | 'WebWorker.ImportScripts'
140
163
  | 'WebWorker.Iterable'
141
164
  // Lowercase alternatives
@@ -155,6 +178,8 @@ declare namespace TsConfigJson {
155
178
  | 'es2016'
156
179
  | 'es2016.array.include'
157
180
  | 'es2017'
181
+ | 'es2017.arraybuffer'
182
+ | 'es2017.date'
158
183
  | 'es2017.intl'
159
184
  | 'es2017.object'
160
185
  | 'es2017.sharedmemory'
@@ -179,6 +204,7 @@ declare namespace TsConfigJson {
179
204
  | 'es2020.sharedmemory'
180
205
  | 'es2020.intl'
181
206
  | 'es2021'
207
+ | 'es2021.intl'
182
208
  | 'es2021.promise'
183
209
  | 'es2021.string'
184
210
  | 'es2021.weakref'
@@ -187,14 +213,29 @@ declare namespace TsConfigJson {
187
213
  | 'es2022.error'
188
214
  | 'es2022.intl'
189
215
  | 'es2022.object'
190
- | 'es2022.sharedmemory'
191
- | 'es2022.string'
192
216
  | 'es2022.regexp'
217
+ | 'es2022.string'
218
+ | 'es2023'
219
+ | 'es2023.array'
220
+ | 'es2023.collection'
221
+ | 'es2023.intl'
222
+ | 'es2024'
223
+ | 'es2024.arraybuffer'
224
+ | 'es2024.collection'
225
+ | 'es2024.object'
226
+ | 'es2024.promise'
227
+ | 'es2024.regexp'
228
+ | 'es2024.sharedmemory'
229
+ | 'es2024.string'
193
230
  | 'esnext'
194
231
  | 'esnext.array'
195
232
  | 'esnext.asynciterable'
196
233
  | 'esnext.bigint'
234
+ | 'esnext.collection'
235
+ | 'esnext.decorators'
236
+ | 'esnext.disposable'
197
237
  | 'esnext.intl'
238
+ | 'esnext.iterator'
198
239
  | 'esnext.promise'
199
240
  | 'esnext.string'
200
241
  | 'esnext.symbol'
@@ -203,6 +244,7 @@ declare namespace TsConfigJson {
203
244
  | 'dom.iterable'
204
245
  | 'scripthost'
205
246
  | 'webworker'
247
+ | 'webworker.asynciterable'
206
248
  | 'webworker.importscripts'
207
249
  | 'webworker.iterable';
208
250
 
@@ -581,6 +623,13 @@ declare namespace TsConfigJson {
581
623
  */
582
624
  isolatedModules?: boolean;
583
625
 
626
+ /**
627
+ Require sufficient annotation on exports so other tools can trivially generate declaration files.
628
+
629
+ @default false
630
+ */
631
+ isolatedDeclarations?: boolean;
632
+
584
633
  /**
585
634
  Generates corresponding '.map' file.
586
635
 
@@ -694,6 +743,13 @@ declare namespace TsConfigJson {
694
743
  */
695
744
  noUncheckedIndexedAccess?: boolean;
696
745
 
746
+ /**
747
+ Report error if failed to find a source file for a side effect import.
748
+
749
+ @default false
750
+ */
751
+ noUncheckedSideEffectImports?: boolean;
752
+
697
753
  /**
698
754
  Report errors for fallthrough cases in switch statement.
699
755
 
@@ -729,6 +785,11 @@ declare namespace TsConfigJson {
729
785
  */
730
786
  generateCpuProfile?: string;
731
787
 
788
+ /**
789
+ Generates an event trace and a list of types.
790
+ */
791
+ generateTrace?: boolean;
792
+
732
793
  /**
733
794
  Base directory to resolve non-relative module names.
734
795
  */
@@ -878,6 +939,13 @@ declare namespace TsConfigJson {
878
939
  */
879
940
  checkJs?: boolean;
880
941
 
942
+ /**
943
+ Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`.
944
+
945
+ @default false
946
+ */
947
+ strictBuiltinIteratorReturn?: boolean;
948
+
881
949
  /**
882
950
  Disable bivariant parameter checking for function types.
883
951
 
@@ -1120,6 +1188,11 @@ declare namespace TsConfigJson {
1120
1188
  Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`.
1121
1189
  */
1122
1190
  exclude?: string[];
1191
+
1192
+ /**
1193
+ Disable infering what types should be added based on filenames in a project.
1194
+ */
1195
+ disableFilenameBasedTypeAcquisition?: boolean;
1123
1196
  };
1124
1197
 
1125
1198
  export type References = {