Releases: sindresorhus/type-fest
Releases Β· sindresorhus/type-fest
v5.1.0
New types
TupleOf(#1247) 7fb2f75Xor(#1254) ad04bc5SplitOnRestElement(#1166) 34b8fadExtractRestElement(#1166) 34b8fadExcludeRestElement(#1166) 34b8fad
Improvements
ReadonlyTuple: Deprecate in favor ofTupleOf(#1256) af4bebcTsConfigJson: Add missing lib enum values (#1263) 72f491fTsConfigJson: AddrewriteRelativeImportExtensions(#1262) 7d011ce
Fixes
PartialDeep: Fix behavior with functions containing multiple call signatures (#1259) 3bd9de6IsEqual: Fix behaviour when instantiated withneverandunknown(#1251) 785549fFixedLengthArray: Fix element type (#1246) ee29ef7is-equal: Fix handling with intersecting wrapped types (#1231) 5af60a1
v5.0.1
v5.0.0
Breaking
- This package is now pure ESM. Please read this.
- Require TypeScript 5.9 b5b0214
- Require Node.js 20 cc2b0f2
- Reminder:
type-festrequiresstrict: truein your tsconfig. StringKeyOf: Rename toKeyAsStringe492c9cArrayTail: EnablepreserveReadonlyby default and remove the option b34b1d8CamelCase/CamelCasedProperties/CamelCasedPropertiesDeep/PascalCase/PascalCasedProperties/PascalCasedPropertiesDeep: DisablepreserveConsecutiveUppercaseby default 8226c1b- This aligns it with the general JavaScript naming convention.
PartialDeep: DisableallowUndefinedInNonTupleArraysby default b3c4524Split: EnablestrictLiteralChecksby default 544a846Paths: DefaultmaxRecursionDepth5 (was 10) 2ab5decObservableLike: Move to sub-export 2a1072e- Deprecate
If*types in favor of a singleIf4c2151a
New types
Alphanumericβ Single alphanumeric character (AβZ,aβz,0β9). 484e030AllExtendβ Evaluates totrueif every element of a tuple/array extendsU. c8c6d55ConditionalSimplifyβ Simplifies a typeβs unions/intersections with opt-in controls. b7a4771ConditionalSimplifyDeepβ Deep version ofConditionalSimplifythat recurses into objects. b7a4771DigitCharacterβ Single ASCII digit character (0β9). 484e030ExcludeStrictβ Non-distributive, stricter variant ofExclude<T, U>. e6f62a2ExtendsStrictβ Non-distributiveA extends Bcheck. d71242aExtractStrictβ Non-distributive, stricter variant ofExtract<T, U>. 98d24faIsLowercaseβ Evaluates totrueif a string literal is all lowercase. afe132cIsNullableβ Evaluates totrueifTincludesnull. 5067e25IsOptionalβ Evaluates totrueifTincludesundefined. 5067e25IsOptionalKeyOfβ Evaluates totrueif propertyKofTis optional. 93728b5IsReadonlyKeyOfβ Evaluates totrueif propertyKofTis readonly. 93728b5IsRequiredKeyOfβ Evaluates totrueif propertyKofTis required. 93728b5IsUnionβ Evaluates totrueifTis a union type. b3d92edIsUndefinedβ Evaluates totrueif the type is exactlyundefined. f7bc576IsUppercaseβ Evaluates totrueif a string literal is all uppercase. afe132cLowercaseLetterβ Single lowercase Latin letter (aβz). 484e030RemovePrefixβ Removes a specified prefix from a string literal. 18a1c04UppercaseLetterβ Single uppercase Latin letter (AβZ). 484e030
Improvements
Jsonify: HandleunknownasJsonValue642bb13SetRequired/SetOptional/SetReadonly: Handle functions with properties a5e45d4Schema: Preserve arrays/remove extraneous unions 8a96def; dropundefinedforrecurseIntoArrays1cb955bReadonlyKeysOf/WritableKeysOf: Addobjectconstraint a6efbe0TsConfigJson: Add TypeScript 5.9 fields d2bda94
Fixes
Or: Fix withboolean,never,any42d6106And: Fix withboolean,never,anyb38ac60IsStringLiteral: Fix uncollapsed unions, and tagged types eb37799 / d1b35c7Paths: Fix behavior with index signatures 9926e5dConditionalKeys: Fix behavior with arrays and unions 4d7cc50RequiredDeep: Fix withundefinedbfcdbc4Split: Fix template strings ending with interpolation 853b881ArrayTail: Fix fix non-tuple arrays f3aabd8- Fix
UnionMinandUnionMaxd52d5e7
Meta
Huge thanks to all the contributors to this release, especially @som-sm π
v4.41.0
v4.40.1
v4.40.0
- Add
NonEmptyStringtype (#1103) 19a9c37 - Add
UnknownMaptype (#1106) b4ace2d - Add
UnknownSettype (#1106) b4ace2d IsFloat/IsInteger: Fix instantiations with numbers represented using exponential notation (#1101) 21a92f6
v4.39.1
v4.39.0
ArrayTail: AddpreserveReadonlyoption (#1091) 544271ePartialDeep: Fix behaviour whenstrictNullChecksis disabled (#1096) 7536baeOptionalKeysOf/RequiredKeysOf: Fix instantiations with unions and arrays (#1089) e1ac7b2WritableKeysOf/ReadonlyKeysOf: Fix behavior with unions and optional properties (#1088) bbf9137
v4.38.0
AsyncReturnType: Add support forPromiseLike(#1082) 72ccde9DelimiterCase/SnakeCase/ScreamingSnakeCase/KebabCase: Fix instantiations containing punctuations (#1080) 063e28dDelimiterCase: PassOptionsgeneric to all related types (#1078) 1974944CamelCasedPropertiesDeep: Make nested array objects respect the options (#1077) c11c9ca
v4.37.0
Sum: Add negative return value support (#1068) af5bfb7Subtract: Add negative return value support (#1061) 2b85ae2Split: AddstrictLiteralChecksoption (#1067) cc93f85Split: Fix instantiations with unions (#1067) cc93f85Replace: Fix instantiations with unions (#1065) a733698DelimiterCase/SnakeCase/ScreamingSnakeCase/KebabCase: Fix default value forsplitOnNumbersoption (#1073) e462e72