Skip to content

@snailicide/build-config / utilities

utilities

Functions

FunctionDescription
getFileExtensionList-
globFileFilter-
isPlainObject-
safeDeserializeJSON-
importJSON-

Type Aliases

Array

Type AliasDescription
MergeDeepMerge two objects or two arrays/tuples recursively into a new type.
PartialDeepCreate a type from another type with all keys and nested keys set to optional.

JSON

Type AliasDescription
JsonifiableMatches a value that can be losslessly converted to JSON.
JsonifyTransform a type to one that is assignable to the JsonValue type.

Map

Type AliasDescription
PartialDeepCreate a type from another type with all keys and nested keys set to optional.

Object

Type AliasDescription
LiteralToPrimitiveDeepLike LiteralToPrimitive except it converts literal types inside an object or array deeply.
MergeDeepMerge two objects or two arrays/tuples recursively into a new type.
MergeMerge two types into a new type. Keys of the second type overrides keys of the first type.
PartialDeepCreate a type from another type with all keys and nested keys set to optional.
SimplifyDeepDeeply simplifies an object type.
SimplifyUseful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
StringifiedCreate a type with the keys of the given type changed to string type.
ValueOfCreate a union of the given object's values, and optionally specify which keys to get the values from.

Other

Type AliasDescription
JSFileExtensions-
TSFileExtensions-
JSLikeFileExtensions-
PrettierFileExtensions-
AllowedExtensions-
LintStagedConfig-
NotAssignableToJson-
JSONCompatible-

Set

Type AliasDescription
PartialDeepCreate a type from another type with all keys and nested keys set to optional.

Type

Type AliasDescription
LiteralToPrimitiveDeepLike LiteralToPrimitive except it converts literal types inside an object or array deeply.
LiteralToPrimitiveGiven a literal type return the primitive type it belongs to, or never if it's not a primitive.
LiteralUnionAllows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
PrimitiveMatches any primitive value.

Utilities

Type AliasDescription
MergeDeepMerge two objects or two arrays/tuples recursively into a new type.

Variables

VariableDescription
JS_FILE_EXTENSIONS-
TS_FILE_EXTENSIONS-
JSLIKE_FILE_EXTENSIONS-
PRETTIER_FILE_EXTENSIONS-
default-