type-fest 5.0.0 → 5.1.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.
Files changed (193) hide show
  1. package/index.d.ts +17 -12
  2. package/package.json +2 -1
  3. package/readme.md +18 -10
  4. package/source/all-extend.d.ts +3 -1
  5. package/source/all-union-fields.d.ts +2 -0
  6. package/source/and.d.ts +2 -0
  7. package/source/array-indices.d.ts +2 -0
  8. package/source/array-slice.d.ts +2 -0
  9. package/source/array-splice.d.ts +7 -4
  10. package/source/array-tail.d.ts +3 -1
  11. package/source/array-values.d.ts +2 -0
  12. package/source/arrayable.d.ts +2 -0
  13. package/source/async-return-type.d.ts +2 -0
  14. package/source/asyncify.d.ts +2 -0
  15. package/source/basic.d.ts +2 -0
  16. package/source/camel-case.d.ts +4 -2
  17. package/source/camel-cased-properties-deep.d.ts +4 -2
  18. package/source/camel-cased-properties.d.ts +4 -2
  19. package/source/characters.d.ts +2 -0
  20. package/source/conditional-except.d.ts +2 -0
  21. package/source/conditional-keys.d.ts +2 -0
  22. package/source/conditional-pick-deep.d.ts +2 -0
  23. package/source/conditional-pick.d.ts +2 -0
  24. package/source/conditional-simplify-deep.d.ts +2 -0
  25. package/source/conditional-simplify.d.ts +2 -0
  26. package/source/delimiter-case.d.ts +5 -3
  27. package/source/delimiter-cased-properties-deep.d.ts +4 -2
  28. package/source/delimiter-cased-properties.d.ts +4 -2
  29. package/source/distributed-omit.d.ts +2 -0
  30. package/source/distributed-pick.d.ts +2 -0
  31. package/source/empty-object.d.ts +2 -0
  32. package/source/entries.d.ts +7 -5
  33. package/source/entry.d.ts +10 -8
  34. package/source/exact.d.ts +2 -0
  35. package/source/except.d.ts +3 -1
  36. package/source/exclude-rest-element.d.ts +37 -0
  37. package/source/exclude-strict.d.ts +2 -0
  38. package/source/extends-strict.d.ts +2 -0
  39. package/source/extract-rest-element.d.ts +29 -0
  40. package/source/extract-strict.d.ts +2 -0
  41. package/source/find-global-type.d.ts +2 -0
  42. package/source/fixed-length-array.d.ts +67 -21
  43. package/source/get.d.ts +5 -3
  44. package/source/global-this.d.ts +2 -0
  45. package/source/globals/index.d.ts +2 -0
  46. package/source/globals/observable-like.d.ts +5 -0
  47. package/source/greater-than-or-equal.d.ts +2 -0
  48. package/source/greater-than.d.ts +2 -0
  49. package/source/has-optional-keys.d.ts +2 -0
  50. package/source/has-readonly-keys.d.ts +2 -0
  51. package/source/has-required-keys.d.ts +2 -0
  52. package/source/has-writable-keys.d.ts +2 -0
  53. package/source/if-any.d.ts +2 -0
  54. package/source/if-empty-object.d.ts +2 -0
  55. package/source/if-never.d.ts +2 -0
  56. package/source/if-null.d.ts +2 -0
  57. package/source/if-unknown.d.ts +2 -0
  58. package/source/if.d.ts +2 -0
  59. package/source/includes.d.ts +2 -0
  60. package/source/int-closed-range.d.ts +2 -0
  61. package/source/int-range.d.ts +7 -5
  62. package/source/internal/array.d.ts +2 -0
  63. package/source/internal/characters.d.ts +2 -0
  64. package/source/{enforce-optional.d.ts → internal/enforce-optional.d.ts} +3 -1
  65. package/source/internal/index.d.ts +3 -0
  66. package/source/internal/keys.d.ts +2 -0
  67. package/source/internal/numeric.d.ts +2 -0
  68. package/source/internal/object.d.ts +2 -0
  69. package/source/internal/string.d.ts +4 -2
  70. package/source/internal/tuple.d.ts +2 -13
  71. package/source/internal/type.d.ts +2 -0
  72. package/source/invariant-of.d.ts +2 -0
  73. package/source/is-any.d.ts +2 -0
  74. package/source/is-equal.d.ts +15 -0
  75. package/source/is-float.d.ts +2 -0
  76. package/source/is-integer.d.ts +2 -0
  77. package/source/is-literal.d.ts +4 -2
  78. package/source/is-lowercase.d.ts +2 -0
  79. package/source/is-never.d.ts +2 -0
  80. package/source/is-null.d.ts +2 -0
  81. package/source/is-nullable.d.ts +2 -0
  82. package/source/is-optional-key-of.d.ts +2 -0
  83. package/source/is-optional.d.ts +2 -0
  84. package/source/is-readonly-key-of.d.ts +2 -0
  85. package/source/is-required-key-of.d.ts +2 -0
  86. package/source/is-tuple.d.ts +2 -0
  87. package/source/is-undefined.d.ts +2 -0
  88. package/source/is-union.d.ts +2 -0
  89. package/source/is-unknown.d.ts +2 -0
  90. package/source/is-uppercase.d.ts +2 -0
  91. package/source/is-writable-key-of.d.ts +2 -0
  92. package/source/iterable-element.d.ts +2 -0
  93. package/source/join.d.ts +2 -0
  94. package/source/json-value.d.ts +3 -1
  95. package/source/jsonifiable.d.ts +2 -0
  96. package/source/jsonify.d.ts +2 -0
  97. package/source/kebab-case.d.ts +4 -2
  98. package/source/kebab-cased-properties-deep.d.ts +4 -2
  99. package/source/kebab-cased-properties.d.ts +4 -2
  100. package/source/key-as-string.d.ts +2 -0
  101. package/source/keys-of-union.d.ts +2 -0
  102. package/source/last-array-element.d.ts +3 -1
  103. package/source/less-than-or-equal.d.ts +2 -0
  104. package/source/less-than.d.ts +2 -0
  105. package/source/literal-to-primitive-deep.d.ts +2 -0
  106. package/source/literal-to-primitive.d.ts +2 -0
  107. package/source/literal-union.d.ts +3 -1
  108. package/source/merge-deep.d.ts +3 -1
  109. package/source/merge-exclusive.d.ts +1 -0
  110. package/source/merge.d.ts +2 -0
  111. package/source/multidimensional-array.d.ts +2 -0
  112. package/source/multidimensional-readonly-array.d.ts +2 -0
  113. package/source/non-empty-object.d.ts +2 -0
  114. package/source/non-empty-string.d.ts +2 -0
  115. package/source/non-empty-tuple.d.ts +2 -0
  116. package/source/numeric.d.ts +7 -5
  117. package/source/omit-deep.d.ts +2 -0
  118. package/source/omit-index-signature.d.ts +2 -0
  119. package/source/opaque.d.ts +2 -0
  120. package/source/optional-keys-of.d.ts +2 -0
  121. package/source/or.d.ts +2 -0
  122. package/source/override-properties.d.ts +2 -0
  123. package/source/package-json.d.ts +18 -16
  124. package/source/partial-deep.d.ts +20 -17
  125. package/source/partial-on-undefined-deep.d.ts +2 -0
  126. package/source/pascal-case.d.ts +5 -3
  127. package/source/pascal-cased-properties-deep.d.ts +4 -2
  128. package/source/pascal-cased-properties.d.ts +4 -2
  129. package/source/paths.d.ts +2 -0
  130. package/source/pick-deep.d.ts +8 -5
  131. package/source/pick-index-signature.d.ts +2 -0
  132. package/source/primitive.d.ts +2 -0
  133. package/source/promisable.d.ts +2 -0
  134. package/source/readonly-deep.d.ts +6 -4
  135. package/source/readonly-keys-of.d.ts +2 -0
  136. package/source/readonly-tuple.d.ts +6 -15
  137. package/source/remove-prefix.d.ts +4 -2
  138. package/source/replace.d.ts +3 -1
  139. package/source/require-all-or-none.d.ts +2 -0
  140. package/source/require-at-least-one.d.ts +2 -0
  141. package/source/require-exactly-one.d.ts +2 -0
  142. package/source/require-one-or-none.d.ts +2 -0
  143. package/source/required-deep.d.ts +4 -1
  144. package/source/required-keys-of.d.ts +2 -0
  145. package/source/schema.d.ts +2 -0
  146. package/source/screaming-snake-case.d.ts +4 -2
  147. package/source/set-field-type.d.ts +3 -1
  148. package/source/set-non-nullable-deep.d.ts +2 -0
  149. package/source/set-non-nullable.d.ts +2 -0
  150. package/source/set-optional.d.ts +2 -0
  151. package/source/set-parameter-type.d.ts +2 -0
  152. package/source/set-readonly.d.ts +2 -0
  153. package/source/set-required-deep.d.ts +2 -0
  154. package/source/set-required.d.ts +2 -0
  155. package/source/set-return-type.d.ts +2 -0
  156. package/source/shared-union-fields-deep.d.ts +2 -0
  157. package/source/shared-union-fields.d.ts +2 -0
  158. package/source/simplify-deep.d.ts +2 -0
  159. package/source/simplify.d.ts +2 -0
  160. package/source/single-key-object.d.ts +2 -0
  161. package/source/snake-case.d.ts +4 -2
  162. package/source/snake-cased-properties-deep.d.ts +4 -2
  163. package/source/snake-cased-properties.d.ts +4 -2
  164. package/source/split-on-rest-element.d.ts +106 -0
  165. package/source/split.d.ts +3 -1
  166. package/source/spread.d.ts +2 -0
  167. package/source/string-repeat.d.ts +2 -0
  168. package/source/string-slice.d.ts +2 -0
  169. package/source/stringified.d.ts +2 -0
  170. package/source/structured-cloneable.d.ts +2 -0
  171. package/source/subtract.d.ts +6 -3
  172. package/source/sum.d.ts +5 -2
  173. package/source/tagged-union.d.ts +2 -0
  174. package/source/tagged.d.ts +3 -0
  175. package/source/trim.d.ts +2 -0
  176. package/source/tsconfig-json.d.ts +54 -25
  177. package/source/tuple-of.d.ts +78 -0
  178. package/source/tuple-to-object.d.ts +2 -0
  179. package/source/tuple-to-union.d.ts +2 -0
  180. package/source/typed-array.d.ts +2 -0
  181. package/source/undefined-on-partial-deep.d.ts +2 -0
  182. package/source/union-to-intersection.d.ts +3 -1
  183. package/source/union-to-tuple.d.ts +2 -0
  184. package/source/unknown-array.d.ts +2 -0
  185. package/source/unknown-map.d.ts +2 -0
  186. package/source/unknown-record.d.ts +2 -0
  187. package/source/unknown-set.d.ts +2 -0
  188. package/source/value-of.d.ts +2 -0
  189. package/source/words.d.ts +4 -2
  190. package/source/writable-deep.d.ts +5 -4
  191. package/source/writable-keys-of.d.ts +2 -0
  192. package/source/writable.d.ts +2 -0
  193. package/source/xor.d.ts +83 -0
