npm / type-fest
type-fest
What changed in type-fest 1 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
83 breaking2 deprecations192 new APIs and options4 performance21 behavior and defaults99 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittype-fest 6243 changes
Breaking changes 57
Case conversion now splits on punctuation by default; CamelCase keeps leading underscores and does not split on numbers. Pass old options to retain v5 results.
Leading underscores are preserved by default;
CamelCase<'_id'>is now'_id'.Number splitting is disabled by default;
CamelCase<'p2p_network'>is now'p2pNetwork'.Punctuation is split by default, and a leading
$is removed.The cased-properties types split on punctuation by default.
The deep cased-properties types split on punctuation by default.
Strict is the default since TypeScript 6; remove an explicit true setting and do not set it to false.
Matches
anyandneverlikeConditionalKeys;nevervalues are no longer picked andanyvalues are picked.Punctuation is split by default.
strictAnydefaults to true, soExtendsStrict<any, number>is now false; pass{strictAny: false}for the old behavior.Returns
neverfor the widenumbertype.Returns
neverfor non-literal lengths such asnumber; use a normal array type for an unknown length.Removed; use
Ifwith the matchingIs*type instead.Removed; use If<IsAny<T>, A, B>, or IsAny<T> when relying on the default branches.
Removed; use If<IsEmptyObject<T>, A, B>.
Removed; use If<IsNever<T>, A, B>.
Removed; use If<IsNull<T>, A, B>; note IsNull<any> is now false.
Removed; use If<IsUnknown<T>, A, B>.
Returns
falseforobjectandany; an input ofneveralso returnsfalse.Returns
falseforanyandnever, rather thantrue.Returns
falseforanyandnever, rather thantrue.Rejects values typed
object, since they can contain anything.Case conversion types now split on punctuation by default; pass splitOnPunctuation: false for v5 behavior.
Punctuation is split by default; for example,
KebabCase<'div.card::after'>is now'div-card-after'.Rejects
Infinityand-Infinity.Node.js 22 is now required to use type-fest.
Returns
neverfor the widenumbertype and rejectsInfinityand-Infinity.Array recursion is enabled by default, making array and tuple elements deeply partial and fixed tuple elements optional.
Array recursion is enabled by default.
Case conversion now splits on punctuation by default; PascalCase keeps leading underscores and does not split on numbers.
Leading underscores are preserved by default;
PascalCase<'_foo_bar'>is now'_FooBar'.Number splitting is disabled by default.
Punctuation is split by default.
Predicates return
falseinstead ofneverwhen an input isnever; callers checking fornevershould check forfalse.Predicates that returned never for never now return false, causing conditionals to take their false branch.
Now transforms Date into ReadonlyDate, which has no set methods and is not assignable to Date; use keep: Date to preserve dates.
Removed; use
Readonly<TupleOf<Length, Element>>instead.Punctuation is split by default.
Returns
neverforbooleanand leaves broad object types such asobjectandRecord<string, number>as is.Punctuation is split by default.
Renamed the
strictLiteralChecksoption tostrict; the old option name is no longer valid.Replaced
mapNonLiteralsDirectlywithstrict, which has the opposite meaning; old option names give a compiler error.Adds four lib values and changes generateTrace to a directory string; removes compiler options and values listed in the migration guide.
Removes baseUrl, outFile, downlevelIteration, charset, importsNotUsedAsValues, preserveValueImports, keyofStringsOnly, noImplicitUseStrict, noStrictGenericChecks, suppressExcessPropertyErrors, suppressImplicitAnyIndexErrors, watch, fallbackPolling, watchDirectory, watchFile, and listFilesOnly.
Now accepts only true.
Now accepts only true.
Removes this type; use the corresponding type in TsConfigJson.WatchOptions.
Removes the ImportsNotUsedAsValues type.
Removes the ES2022.SharedMemory value.
Removes the None, AMD, UMD, and System values.
Removes the Classic, Node, and Node10 values.
Removes the ES3 and ES5 values.
Removes this type; use the corresponding type in TsConfigJson.WatchOptions.
Removes this type; use the corresponding type in TsConfigJson.WatchOptions.
Removed options and values that TypeScript 5.5 removed and TypeScript 6.0 deprecated.
TypeScript 6 is now required to use type-fest.
Requires TypeScript 6 or later.
New APIs and options 125
Matches any asynchronous function.
Matches any function.
Applies default options to specified options while preserving literal types.
Splits an array into consecutive chunks of a given size.
Groups an array of objects by a property while preserving order within each group.
Transforms an array of objects into a record keyed by one of their properties.
Removes elements of a given type from both ends of an array.
Removes elements of a given type from the end of an array.
Removes elements of a given type from the start of an array.
Removes duplicate element types from an array while preserving their first occurrence.
Pairs elements at matching positions in two arrays.
Matches a single ASCII punctuation character.
Allows any object type in an interface
extendsclause or classimplementsclause.Matches an asynchronous function.
Represents a string in camel case, such as
'fooBar'.Collapses literal union members into broader types already present in the union.
Adds strict matching so the whole union value must match the condition.
Adds strict matching so the whole union value must match the condition.
Adds strict matching so the whole union value must match the condition.
Returns whether a string consists only of zero or more repetitions of a given pattern.
Converts a function into a chain of functions that each accept one argument.
Creates a defaults-object type from an options type, requiring only its optional keys.
Represents a strictly empty readonly array, implemented as
readonly [].Allows exclusions from overlapping union members.
Excludes a given type from values of object properties or array elements.
Extracts literal types from a union, removing wide and infinite string types.
Extracts a given type from values of object properties or array elements.
Extracts the type of the first element of an array.
Attaches a name to a type without requiring a cast, preventing differently named types from being mixed.
Creates an object type from an array of key-value pairs.
Extracts a function type's parameters as a tuple.
Extracts the type that a type-predicate function narrows its parameter to.
Checks whether a function type has multiple distinct call signatures.
Returns
falsefor index signatures, arrays without required elements, andany.Gets shared keys whose
Sourceproperty is not assignable to theTargetproperty.Returns the union of indices where a given item can be found in an array.
Creates a tuple of the indices of a constant array or tuple.
Creates a record mapping each property value to its original keys.
Checks whether two types are mutually assignable.
Checks whether a type is a
numberor numeric string.Checks whether a string is numeric and has no surrounding whitespace.
Checks whether a type is a primitive.
Checks whether an array or tuple is readonly.
Checks whether a type is a record-like object.
Checks whether a union type includes a given member.
Checks whether a non-empty string consists only of whitespace characters.
Joins a union of strings and/or numbers using a given delimiter.
Matches an array that can be losslessly converted to JSON.
Matches an object that can be losslessly converted to JSON.
Validates whether a function argument can be losslessly converted to JSON, including interfaces.
Generates a union of all possible JSON Pointer strings for a type.
Represents a string in kebab case, such as
'foo-bar'.Enforces a tuple containing exactly the members of a union, with no duplicates or omissions.
Gets the key type of a
Map,ReadonlyMap, orWeakMap.Gets the value type of a
Map,ReadonlyMap, orWeakMap.Resolves a property key to the matching object key type, converting numeric and string forms when needed.
Merges any number of types, with later types overriding earlier keys.
Creates an array type with at least a given number of elements.
Creates a type by overriding object keys with a modifier type and removing keys set to
never.Recursively creates a type by applying modifiers and removing keys set to
never.Allows leaf values at all levels when the dimension is not known.
Returns a specified number with its sign reversed.
Represents a string for a non-negative integer, such as
'42'.Returns a boolean indicating whether a type is
false.Describes key-value pairs produced by
Object.entries, including for generic object types.Describes a single key-value pair produced by
Object.entries, including for generic object types.Converts an object with consecutive numeric keys starting at zero into a tuple.
Creates a union of single-property objects, one per property of the given object.
Gets a union of all paths to optional properties in an object.
Extracts parameter types of all overloads as a union.
Extracts return types of all overloads as a union.
Extracts overload signatures as a tuple, preserving declaration order.
Deeply overrides existing properties, requiring overridden keys to exist at every level.
Converts a property path into a tuple of keys with numeric indices.
Creates the type of a function with given leading arguments already applied.
Adds a keep option to leave matching types as is.
Makes keys accepting
undefinedoptional.Represents a string in pascal case, such as
'FooBar'.Adds valueType, recurseIntoArrays, requiredOnly, and maxCircularDepth options.
Keeps union members that the path cannot enter and merges several paths into the same tuple.
Picks only properties whose types are not
never.Picks only readonly properties from an object type.
Picks only writable properties from an object type.
Creates a function-pipeline signature that checks compatibility between adjacent stages.
Gets a property's type, or
neverif the key does not exist.Matches a
Datethat cannot be changed.Requires a function to have at least a given number of required parameters.
Makes all keys required while allowing formerly optional keys to accept
undefined.Makes all keys required and non-nullable, including array or tuple elements.
Creates an object type forbidding given keys, for intersection with another object type.
Extracts named parameters from a URL route pattern such as
/users/:id.Converts top-level object properties to screaming snake case.
Recursively converts object properties to screaming snake case.
Represents a string in screaming snake case, such as
'FOO_BAR'.Makes given keys nullable while leaving remaining keys unchanged.
Makes given keys optional using deeply nested key paths.
Makes all keys optional except the given keys.
Makes all keys required except the given keys.
Makes given keys required and non-nullable while leaving remaining keys unchanged.
Flattens a union to improve editor type hints by showing members instead of alias names.
Represents a string in snake case, such as
'foo_bar'.Returns whether a given string starts with a given prefix.
Adds a type that reverses the order of characters in a string literal type.
Adds a type that converts a boolean string to a boolean literal.
Adds a type that constrains a type to be a subset of another type and returns it as is.
Adds a type that recursively replaces every occurrence of a type in another type.
Adds a type representing either a value or a function that returns the value.
Adds a type that converts a primitive type to its string representation.
Adds a type that removes falsy types from the given type, like an if condition does.
Adds a type that returns the length of a tuple.
Adds a type that returns the maximum number in a tuple of numbers.
Adds a type that returns the minimum number in a tuple of numbers.
Adds an enum-like object type from tuple keys, mapping each key to itself or its index with the numeric option.
Adds a Buffer type parameter.
Adds a type that converts a chain of functions into one function accepting all arguments at once.
Adds a deep type where leaf values accept undefined while object containers remain present.
Adds a type that allows undefined for all optional keys.
Adds a type that makes properties with undefined unions optional and removes undefined from their values.
Adds a type that returns the minimum number in a union of numbers.
Adds an enum-like object type from union keys, mapping each key to itself.
Adds a type matching arrays, maps, and sets, including readonly and weak variants.
Adds a type that removes brand properties from primitive types while preserving literal types.
Removes all tags from a type with several tags.
Adds a union of all leaf values in an object, including nested objects and arrays.
Adds a type matching a single whitespace character.
Performance 2
Fixes slow type-checking when Exact is used with an index signature and a generic input value.
Improves type-checking performance, especially for Get, PickDeep, OmitDeep, and Set*Deep with large object types.
Behavior and default changes 15
Accepts readonly argument tuples.
Deep types no longer recurse into DOM nodes such as
HTMLElement.Accepts keys that are not in the type.
Pairs each key with its own value instead of combining key and value unions.
Pairs each key with its own value instead of combining key and value unions.
Accepts numbers in paths, non-literal number indexes on arrays and tuples, and Paths<T> for generic T.
Now supports bigint.
Supports enum and non-literal bounds.
Literal keys of index signatures are read like the index signature;
anyobjects are read likeRecord<PropertyKey, any>.Allows leaf values at all levels when the dimension is not known.
Many numeric and string types now accept branded primitives and enum members.
Accepts paths deeper than Paths lists; also keeps union members a path cannot enter and merges several paths into the same tuple.
Accepts paths deeper than Paths lists.
Leaves missing dictionary entries out of the result.
Reads values from every union member;
ValueOf<{a: 1} | {b: 2}>is now1 | 2.
Fixes and other changes 44
Preserves readonly index signatures.
Accepts number keys for a string index signature.
Fixes slow type-checking and false rejections with an index signature and a generic input value.
Treats NaN keys as numeric.
Fixes out-of-memory type-checking with generic keys.
Accepts readonly argument tuples.
Fixes optional elements, readonly arrays, negative indexes, and unknown lengths.
Keeps the return type of each function in a union.
Fixes non-literal, branded, Unicode, and mixed union inputs.
Enable exactOptionalPropertyTypes in tsconfig; strict does not enable it.
Keeps declared keys when the object has an index signature.
Now recurses into optional object properties.
Accepts readonly argument tuples.
Keeps tuples, functions, receivers, and built-in types.
Fixes union inputs, index signatures with object values, and nested objects under optional or nullable properties.
Keeps found globals when other names are missing.
Returns
undefinedfor union members that do not have the requested key.Fixes decimal fractions, branded numbers, and enum members.
Returns
booleanforany; an input ofneverreturnsfalse.Fixes unresolved results for template literal types intersected with an empty object and wrapped results in generic code.
Fixes wrapped results in generic code.
Literal keys of index signatures are read like the index signature;
anyobjects are read likeRecord<PropertyKey, any>.Literal keys of index signatures are read like the index signature;
anyobjects are read likeRecord<PropertyKey, any>.Literal keys of index signatures are read like the index signature;
anyobjects are read likeRecord<PropertyKey, any>.Fixes empty rest elements and keeps a union delimiter the same in the whole result.
Fixes omission based on toJSON results, optional and tagged tuple handling, literal keys next to index signatures, and infinite recursion with JsonValue.
Accepts keys narrowed with keyof on generic types.
Now supports bigint.
Returns
anyforany.Keeps tuples as tuples;
[1]becomes[number]instead ofnumber[].Keeps the call signatures of the input.
Fixes tuples, optional tuple positions, readonly properties, symbols, and numeric index signatures.
Fixes union members.
Many object types consistently match numeric keys and their string forms, and string enum keys.
Keeps a tuple or array unchanged for out-of-bounds, negative, or noncanonical indexes.
Adds gypfile and libc and accepts array funding, nested exports and imports fallback arrays, and required peer dependency metadata.
Returns
stringwhen a non-literal input cannot contain the prefix.Returns
stringwhen a non-literal input cannot contain the suffix.Fixes non-literal search strings.
Keeps this parameters and readonly rest parameters.
Keeps functions, class constructors, and branded primitives as is.
Non-literal parts produce
stringelements; for example,StringToArray<Lowercase<string>>is nowstring[].Accepts readonly dates, shared array buffers, and BigInt wrapper objects.
Fixes numeric enum keys and keeps readonly containers when no keys are selected.
type-fest 5118 changes
Breaking changes 14
preserveReadonly is enabled by default and the option is removed.
preserveConsecutiveUppercase is disabled by default, aligning with general JavaScript naming conventions.
KeyAsString replaces StringKeyOf.
Node.js 20 cc2b0f2 is now required.
ObservableLike has moved to a sub-export.
allowUndefinedInNonTupleArrays is disabled by default.
The default maxRecursionDepth is now 5 instead of 10.
ReadonlyKeysOf now has an object constraint.
Schema preserves arrays, removes extraneous unions, and drops undefined for recurseIntoArrays.
strictLiteralChecks is enabled by default.
The package requires strict: true in the TypeScript tsconfig.
The package is now pure ESM, so consumers must use ESM-compatible imports and configuration.
TypeScript 5.9 b5b0214 is now required.
WritableKeysOf now has an object constraint.
Deprecations 2
If is the single replacement for the deprecated If* types.
The If* types are deprecated in favor of the single If type.
New APIs and options 51
Adds the UnionMax type.
Adds the RenameKeys type for renaming keys.
Adds Float16Array to the types supported by TypedArray.
Adds the ExtractExactly type.
Adds the StringLength type.
Adds the StringToArray type.
Adds the StringToNumber type.
Adds the RemoveSuffix type.
Adds the UnwrapRequired type.
Adds the Absolute type.
Adds the preserveLeadingUnderscores option.
Adds the splitOnPunctuation option.
Adds the NonNullableDeep type.
Adds TypeScript 6.0 fields to TsConfigJson.
Adds the UnionLength type.
A new type is available.
A new type is available.
A new type is available.
A new type is available.
A new type is available.
A new type is available.
A new type is available.
Adds the ArrayReverse type.
Adds the ObjectMerge type.
Adds the UnwrapPartial type.
Adds the overrides property to PackageJson.
Adds the ArrayElement type.
Adds the splitOnNumbers option to CamelCase.
Adds the ExclusifyUnion type.
Adds a devEngines type to PackageJson.
Adds a type that evaluates to true if every element of a tuple or array extends U.
Adds a type for a single alphanumeric character: A–Z, a–z, or 0–9.
Adds a type to simplify unions and intersections with opt-in controls.
A new ConditionalSimplifyDeep type is available.
Adds a type for a single ASCII digit character, 0–9.
Adds a non-distributive, stricter variant of Exclude<T, U>.
Adds a non-distributive A extends B check.
Adds a non-distributive, stricter variant of Extract<T, U>.
Adds a type that evaluates to true if a string literal is all lowercase.
Adds a type that evaluates to true if T includes null.
Adds a type that evaluates to true if T includes undefined.
Adds a type that evaluates to true if property K of T is optional.
Adds a type that evaluates to true if property K of T is readonly.
Adds a type that evaluates to true if property K of T is required.
Adds a type that evaluates to true if the type is exactly undefined.
Adds a type that evaluates to true if T is a union type.
Adds a type that evaluates to true if a string literal is all uppercase.
Adds a type for a single lowercase Latin letter, a–z.
Adds a type that removes a specified prefix from a string literal.
TsConfigJson now includes TypeScript 5.9 fields.
Adds a type for a single uppercase Latin letter, A–Z.
Performance 1
Improves type instantiation performance of array and string types.
Behavior and default changes 4
IntRange now supports negative values.
Supports generating really long strings.
The engines field uses LiteralUnion, changing the accepted type for engine values.
Jsonify now handles unknown as JsonValue.
Fixes and other changes 46
Fixes a compilation failure on targets below ES2025.
Fixes behavior with unions.
Prevents optional properties from leaking undefined into the key set.
Prevents the processed union from distributing over a mapped type.
Fixes Writable behavior with index signatures.
Fixes handling of tuples with optional elements.
Fixes incorrect handling of any and unknown fields.
Fixes behavior with extremely large and small counts.
Fixes behavior with explicit undefined.
Fixes behavior with non-single character delimiters.
Fixes behavior with union delimiters.
Removes an incorrect optimization and always falls back to string for non-literal prefixes.
Fixes behavior with an any prefix in non-strict mode.
Fixes behavior with large unions.
Fixes returning
{}instead ofneverwhen no keys match.Fixes returning
{}instead ofneverwhen no keys match.Fixes behavior with the
numbertype.Fixes behavior when a union member is a supertype of another.
Fixes behavior when the entire union extends all individual members.
Fixes behavior with WeakMaps and WeakSets.
Fixes leavesOnly behavior with never leaves.
Fixes behavior with tuples containing optional elements and a rest element.
Fix idempotency so Merge<A, A> returns A.
Fix behavior with generic types.
Fixes behavior with unions.
Fixes behavior with arrays.
Removes extra undefined from optional properties in MergeDeep results.
Fixes the key type for DependencyOverrides in PackageJson.
Fixes behavior with unions.
Prevents mapping over built-ins.
Fixes generic inference for IsEqual.
Fixes generic assignability with arrays.
Fixes behavior with operands like N and N | N + >0.
Fixes And behavior with boolean, never, and any.
Fixes behavior for non-tuple arrays.
Fixes behavior with arrays and unions.
Fixes handling of uncollapsed unions and tagged types.
Fixes Or behavior with boolean, never, and any.
Fixes behavior with index signatures.
Fixes behavior with undefined.
SetOptional now handles functions with properties.
SetReadonly now handles functions with properties.
SetRequired now handles functions with properties.
Fixes template strings ending with interpolation.
Fixes UnionMax.
Fixes UnionMin.
type-fest 45 changes
Breaking changes 3
Node.js 16 is now required.
The deprecated RemoveIndexSignature alias is removed; rename it to OmitIndexSignature.
TypeScript 5.1 is now required.
Performance 1
Avoids recursion.
Fixes and other changes 1
Fixes handling of tuples.
type-fest 324 changes
Breaking changes 7
The strict option now defaults to true.
Node.js 14 or later is required.
The recurseIntoArrays option now defaults to false.
PromiseValue is removed in favor of TypeScript's built-in Awaited type.
The deep option is removed because it caused problems with the TypeScript compiler.
TypeScript 4.7 or later is required.
The Mutable type is renamed to Writable.
New APIs and options 9
A new ConditionalPickDeep type is available.
A new ConditionalSimplify type is available.
A new EmptyObject type is available.
A new IsEmptyObject type is available.
A new OmitIndexSignature type is available.
PackageJson includes a packageManager field.
A new PickIndexSignature type is available.
TsConfigJson supports additional Module values.
A new TupleToUnion type is available.
Behavior and default changes 2
Jsonify supports optional object keys.
Merge supports index signatures and has improved performance.
Fixes and other changes 6
DelimiterCase accepts screaming snake case as input.
A regression introduced after TypeScript 4.8 is fixed.
The JsonObject type is fixed.
Merge no longer incorrectly overwrites index signature types.
Merge fixes handling of optional keys and type overrides.
The PackageJson type is fixed.
type-fest 26 changes
Breaking changes 2
Node.js 12.20 is now required.
TypeScript 4.2 is now required.
New APIs and options 2
Adds the Constructor type.
Adds the Jsonify type.
Fixes and other changes 2
The Class type is improved.
The Opaque type is improved.
type-fest 15 changes
New APIs and options 5
Adds the CamelCasedProps type.
Adds the CamelCasedPropsDeep type.
Adds the LastArrayElement type.
Adds the Split type.
Adds the Trim type.