package/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export type {UnknownRecord} from './source/unknown-record.d.ts';
17
17
  export type {UnknownArray} from './source/unknown-array.d.ts';
18
18
  export type {UnknownSet} from './source/unknown-set.d.ts';
19
19
  export type {UnknownMap} from './source/unknown-map.d.ts';
20
- export type {Except} from './source/except.d.ts';
20
+ export type {Except, ExceptOptions} from './source/except.d.ts';
21
21
  export type {TaggedUnion} from './source/tagged-union.d.ts';
22
22
  export type {Writable} from './source/writable.d.ts';
23
23
  export type {WritableDeep} from './source/writable-deep.d.ts';
@@ -111,6 +111,9 @@ export type {WritableKeysOf} from './source/writable-keys-of.d.ts';
111
111
  export type {IsWritableKeyOf} from './source/is-writable-key-of.d.ts';
112
112
  export type {HasWritableKeys} from './source/has-writable-keys.d.ts';
113
113
  export type {Spread} from './source/spread.d.ts';
114
+ export type {SplitOnRestElement} from './source/split-on-rest-element.d.ts';
115
+ export type {ExtractRestElement} from './source/extract-rest-element.d.ts';
116
+ export type {ExcludeRestElement} from './source/exclude-rest-element.d.ts';
114
117
  export type {IsInteger} from './source/is-integer.d.ts';
115
118
  export type {IsFloat} from './source/is-float.d.ts';
116
119
  export type {TupleToObject} from './source/tuple-to-object.d.ts';
@@ -132,23 +135,24 @@ export type {IsNever} from './source/is-never.d.ts';
132
135
  export type {IfNever} from './source/if-never.d.ts';
133
136
  export type {IsUnknown} from './source/is-unknown.d.ts';
134
137
  export type {IfUnknown} from './source/if-unknown.d.ts';
135
- export type {IsTuple} from './source/is-tuple.d.ts';
138
+ export type {IsTuple, IsTupleOptions} from './source/is-tuple.d.ts';
136
139
  export type {ArrayIndices} from './source/array-indices.d.ts';
137
140
  export type {ArrayValues} from './source/array-values.d.ts';
138
141
  export type {ArraySlice} from './source/array-slice.d.ts';
139
142
  export type {ArraySplice} from './source/array-splice.d.ts';
140
143
  export type {ArrayTail} from './source/array-tail.d.ts';
141
- export type {SetFieldType} from './source/set-field-type.d.ts';
142
- export type {Paths} from './source/paths.d.ts';
144
+ export type {SetFieldType, SetFieldTypeOptions} from './source/set-field-type.d.ts';
145
+ export type {Paths, PathsOptions} from './source/paths.d.ts';
143
146
  export type {AllUnionFields} from './source/all-union-fields.d.ts';
144
147
  export type {SharedUnionFields} from './source/shared-union-fields.d.ts';
145
- export type {SharedUnionFieldsDeep} from './source/shared-union-fields-deep.d.ts';
148
+ export type {SharedUnionFieldsDeep, SharedUnionFieldsDeepOptions} from './source/shared-union-fields-deep.d.ts';
146
149
  export type {IsNull} from './source/is-null.d.ts';
147
150
  export type {IfNull} from './source/if-null.d.ts';
148
151
  export type {IsUndefined} from './source/is-undefined.d.ts';
149
152
  export type {And} from './source/and.d.ts';
150
153
  export type {Or} from './source/or.d.ts';
151
- export type {AllExtend} from './source/all-extend.d.ts';
154
+ export type {Xor} from './source/xor.d.ts';
155
+ export type {AllExtend, AllExtendOptions} from './source/all-extend.d.ts';
152
156
  export type {NonEmptyTuple} from './source/non-empty-tuple.d.ts';
153
157
  export type {FindGlobalInstanceType, FindGlobalType} from './source/find-global-type.d.ts';
154
158
  export type {If} from './source/if.d.ts';
@@ -157,9 +161,10 @@ export type {IsLowercase} from './source/is-lowercase.d.ts';
157
161
  export type {IsUppercase} from './source/is-uppercase.d.ts';
158
162
  export type {IsOptional} from './source/is-optional.d.ts';
159
163
  export type {IsNullable} from './source/is-nullable.d.ts';
164
+ export type {TupleOf} from './source/tuple-of.d.ts';
160
165
 
161
166
  // Template literal types
162
- export type {CamelCase} from './source/camel-case.d.ts';
167
+ export type {CamelCase, CamelCaseOptions} from './source/camel-case.d.ts';
163
168
  export type {CamelCasedProperties} from './source/camel-cased-properties.d.ts';
164
169
  export type {CamelCasedPropertiesDeep} from './source/camel-cased-properties-deep.d.ts';
165
170
  export type {KebabCase} from './source/kebab-case.d.ts';
@@ -176,17 +181,17 @@ export type {DelimiterCase} from './source/delimiter-case.d.ts';
176
181
  export type {DelimiterCasedProperties} from './source/delimiter-cased-properties.d.ts';
177
182
  export type {DelimiterCasedPropertiesDeep} from './source/delimiter-cased-properties-deep.d.ts';
178
183
  export type {Join} from './source/join.d.ts';
179
- export type {Split} from './source/split.d.ts';
180
- export type {Words} from './source/words.d.ts';
184
+ export type {Split, SplitOptions} from './source/split.d.ts';
185
+ export type {Words, WordsOptions} from './source/words.d.ts';
181
186
  export type {Trim} from './source/trim.d.ts';
182
- export type {Replace} from './source/replace.d.ts';
187
+ export type {Replace, ReplaceOptions} from './source/replace.d.ts';
183
188
  export type {StringRepeat} from './source/string-repeat.d.ts';
184
189
  export type {Includes} from './source/includes.d.ts';
185
- export type {Get} from './source/get.d.ts';
190
+ export type {Get, GetOptions} from './source/get.d.ts';
186
191
  export type {LastArrayElement} from './source/last-array-element.d.ts';
187
192
  export type {ConditionalSimplify} from './source/conditional-simplify.d.ts';
188
193
  export type {ConditionalSimplifyDeep} from './source/conditional-simplify-deep.d.ts';
189
- export type {RemovePrefix} from './source/remove-prefix.d.ts';
194
+ export type {RemovePrefix, RemovePrefixOptions} from './source/remove-prefix.d.ts';
190
195
 
191
196
  // Miscellaneous
192
197
  export type {GlobalThis} from './source/global-this.d.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "type-fest",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "A collection of essential TypeScript types",
5
5
  "license": "(MIT OR CC0-1.0)",
6
6
  "repository": "sindresorhus/type-fest",
@@ -28,6 +28,7 @@
28
28
  "test:tsc": "tsc",
29
29
  "test:tsd": "tsd",
30
30
  "test:xo": "xo",
31
+ "test:linter": "node --test",
31
32
  "test": "run-p test:*"
32
33
  },
33
34
  "files": [
package/readme.md CHANGED
@@ -60,6 +60,8 @@ npm install type-fest
60
60
  > [!NOTE]
61
61
  > This readme shows the current development version. For docs about the latest version, see the [npm page](https://www.npmjs.com/package/type-fest).
62
62
 
63
+ *You may also like my [`ts-extras`](https://github.com/sindresorhus/ts-extras) package which provides runtime functions for some of these types.*
64
+
63
65
  ## Usage
64
66
 
65
67
  ```ts
@@ -167,8 +169,8 @@ Click the type names for complete docs.
167
169
  - [`IntClosedRange`](source/int-closed-range.d.ts) - Generate a union of numbers (includes the start and the end).
168
170
  - [`ArrayIndices`](source/array-indices.d.ts) - Provides valid indices for a constant array or tuple.
169
171
  - [`ArrayValues`](source/array-values.d.ts) - Provides all values for a constant array or tuple.
170
- - [`ArraySplice`](source/array-splice.d.ts) - Creates a new array type by adding or removing elements at a specified index range in the original array.
171
- - [`ArrayTail`](source/array-tail.d.ts) - Extracts the type of an array or tuple minus the first element.
172
+ - [`ArraySplice`](source/array-splice.d.ts) - Create a new array type by adding or removing elements at a specified index range in the original array.
173
+ - [`ArrayTail`](source/array-tail.d.ts) - Extract the type of an array or tuple minus the first element.
172
174
  - [`SetFieldType`](source/set-field-type.d.ts) - Create a type that changes the type of the given keys.
173
175
  - [`Paths`](source/paths.d.ts) - Generate a union of all possible paths to properties in the given object.
174
176
  - [`SharedUnionFields`](source/shared-union-fields.d.ts) - Create a type with shared fields from a union of object types.
@@ -178,6 +180,7 @@ Click the type names for complete docs.
178
180
  - [`DistributedPick`](source/distributed-pick.d.ts) - Picks keys from a type, distributing the operation over a union.
179
181
  - [`And`](source/and.d.ts) - Returns a boolean for whether two given types are both true.
180
182
  - [`Or`](source/or.d.ts) - Returns a boolean for whether either of two given types are true.
183
+ - [`Xor`](source/xor.d.ts) - Returns a boolean for whether only one of two given types is true.
181
184
  - [`AllExtend`](source/all-extend.d.ts) - Returns a boolean for whether every element in an array type extends another type.
182
185
  - [`NonEmptyTuple`](source/non-empty-tuple.d.ts) - Matches any non-empty tuple.
183
186
  - [`NonEmptyString`](source/non-empty-string.d.ts) - Matches any non-empty string.
@@ -238,7 +241,7 @@ Click the type names for complete docs.
238
241
  - [`Replace`](source/replace.d.ts) - Represents a string with some or all matches replaced by a replacement.
239
242
  - [`StringSlice`](source/string-slice.d.ts) - Returns a string slice of a given range, just like `String#slice()`.
240
243
  - [`StringRepeat`](source/string-repeat.d.ts) - Returns a new string which contains the specified number of copies of a given string, just like `String#repeat()`.
241
- - [`RemovePrefix`](source/remove-prefix.d.ts) - Removes the specified prefix from the start of a string.
244
+ - [`RemovePrefix`](source/remove-prefix.d.ts) - Remove the specified prefix from the start of a string.
242
245
 
243
246
  ### Array
244
247
 
@@ -246,14 +249,18 @@ Click the type names for complete docs.
246
249
  - [`Includes`](source/includes.d.ts) - Returns a boolean for whether the given array includes the given item.
247
250
  - [`Join`](source/join.d.ts) - Join an array of strings and/or numbers using the given string as a delimiter.
248
251
  - [`ArraySlice`](source/array-slice.d.ts) - Returns an array slice of a given range, just like `Array#slice()`.
249
- - [`LastArrayElement`](source/last-array-element.d.ts) - Extracts the type of the last element of an array.
250
- - [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length.
252
+ - [`LastArrayElement`](source/last-array-element.d.ts) - Extract the type of the last element of an array.
253
+ - [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length. The `Array` prototype methods that manipulate its length are excluded from the resulting type.
251
254
  - [`MultidimensionalArray`](source/multidimensional-array.d.ts) - Create a type that represents a multidimensional array of the given type and dimensions.
252
255
  - [`MultidimensionalReadonlyArray`](source/multidimensional-readonly-array.d.ts) - Create a type that represents a multidimensional readonly array of the given type and dimensions.
253
256
  - [`ReadonlyTuple`](source/readonly-tuple.d.ts) - Create a type that represents a read-only tuple of the given type and length.
254
257
  - [`TupleToUnion`](source/tuple-to-union.d.ts) - Convert a tuple/array into a union type of its elements.
255
258
  - [`UnionToTuple`](source/union-to-tuple.d.ts) - Convert a union type into an unordered tuple type of its elements.
256
259
  - [`TupleToObject`](source/tuple-to-object.d.ts) - Transforms a tuple into an object, mapping each tuple index to its corresponding type as a key-value pair.
260
+ - [`TupleOf`](source/tuple-of.d.ts) - Create a tuple type of the specified length with elements of the specified type.
261
+ - [`SplitOnRestElement`](source/split-on-rest-element.d.ts) - Splits an array into three parts, where the first contains all elements before the rest element, the second is the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element itself, and the third contains all elements after the rest element.
262
+ - [`ExtractRestElement`](source/extract-rest-element.d.ts) - Extract the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element type from an array.
263
+ - [`ExcludeRestElement`](source/exclude-rest-element.d.ts) - Create a tuple with the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element removed.
257
264
 
258
265
  ### Numeric
259
266
 
@@ -283,11 +290,11 @@ Click the type names for complete docs.
283
290
  - [`CamelCasedProperties`](source/camel-cased-properties.d.ts) - Convert object properties to camel-case (`fooBar`).
284
291
  - [`CamelCasedPropertiesDeep`](source/camel-cased-properties-deep.d.ts) - Convert object properties to camel-case recursively (`fooBar`).
285
292
  - [`KebabCase`](source/kebab-case.d.ts) - Convert a string literal to kebab-case (`foo-bar`).
286
- - [`KebabCasedProperties`](source/kebab-cased-properties.d.ts) - Convert a object properties to kebab-case recursively (`foo-bar`).
287
- - [`KebabCasedPropertiesDeep`](source/kebab-cased-properties-deep.d.ts) - Convert object properties to kebab-case (`foo-bar`).
288
- - [`PascalCase`](source/pascal-case.d.ts) - Converts a string literal to pascal-case (`FooBar`)
289
- - [`PascalCasedProperties`](source/pascal-cased-properties.d.ts) - Converts object properties to pascal-case (`FooBar`)
290
- - [`PascalCasedPropertiesDeep`](source/pascal-cased-properties-deep.d.ts) - Converts object properties to pascal-case (`FooBar`)
293
+ - [`KebabCasedProperties`](source/kebab-cased-properties.d.ts) - Convert object properties to kebab-case (`foo-bar`).
294
+ - [`KebabCasedPropertiesDeep`](source/kebab-cased-properties-deep.d.ts) - Convert object properties to kebab-case recursively (`foo-bar`).
295
+ - [`PascalCase`](source/pascal-case.d.ts) - Convert a string literal to pascal-case (`FooBar`).
296
+ - [`PascalCasedProperties`](source/pascal-cased-properties.d.ts) - Convert object properties to pascal-case (`FooBar`).
297
+ - [`PascalCasedPropertiesDeep`](source/pascal-cased-properties-deep.d.ts) - Convert object properties to pascal-case recursively (`FooBar`).
291
298
  - [`SnakeCase`](source/snake-case.d.ts) - Convert a string literal to snake-case (`foo_bar`).
292
299
  - [`SnakeCasedProperties`](source/snake-cased-properties.d.ts) - Convert object properties to snake-case (`foo_bar`).
293
300
  - [`SnakeCasedPropertiesDeep`](source/snake-cased-properties-deep.d.ts) - Convert object properties to snake-case recursively (`foo_bar`).
@@ -342,6 +349,7 @@ Click the type names for complete docs.
342
349
  - `HomomorphicOmit` - See [`Except`](source/except.d.ts)
343
350
  - `IfAny`, `IfNever`, `If*` - See [`If`](source/if.d.ts)
344
351
  - `MaybePromise` - See [`Promisable`](source/promisable.d.ts)
352
+ - `ReadonlyTuple` - See [`TupleOf`](source/tuple-of.d.ts)
345
353
 
346
354
  ## Tips
347
355
 
@@ -10,7 +10,7 @@ import type {UnknownArray} from './unknown-array.d.ts';
10
10
  /**
11
11
  @see {@link AllExtend}
12
12
  */
13
- type AllExtendOptions = {
13
+ export type AllExtendOptions = {
14
14
  /**
15
15
  Consider `never` elements to match the target type only if the target type itself is `never` (or `any`).
16
16
 
@@ -113,3 +113,5 @@ type _AllExtend<TArray extends UnknownArray, Type, Options extends Required<AllE
113
113
  : false
114
114
  : true
115
115
  >, false, false>;
116
+
117
+ export {};
@@ -86,3 +86,5 @@ Extract<Union, NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<un
86
86
  >
87
87
  : never
88
88
  : never;
89
+
90
+ export {};
package/source/and.d.ts CHANGED
@@ -75,3 +75,5 @@ type G = And<never, never>;
75
75
  @see {@link Or}
76
76
  */
77
77
  export type And<A extends boolean, B extends boolean> = AllExtend<[A, B], true>;
78
+
79
+ export {};
@@ -21,3 +21,5 @@ const getWeekdayName = (day: Weekday): WeekdayName => weekdays[day];
21
21
  */
22
22
  export type ArrayIndices<Element extends readonly unknown[]> =
23
23
  Exclude<Partial<Element>['length'], Element['length']>;
24
+
25
+ export {};
@@ -107,3 +107,5 @@ type ArraySliceByPositiveIndex<
107
107
  > = Start extends End
108
108
  ? Result
109
109
  : ArraySliceByPositiveIndex<Array_, Sum<Start, 1>, End, [...Result, Array_[Start]]>;
110
+
111
+ export {};
@@ -1,7 +1,8 @@
1
- import type {BuildTuple, StaticPartOfArray, VariablePartOfArray} from './internal/index.d.ts';
1
+ import type {StaticPartOfArray, VariablePartOfArray} from './internal/index.d.ts';
2
2
  import type {GreaterThanOrEqual} from './greater-than-or-equal.d.ts';
3
3
  import type {Subtract} from './subtract.d.ts';
4
4
  import type {UnknownArray} from './unknown-array.d.ts';
5
+ import type {TupleOf} from './tuple-of.d.ts';
5
6
 
6
7
  /**
7
8
  The implementation of `SplitArrayByIndex` for fixed length arrays.
@@ -9,7 +10,7 @@ The implementation of `SplitArrayByIndex` for fixed length arrays.
9
10
  type SplitFixedArrayByIndex<T extends UnknownArray, SplitIndex extends number> =
10
11
  SplitIndex extends 0
11
12
  ? [[], T]
12
- : T extends readonly [...BuildTuple<SplitIndex>, ...infer V]
13
+ : T extends readonly [...TupleOf<SplitIndex>, ...infer V]
13
14
  ? T extends readonly [...infer U, ...V]
14
15
  ? [U, V]
15
16
  : [never, never]
@@ -22,7 +23,7 @@ type SplitVariableArrayByIndex<T extends UnknownArray,
22
23
  SplitIndex extends number,
23
24
  T1 = Subtract<SplitIndex, StaticPartOfArray<T>['length']>,
24
25
  T2 = T1 extends number
25
- ? BuildTuple<GreaterThanOrEqual<T1, 0> extends true ? T1 : number, VariablePartOfArray<T>[number]>
26
+ ? TupleOf<GreaterThanOrEqual<T1, 0> extends true ? T1 : number, VariablePartOfArray<T>[number]>
26
27
  : [],
27
28
  > =
28
29
  SplitIndex extends 0
@@ -63,7 +64,7 @@ type SplitArrayByIndex<T extends UnknownArray, SplitIndex extends number> =
63
64
  : SplitFixedArrayByIndex<T, SplitIndex>;
64
65
 
65
66
  /**
66
- Creates a new array type by adding or removing elements at a specified index range in the original array.
67
+ Create a new array type by adding or removing elements at a specified index range in the original array.
67
68
 
68
69
  Use-case: Replace or insert items in an array type.
69
70
 
@@ -97,3 +98,5 @@ export type ArraySplice<
97
98
  ? [...U, ...Items, ...X]
98
99
  : never // Should never happen
99
100
  : never; // Should never happen
101
+
102
+ export {};
@@ -3,7 +3,7 @@ import type {IfNotAnyOrNever, IsArrayReadonly} from './internal/index.d.ts';
3
3
  import type {UnknownArray} from './unknown-array.d.ts';
4
4
 
5
5
  /**
6
- Extracts the type of an array or tuple minus the first element.
6
+ Extract the type of an array or tuple minus the first element.
7
7
 
8
8
  @example
9
9
  ```
@@ -66,3 +66,5 @@ type _ArrayTail<TArray extends UnknownArray> = TArray extends readonly [unknown?
66
66
  : TArray // Happens when `TArray` is a non-tuple array (e.g., `string[]`) or has a leading rest element (e.g., `[...string[], number]`)
67
67
  : Tail
68
68
  : [];
69
+
70
+ export {};
@@ -20,3 +20,5 @@ const getWeekdayName = (day: Weekday): WeekdayName => weekdays[day];
20
20
  @category Array
21
21
  */
22
22
  export type ArrayValues<T extends readonly unknown[]> = T[number];
23
+
24
+ export {};
@@ -27,3 +27,5 @@ export type Arrayable<T> =
27
27
  T
28
28
  // TODO: Use `readonly T[]` when this issue is resolved: https://github.com/microsoft/TypeScript/issues/17002
29
29
  | T[];
30
+
31
+ export {};
@@ -21,3 +21,5 @@ asyncFunction().then(value => doSomething(value));
21
21
  @category Async
22
22
  */
23
23
  export type AsyncReturnType<Target extends AsyncFunction> = Awaited<ReturnType<Target>>;
24
+
25
+ export {};
@@ -30,3 +30,5 @@ const getFooAsync: AsyncifiedFooGetter = (someArg) => {
30
30
  @category Async
31
31
  */
32
32
  export type Asyncify<Function_ extends (...arguments_: any[]) => any> = SetReturnType<Function_, Promise<Awaited<ReturnType<Function_>>>>;
33
+
34
+ export {};
package/source/basic.d.ts CHANGED
@@ -34,3 +34,5 @@ Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/relea
34
34
  @category Class
35
35
  */
36
36
  export type AbstractConstructor<T, Arguments extends unknown[] = any[]> = abstract new(...arguments_: Arguments) => T;
37
+
38
+ export {};
@@ -15,7 +15,7 @@ export type CamelCaseOptions = {
15
15
  preserveConsecutiveUppercase?: boolean;
16
16
  };
17
17
 
18
- export type DefaultCamelCaseOptions = {
18
+ export type _DefaultCamelCaseOptions = {
19
19
  preserveConsecutiveUppercase: false;
20
20
  };
21
21
 
@@ -84,6 +84,8 @@ export type CamelCase<Type, Options extends CamelCaseOptions = {}> = Type extend
84
84
  ? Type
85
85
  : Uncapitalize<CamelCaseFromArray<
86
86
  Words<Type extends Uppercase<Type> ? Lowercase<Type> : Type>,
87
- ApplyDefaultOptions<CamelCaseOptions, DefaultCamelCaseOptions, Options>
87
+ ApplyDefaultOptions<CamelCaseOptions, _DefaultCamelCaseOptions, Options>
88
88
  >>
89
89
  : Type;
90
+
91
+ export {};
@@ -1,4 +1,4 @@
1
- import type {CamelCase, CamelCaseOptions, DefaultCamelCaseOptions} from './camel-case.d.ts';
1
+ import type {CamelCase, CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';
2
2
  import type {ApplyDefaultOptions, NonRecursiveType} from './internal/index.d.ts';
3
3
  import type {UnknownArray} from './unknown-array.d.ts';
4
4
 
@@ -57,7 +57,7 @@ const preserveConsecutiveUppercase: CamelCasedPropertiesDeep<{fooBAR: {fooBARBiz
57
57
  export type CamelCasedPropertiesDeep<
58
58
  Value,
59
59
  Options extends CamelCaseOptions = {},
60
- > = _CamelCasedPropertiesDeep<Value, ApplyDefaultOptions<CamelCaseOptions, DefaultCamelCaseOptions, Options>>;
60
+ > = _CamelCasedPropertiesDeep<Value, ApplyDefaultOptions<CamelCaseOptions, _DefaultCamelCaseOptions, Options>>;
61
61
 
62
62
  type _CamelCasedPropertiesDeep<
63
63
  Value,
@@ -95,3 +95,5 @@ type CamelCasedPropertiesArrayDeep<
95
95
  : Value extends ReadonlyArray<infer U>
96
96
  ? ReadonlyArray<_CamelCasedPropertiesDeep<U, Options>>
97
97
  : never;
98
+
99
+ export {};
@@ -1,4 +1,4 @@
1
- import type {CamelCase, CamelCaseOptions, DefaultCamelCaseOptions} from './camel-case.d.ts';
1
+ import type {CamelCase, CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';
2
2
  import type {ApplyDefaultOptions} from './internal/index.d.ts';
3
3
 
4
4
  /**
@@ -38,6 +38,8 @@ export type CamelCasedProperties<Value, Options extends CamelCaseOptions = {}> =
38
38
  ? Value
39
39
  : {
40
40
  [K in keyof Value as
41
- CamelCase<K, ApplyDefaultOptions<CamelCaseOptions, DefaultCamelCaseOptions, Options>>
41
+ CamelCase<K, ApplyDefaultOptions<CamelCaseOptions, _DefaultCamelCaseOptions, Options>>
42
42
  ]: Value[K];
43
43
  };
44
+
45
+ export {};
@@ -58,3 +58,5 @@ const b: Alphanumeric = '#'; // Invalid
58
58
  @category Type
59
59
  */
60
60
  export type Alphanumeric = LowercaseLetter | UppercaseLetter | DigitCharacter;
61
+
62
+ export {};
@@ -43,3 +43,5 @@ export type ConditionalExcept<Base, Condition> = Except<
43
43
  Base,
44
44
  ConditionalKeys<Base, Condition>
45
45
  >;
46
+
47
+ export {};
@@ -59,3 +59,5 @@ type _ConditionalKeys<Base, Condition> = keyof {
59
59
  ExtendsStrict<Base[Key], Condition> extends true ? Key : never
60
60
  ]: never
61
61
  };
62
+
63
+ export {};
@@ -116,3 +116,5 @@ type _ConditionalPickDeep<
116
116
  ? _ConditionalPickDeep<Type[Key], Condition, Options>
117
117
  : typeof conditionalPickDeepSymbol;
118
118
  }, (typeof conditionalPickDeepSymbol | undefined) | EmptyObject>, never, UnknownRecord>;
119
+
120
+ export {};
@@ -42,3 +42,5 @@ export type ConditionalPick<Base, Condition> = Pick<
42
42
  Base,
43
43
  ConditionalKeys<Base, Condition>
44
44
  >;
45
+
46
+ export {};
@@ -69,3 +69,5 @@ export type ConditionalSimplifyDeep<Type, ExcludeType = never, IncludeType = unk
69
69
  : Type extends IncludeType
70
70
  ? {[TypeKey in keyof Type]: ConditionalSimplifyDeep<Type[TypeKey], ExcludeType, IncludeType>}
71
71
  : Type;
72
+
73
+ export {};
@@ -46,3 +46,5 @@ export type ConditionalSimplify<Type, ExcludeType = never, IncludeType = unknown
46
46
  : Type extends IncludeType
47
47
  ? {[TypeKey in keyof Type]: Type[TypeKey]}
48
48
  : Type;
49
+
50
+ export {};
@@ -2,9 +2,9 @@ import type {ApplyDefaultOptions, AsciiPunctuation, StartsWith} from './internal
2
2
  import type {IsStringLiteral} from './is-literal.d.ts';
3
3
  import type {Merge} from './merge.d.ts';
4
4
  import type {RemovePrefix} from './remove-prefix.d.ts';
5
- import type {DefaultWordsOptions, Words, WordsOptions} from './words.d.ts';
5
+ import type {_DefaultWordsOptions, Words, WordsOptions} from './words.d.ts';
6
6
 
7
- export type DefaultDelimiterCaseOptions = Merge<DefaultWordsOptions, {splitOnNumbers: false}>;
7
+ export type _DefaultDelimiterCaseOptions = Merge<_DefaultWordsOptions, {splitOnNumbers: false}>;
8
8
 
9
9
  /**
10
10
  Convert an array of words to delimiter case starting with a delimiter with input capitalization.
@@ -69,7 +69,9 @@ export type DelimiterCase<
69
69
  ? IsStringLiteral<Value> extends false
70
70
  ? Value
71
71
  : Lowercase<RemovePrefix<DelimiterCaseFromArray<
72
- Words<Value, ApplyDefaultOptions<WordsOptions, DefaultDelimiterCaseOptions, Options>>,
72
+ Words<Value, ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>,
73
73
  Delimiter
74
74
  >, string, {strict: false}>>
75
75
  : Value;
76
+
77
+ export {};
@@ -1,4 +1,4 @@
1
- import type {DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';
1
+ import type {_DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';
2
2
  import type {ApplyDefaultOptions, NonRecursiveType} from './internal/index.d.ts';
3
3
  import type {UnknownArray} from './unknown-array.d.ts';
4
4
  import type {WordsOptions} from './words.d.ts';
@@ -61,7 +61,7 @@ export type DelimiterCasedPropertiesDeep<
61
61
  Value,
62
62
  Delimiter extends string,
63
63
  Options extends WordsOptions = {},
64
- > = _DelimiterCasedPropertiesDeep<Value, Delimiter, ApplyDefaultOptions<WordsOptions, DefaultDelimiterCaseOptions, Options>>;
64
+ > = _DelimiterCasedPropertiesDeep<Value, Delimiter, ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>;
65
65
 
66
66
  type _DelimiterCasedPropertiesDeep<
67
67
  Value,
@@ -104,3 +104,5 @@ type DelimiterCasedPropertiesArrayDeep<
104
104
  : Value extends ReadonlyArray<infer U>
105
105
  ? ReadonlyArray<_DelimiterCasedPropertiesDeep<U, Delimiter, Options>>
106
106
  : never;
107
+
108
+ export {};
@@ -1,4 +1,4 @@
1
- import type {DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';
1
+ import type {_DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';
2
2
  import type {ApplyDefaultOptions} from './internal/index.d.ts';
3
3
  import type {WordsOptions} from './words.d.ts';
4
4
 
@@ -42,5 +42,7 @@ export type DelimiterCasedProperties<
42
42
  : Value extends Array<infer U>
43
43
  ? Value
44
44
  : {[K in keyof Value as
45
- DelimiterCase<K, Delimiter, ApplyDefaultOptions<WordsOptions, DefaultDelimiterCaseOptions, Options>>
45
+ DelimiterCase<K, Delimiter, ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>
46
46
  ]: Value[K]};
47
+
48
+ export {};
@@ -87,3 +87,5 @@ export type DistributedOmit<ObjectType, KeyType extends KeysOfUnion<ObjectType>>
87
87
  ObjectType extends unknown
88
88
  ? Omit<ObjectType, KeyType>
89
89
  : never;
90
+
91
+ export {};
@@ -83,3 +83,5 @@ export type DistributedPick<ObjectType, KeyType extends KeysOfUnion<ObjectType>>
83
83
  ObjectType extends unknown
84
84
  ? Pick<ObjectType, Extract<KeyType, keyof ObjectType>>
85
85
  : never;
86
+
87
+ export {};
@@ -44,3 +44,5 @@ type Fail = IsEmptyObject<null>; //=> false
44
44
  @category Object
45
45
  */
46
46
  export type IsEmptyObject<T> = T extends EmptyObject ? true : false;
47
+
48
+ export {};
@@ -1,9 +1,9 @@
1
- import type {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry.d.ts';
1
+ import type {_ArrayEntry, _MapEntry, _ObjectEntry, _SetEntry} from './entry.d.ts';
2
2
 
3
- type ArrayEntries<BaseType extends readonly unknown[]> = Array<ArrayEntry<BaseType>>;
4
- type MapEntries<BaseType> = Array<MapEntry<BaseType>>;
5
- type ObjectEntries<BaseType> = Array<ObjectEntry<BaseType>>;
6
- type SetEntries<BaseType extends Set<unknown>> = Array<SetEntry<BaseType>>;
3
+ type ArrayEntries<BaseType extends readonly unknown[]> = Array<_ArrayEntry<BaseType>>;
4
+ type MapEntries<BaseType> = Array<_MapEntry<BaseType>>;
5
+ type ObjectEntries<BaseType> = Array<_ObjectEntry<BaseType>>;
6
+ type SetEntries<BaseType extends Set<unknown>> = Array<_SetEntry<BaseType>>;
7
7
 
8
8
  /**
9
9
  Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries.
@@ -60,3 +60,5 @@ export type Entries<BaseType> =
60
60
  : BaseType extends readonly unknown[] ? ArrayEntries<BaseType>
61
61
  : BaseType extends object ? ObjectEntries<BaseType>
62
62
  : never;
63
+
64
+ export {};
package/source/entry.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  type MapKey<BaseType> = BaseType extends Map<infer KeyType, unknown> ? KeyType : never;
2
2
  type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
3
3
 
4
- export type ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseType[number]];
5
- export type MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
6
- export type ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
7
- export type SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemType, ItemType] : never;
4
+ export type _ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseType[number]];
5
+ export type _MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
6
+ export type _ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
7
+ export type _SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemType, ItemType] : never;
8
8
 
9
9
  /**
10
10
  Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry.
@@ -58,8 +58,10 @@ const setEntryNumber: Entry<typeof setExample> = [1, 1];
58
58
  @category Set
59
59
  */
60
60
  export type Entry<BaseType> =
61
- BaseType extends Map<unknown, unknown> ? MapEntry<BaseType>
62
- : BaseType extends Set<unknown> ? SetEntry<BaseType>
63
- : BaseType extends readonly unknown[] ? ArrayEntry<BaseType>
64
- : BaseType extends object ? ObjectEntry<BaseType>
61
+ BaseType extends Map<unknown, unknown> ? _MapEntry<BaseType>
62
+ : BaseType extends Set<unknown> ? _SetEntry<BaseType>
63
+ : BaseType extends readonly unknown[] ? _ArrayEntry<BaseType>
64
+ : BaseType extends object ? _ObjectEntry<BaseType>
65
65
  : never;
66
+
67
+ export {};
package/source/exact.d.ts CHANGED
@@ -66,3 +66,5 @@ export type Exact<ParameterType, InputType> =
66
66
  // In TypeScript, Array is a subtype of ReadonlyArray, so always test Array before ReadonlyArray.
67
67
  : ParameterType extends readonly unknown[] ? ReadonlyArray<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>>
68
68
  : ExactObject<ParameterType, InputType>;
69
+
70
+ export {};
@@ -30,7 +30,7 @@ type Filtered = Filter<'bar', 'foo'>;
30
30
  */
31
31
  type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
32
32
 
33
- type ExceptOptions = {
33
+ export type ExceptOptions = {
34
34
  /**
35
35
  Disallow assigning non-specified properties.
36
36
 
@@ -106,3 +106,5 @@ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Requ
106
106
  } & (Options['requireExactProps'] extends true
107
107
  ? Partial<Record<KeysType, never>>
108
108
  : {});
109
+
110
+ export {};
@@ -0,0 +1,37 @@
1
+ import type {SplitOnRestElement} from './split-on-rest-element.d.ts';
2
+ import type {IsArrayReadonly} from './internal/array.d.ts';
3
+ import type {UnknownArray} from './unknown-array.d.ts';
4
+
5
+ /**
6
+ Create a tuple with the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element removed.
7
+
8
+ @example
9
+ ```
10
+ import type {ExcludeRestElement} from 'type-fest';
11
+
12
+ type T1 = ExcludeRestElement<[number, ...string[], string, 'foo']>;
13
+ //=> [number, string, 'foo']
14
+
15
+ type T2 = ExcludeRestElement<[...boolean[], string]>;
16
+ //=> [string]
17
+
18
+ type T3 = ExcludeRestElement<[...'foo'[], true]>;
19
+ //=> [true]
20
+
21
+ type T4 = ExcludeRestElement<[number, string]>;
22
+ //=> [number, string]
23
+ ```
24
+
25
+ @see ExtractRestElement, SplitOnRestElement
26
+ @category Array
27
+ */
28
+ export type ExcludeRestElement<Array_ extends UnknownArray> =
29
+ SplitOnRestElement<Array_> extends infer Result
30
+ ? Result extends readonly UnknownArray[]
31
+ ? IsArrayReadonly<Array_> extends true
32
+ ? Readonly<[...Result[0], ...Result[2]]>
33
+ : [...Result[0], ...Result[2]]
34
+ : Result
35
+ : never;
36
+
37
+ export {};
@@ -43,3 +43,5 @@ export type ExcludeStrict<
43
43
  ? unknown
44
44
  : never,
45
45
  > = Exclude<T, U>;
46
+
47
+ export {};