UNPKG

remeda

Version:

A utility library for JavaScript and Typescript.

1 lines 406 kB
{"version":3,"file":"index.d.ts","names":["Primitive","UnionToIntersection","Union","Intersection","UnionToIntersection","KeysOfUnion","ObjectType","Record","emptyObjectSymbol","EmptyObject","IsEmptyObject","T","IsAny","T","NoInfer","IsAny","IsOptionalKeyOf","Type","Key","Record","IsOptionalKeyOf","OptionalKeysOf","Type","Key","OptionalKeysOf","RequiredKeysOf","Type","Exclude","RequiredKeysOf","HasRequiredKeys","BaseType","IsNever","T","IsNever","If","Type","IfBranch","ElseBranch","UnknownArray","If","IsAny","IsNever","Primitive","UnknownArray","BuiltIns","Date","RegExp","NonRecursiveType","Function","Promise","MapsSetsOrArrays","ReadonlyMap","WeakKey","WeakMap","ReadonlySet","WeakSet","IsBothExtends","BaseType","FirstType","SecondType","HasMultipleCallSignatures","T","IsNotFalse","IsPrimitive","Not","A","IfNotAnyOrNever","IfAny","IfNever","IsAnyOrNever","IsExactOptionalPropertyTypesEnabled","If","IsNever","OptionalKeysOf","UnknownArray","IsExactOptionalPropertyTypesEnabled","IfNotAnyOrNever","ArrayLength","T","UnknownArrayOrTuple","FirstArrayElement","TArray","StaticPartOfArray","Result","V","U","VariablePartOfArray","SetArrayAccess","IsReadonly","IsArrayReadonly","CollapseRestElement","_CollapseRestElement","ForwardAccumulator","BackwardAccumulator","Rest","Last","First","Whitespace","WordSeparators","AsciiPunctuation","IsFloat","T","Not","IsFloat","PositiveInfinity","NegativeInfinity","IsInteger","T","IsFloat","IsInteger","_Numeric","Zero","PositiveInfinity","NegativeInfinity","Finite","T","Integer","Float","NegativeFloat","Negative","NegativeInteger","NonNegative","NonNegativeInteger","IsNegative","tag","default","tag","TagContainer","Token","Tag","TagMetadata","PropertyKey","Tagged","Type","TagName","GetTagMetadata","UnwrapTagged","TaggedType","RemoveAllTags","T","ThisTag","Opaque","UnwrapOpaque","OpaqueType","default","Primitive","_Numeric","CollapseLiterals","IfNotAnyOrNever","IsNotFalse","IsPrimitive","IsNever","TagContainer","UnwrapTagged","LiteralCheck","T","LiteralType","U","LiteralChecks","LiteralUnionType","IsStringLiteral","S","_IsStringLiteral","Record","IsNumericLiteral","IsBooleanLiteral","IsSymbolLiteral","IsLiteralUnion","IsLiteral","IsNull","T","IsNull","IsUnknown","T","If","IfNotAnyOrNever","IsNegative","UnknownArray","TupleOf","Length","Fill","_TupleOf","L","Accumulator","Whitespace","TrimLeft","V","R","TrimRight","Trim","TupleOf","NegativeInfinity","PositiveInfinity","Trim","Whitespace","ToString","T","StringToNumber","S","StartsWith","SearchString","StringToArray","Result","R","F","StringLength","IsWhitespace","Rest","IsNumeric","SameLengthPositiveNumericStringGt","A","B","RestA","RestB","FirstA","FirstB","PositiveNumericCharacterGt","NumericString","PositiveNumericStringGt","Remain","HeadB","IsNever","Finite","NegativeInfinity","PositiveInfinity","UnknownArray","StringToNumber","IsAnyOrNever","NumberAbsolute","N","StringPositiveN","IsNumberLike","UnionMin","InternalUnionMin","T","UnionMax","InternalUnionMax","Exclude","ReverseSign","Simplify","T","KeyType","IsNever","IsEqual","A","B","_IsEqual","G","OmitIndexSignature","ObjectType","KeyType","Record","PickIndexSignature","ObjectType","KeyType","Record","OmitIndexSignature","PickIndexSignature","Simplify","SimpleMerge","Destination","Source","Key","Merge","Simplify","IsEqual","KeysOfUnion","RequiredKeysOf","Merge","OptionalKeysOf","IsAny","If","IsNever","FilterDefinedKeys","FilterOptionalKeys","MapsSetsOrArrays","NonRecursiveType","ToString","BuildObject","Key","Value","CopiedFrom","PropertyKey","Pick","NumberKey","IsPlainObject","T","ObjectValue","K","NumberK","UndefinedToOptional","Exclude","HomomorphicPick","Keys","P","Extract","ValueOfUnion","Union","ReadonlyKeysOfUnion","ApplyDefaultOptions","Options","Defaults","SpecifiedOptions","Required","Omit","Record","Partial","CollapseLiterals","If","IsNever","Or","A","B","_Or","If","CollapseRestElement","ApplyDefaultOptions","IfNotAnyOrNever","Not","IsAny","IsNever","Or","UnknownArray","AllExtendOptions","DefaultAllExtendOptions","AllExtend","TArray","Type","Options","_AllExtend","Required","First","Rest","AllExtend","And","A","B","NumberAbsolute","PositiveNumericStringGt","IsEqual","PositiveInfinity","NegativeInfinity","IsNegative","And","Or","GreaterThan","A","B","R","GreaterThan","GreaterThanOrEqual","A","B","GreaterThanOrEqual","LessThan","A","B","GreaterThan","LessThan","NegativeInfinity","PositiveInfinity","UnknownArray","TupleLength","T","TupleMax","A","Result","F","R","TupleMin","Simplify","RequiredFilter","Type","Key","OptionalFilter","EnforceOptional","ObjectType","Exclude","ApplyDefaultOptions","IsEqual","Filter","KeyType","ExcludeType","ExceptOptions","DefaultExceptOptions","Except","ObjectType","KeysType","Options","_Except","Required","Record","Partial","Except","If","IfNotAnyOrNever","IsAny","IsNever","RequireAtLeastOne","ObjectType","KeysType","_RequireAtLeastOne","Key","Pick","Required","Exclude","Partial","UnknownRecord","PropertyKey","Record","Except","Simplify","WritableArray","ArrayType","U","V","ReadonlyArray","Writable","BaseType","Keys","ReadonlyMap","KeyType","ValueType","Map","ReadonlySet","ItemType","Set","Pick","NonEmptyTuple","T","If","IfNotAnyOrNever","IsArrayReadonly","UnknownArray","ArrayTail","TArray","_ArrayTail","Result","Readonly","ConditionalSimplifyDeep","Type","ExcludeType","IncludeType","TypeKey","ConditionalSimplifyDeep","MapsSetsOrArrays","NonRecursiveType","SimplifyDeep","Type","ExcludeType","ConditionalSimplifyDeep","OmitIndexSignature","PickIndexSignature","Merge","FirstArrayElement","IsBothExtends","UnknownArrayOrTuple","EnforceOptional","NonEmptyTuple","ArrayTail","_ArrayTail","UnknownRecord","SimplifyDeep","UnknownArray","Writable","TArray","Key","SimplifyDeepExcludeArray","T","MergeDeepRecordProperty","Destination","Source","Options","MergeDeepInternalOptions","Exclude","MergeDeepOrReturn","DoMergeDeepRecord","MergeDeepRecord","PickRestTypeHelper","Tail","Type","PickRestType","OmitRestTypeHelper","Result","OmitRestType","TypeNumberOrType","PickRestTypeFlat","MergeDeepArrayOrTupleElements","DoMergeDeepTupleAndTupleRecursive","DestinationRestType","SourceRestType","MergeArrayTypeAndTuple","MergeTupleAndArrayType","MergeDeepTupleAndTupleRecursive","Tuple","ArrayType","MergeDeepTupleAndArrayRecursive","MergeDeepArrayAndTupleRecursive","ArrayMergeMode","ShouldSpread","DoMergeArrayOrTuple","Array","MergeDeepArrayRecursive","MergeDeepArrayOrTupleRecursive","MergeDeepArrayOrTuple","DefaultType","MergeDeepOptions","DefaultMergeDeepOptions","MergeDeepWithDefaultOptions","MergeDeep","IsNever","IsUnion","T","InternalIsUnion","U","NumberAbsolute","ReverseSign","PositiveInfinity","NegativeInfinity","IsNegative","LessThan","TupleOf","Subtract","A","B","SubtractPostChecks","AreNegative","SubtractPositives","R","SubtractIfAGreaterThanB","StaticPartOfArray","VariablePartOfArray","GreaterThanOrEqual","Subtract","UnknownArray","TupleOf","SplitFixedArrayByIndex","T","SplitIndex","V","U","SplitVariableArrayByIndex","T1","T2","SplitArrayByIndex","ArraySplice","Start","DeleteCount","Items","X","ValueOf","ObjectType","ValueType","IsNever","IsAny","ExtendsStrict","Left","Right","If","ApplyDefaultOptions","IsAny","IsNever","UnknownArray","IsTupleOptions","DefaultIsTupleOptions","IsTuple","TArray","Options","_IsTuple","Required","IsTuple","UnknownArray","IsAny","If","TupleToObject","TArray","Key","ExtendsStrict","IfNotAnyOrNever","TupleToObject","UnknownArray","ConditionalKeys","Base","Condition","_Base","_ConditionalKeys","Key","JoinableItem","NullishCoalesce","Value","Fallback","NonNullable","Join","Items","Delimiter","First","Tail","Head","Last","TupleOf","NumberAbsolute","TupleMax","ReverseSign","PositiveInfinity","NegativeInfinity","IsNegative","Subtract","Sum","A","B","SumPostChecks","AreNegative","SumPositives","Result","GreaterThan","LessThanOrEqual","A","B","Sum","LessThanOrEqual","GreaterThanOrEqual","GreaterThan","IsNegative","Not","TupleMin","IsEqual","And","ArraySplice","IsNever","ArraySlice","Array_","Start","End","_ArraySlice","VariableLengthArraySliceHelper","ArraySliceHelper","ArraySliceByPositiveIndex","TraversedElement","Result","ArrayLength","PositiveS","PositiveE","Array","AddResult","Except","TupleOf","ArrayLengthMutationKeys","FixedLengthArray","Element","Length","TupleOf","Subtract","IntRange","Start","End","Step","PrivateIntRange","Gap","List","EndLengthTuple","Exclude","ArrayIndices","Element","Partial","Exclude","NonRecursiveType","IsNever","IsUnion","Simplify","UnknownArray","SharedUnionFields","Union","ReadonlyMap","ReadonlySet","Extract","SkippedMembers","Exclude","RelevantMembers","Pick","NonRecursiveType","ReadonlyKeysOfUnion","ValueOfUnion","KeysOfUnion","SharedUnionFields","Simplify","UnknownArray","AllUnionFields","Union","ReadonlyMap","ReadonlySet","Extract","SkippedMembers","Exclude","RelevantMembers","P","AllExtend","IsLowercase","S","_IsLowercase","Accumulator","Rest","First","IsLowercaseHelper","Lowercase","Uppercase","Capitalize","AllExtend","IsUppercase","S","_IsUppercase","Accumulator","Rest","First","IsUppercaseHelper","Uppercase","Lowercase","Uncapitalize","ApplyDefaultOptions","IsNumeric","WordSeparators","IsLowercase","IsUppercase","SkipEmptyWord","Word","RemoveLastCharacter","Sentence","Character","LeftSide","WordsOptions","_DefaultWordsOptions","Words","Options","WordsImplementation","LastCharacter","CurrentWord","Required","RemainingCharacters","FirstCharacter","ApplyDefaultOptions","Words","WordsOptions","CamelCaseOptions","_DefaultCamelCaseOptions","CamelCaseFromArray","Options","OutputString","Required","FirstWord","Capitalize","RemainingWords","Lowercase","CamelCase","Type","Uppercase","Uncapitalize","And","ApplyDefaultOptions","Not","IsStringLiteral","Or","SplitOptions","DefaultSplitOptions","Split","S","Delimiter","Options","SplitHelper","Accumulator","Required","Tail","Head","LastArrayElement","Elements","ElementBeforeTailingSpreadElement","V","U","ReadonlyArray"],"sources":["../src/add.ts","../node_modules/type-fest/source/primitive.d.ts","../node_modules/type-fest/source/union-to-intersection.d.ts","../node_modules/type-fest/source/keys-of-union.d.ts","../node_modules/type-fest/source/empty-object.d.ts","../node_modules/type-fest/source/is-any.d.ts","../node_modules/type-fest/source/is-optional-key-of.d.ts","../node_modules/type-fest/source/optional-keys-of.d.ts","../node_modules/type-fest/source/required-keys-of.d.ts","../node_modules/type-fest/source/has-required-keys.d.ts","../node_modules/type-fest/source/is-never.d.ts","../node_modules/type-fest/source/if.d.ts","../node_modules/type-fest/source/unknown-array.d.ts","../node_modules/type-fest/source/internal/type.d.ts","../node_modules/type-fest/source/internal/array.d.ts","../node_modules/type-fest/source/internal/characters.d.ts","../node_modules/type-fest/source/is-float.d.ts","../node_modules/type-fest/source/is-integer.d.ts","../node_modules/type-fest/source/numeric.d.ts","../../../node_modules/tagged-tag/index.d.ts","../node_modules/type-fest/source/tagged.d.ts","../node_modules/type-fest/source/is-literal.d.ts","../node_modules/type-fest/source/is-null.d.ts","../node_modules/type-fest/source/is-unknown.d.ts","../node_modules/type-fest/source/tuple-of.d.ts","../node_modules/type-fest/source/trim.d.ts","../node_modules/type-fest/source/internal/string.d.ts","../node_modules/type-fest/source/internal/numeric.d.ts","../node_modules/type-fest/source/simplify.d.ts","../node_modules/type-fest/source/is-equal.d.ts","../node_modules/type-fest/source/omit-index-signature.d.ts","../node_modules/type-fest/source/pick-index-signature.d.ts","../node_modules/type-fest/source/merge.d.ts","../node_modules/type-fest/source/internal/object.d.ts","../node_modules/type-fest/source/or.d.ts","../node_modules/type-fest/source/all-extend.d.ts","../node_modules/type-fest/source/and.d.ts","../node_modules/type-fest/source/greater-than.d.ts","../node_modules/type-fest/source/greater-than-or-equal.d.ts","../node_modules/type-fest/source/less-than.d.ts","../node_modules/type-fest/source/internal/tuple.d.ts","../node_modules/type-fest/source/internal/enforce-optional.d.ts","../node_modules/type-fest/source/except.d.ts","../node_modules/type-fest/source/require-at-least-one.d.ts","../node_modules/type-fest/source/unknown-record.d.ts","../node_modules/type-fest/source/writable.d.ts","../node_modules/type-fest/source/non-empty-tuple.d.ts","../node_modules/type-fest/source/array-tail.d.ts","../node_modules/type-fest/source/conditional-simplify-deep.d.ts","../node_modules/type-fest/source/simplify-deep.d.ts","../node_modules/type-fest/source/merge-deep.d.ts","../node_modules/type-fest/source/is-union.d.ts","../node_modules/type-fest/source/subtract.d.ts","../node_modules/type-fest/source/array-splice.d.ts","../node_modules/type-fest/source/value-of.d.ts","../node_modules/type-fest/source/extends-strict.d.ts","../node_modules/type-fest/source/is-tuple.d.ts","../node_modules/type-fest/source/tuple-to-object.d.ts","../node_modules/type-fest/source/conditional-keys.d.ts","../node_modules/type-fest/source/join.d.ts","../node_modules/type-fest/source/sum.d.ts","../node_modules/type-fest/source/less-than-or-equal.d.ts","../node_modules/type-fest/source/array-slice.d.ts","../node_modules/type-fest/source/fixed-length-array.d.ts","../node_modules/type-fest/source/int-range.d.ts","../node_modules/type-fest/source/array-indices.d.ts","../node_modules/type-fest/source/shared-union-fields.d.ts","../node_modules/type-fest/source/all-union-fields.d.ts","../node_modules/type-fest/source/is-lowercase.d.ts","../node_modules/type-fest/source/is-uppercase.d.ts","../node_modules/type-fest/source/words.d.ts","../node_modules/type-fest/source/camel-case.d.ts","../node_modules/type-fest/source/split.d.ts","../node_modules/type-fest/source/last-array-element.d.ts","../src/internal/types/UpsertProp.ts","../src/addProp.ts","../src/allPass.ts","../src/anyPass.ts","../src/capitalize.ts","../src/ceil.ts","../src/internal/types/IntRangeInclusive.ts","../src/internal/types/IterableContainer.ts","../src/internal/types/NTuple.ts","../src/internal/types/NonEmptyArray.ts","../src/internal/types/PartialArray.ts","../src/internal/types/RemedaTypeError.ts","../src/internal/types/TupleParts.ts","../src/chunk.ts","../src/clamp.ts","../src/clone.ts","../src/concat.ts","../src/internal/types/GuardType.ts","../src/conditional.ts","../src/constant.ts","../src/internal/types/IsBounded.ts","../src/internal/types/IsBoundedRecord.ts","../src/internal/types/BoundedPartial.ts","../src/countBy.ts","../src/internal/types/StrictFunction.ts","../src/debounce.ts","../src/defaultTo.ts","../src/difference.ts","../src/differenceWith.ts","../src/divide.ts","../src/doNothing.ts","../src/internal/types/ClampedIntegerSubtract.ts","../src/internal/types/CoercedArray.ts","../src/drop.ts","../src/internal/purryOrderRules.ts","../src/dropFirstBy.ts","../src/dropLast.ts","../src/dropLastWhile.ts","../src/dropWhile.ts","../src/endsWith.ts","../src/internal/types/ToString.ts","../src/entries.ts","../src/evolve.ts","../src/internal/types/FilteredArray.ts","../src/filter.ts","../src/find.ts","../src/findIndex.ts","../src/findLast.ts","../src/findLastIndex.ts","../src/first.ts","../src/firstBy.ts","../src/flat.ts","../src/flatMap.ts","../src/floor.ts","../src/forEach.ts","../src/internal/types/EnumerableStringKeyOf.ts","../src/internal/types/EnumerableStringKeyedValueOf.ts","../src/forEachObj.ts","../src/fromEntries.ts","../src/fromKeys.ts","../src/funnel.ts","../src/groupBy.ts","../src/internal/types/ArrayRequiredPrefix.ts","../src/groupByProp.ts","../src/hasAtLeast.ts","../src/hasSubObject.ts","../src/identity.ts","../src/indexBy.ts","../src/intersection.ts","../src/intersectionWith.ts","../src/invert.ts","../src/internal/types/NarrowedTo.ts","../src/isArray.ts","../src/isBigInt.ts","../src/isBoolean.ts","../src/isDate.ts","../src/isDeepEqual.ts","../src/isDefined.ts","../src/isEmpty.ts","../src/internal/types/HasWritableKeys.ts","../src/isEmptyish.ts","../src/isError.ts","../src/isFunction.ts","../src/isIncludedIn.ts","../src/isNonNull.ts","../src/isNonNullish.ts","../src/isNot.ts","../src/isNullish.ts","../src/isNumber.ts","../src/isObjectType.ts","../src/isPlainObject.ts","../src/isPromise.ts","../src/isShallowEqual.ts","../src/isStrictEqual.ts","../src/isString.ts","../src/isSymbol.ts","../src/isTruthy.ts","../src/join.ts","../src/keys.ts","../src/last.ts","../src/length.ts","../src/internal/types/Mapped.ts","../src/map.ts","../src/mapKeys.ts","../src/mapToObj.ts","../src/mapValues.ts","../src/mapWithFeedback.ts","../src/mean.ts","../src/meanBy.ts","../src/median.ts","../src/merge.ts","../src/internal/types/DisjointUnionFields.ts","../src/mergeAll.ts","../src/mergeDeep.ts","../src/multiply.ts","../src/nthBy.ts","../src/objOf.ts","../src/internal/types/PartitionByUnion.ts","../src/internal/types/SimplifiedWritable.ts","../src/omit.ts","../src/omitBy.ts","../src/once.ts","../src/only.ts","../src/internal/types/TupleSplits.ts","../src/partialBind.ts","../src/partialLastBind.ts","../src/partition.ts","../src/pathOr.ts","../src/pick.ts","../src/pickBy.ts","../src/pipe.ts","../src/piped.ts","../src/product.ts","../src/internal/types/ArrayAt.ts","../src/prop.ts","../src/pullObject.ts","../src/internal/types/LazyResult.ts","../src/internal/types/LazyEvaluator.ts","../src/purry.ts","../src/randomBigInt.ts","../src/randomInteger.ts","../src/randomString.ts","../src/range.ts","../src/rankBy.ts","../src/reduce.ts","../src/reverse.ts","../src/round.ts","../src/sample.ts","../src/set.ts","../src/setPath.ts","../src/internal/types/ReorderedArray.ts","../src/shuffle.ts","../src/sliceString.ts","../src/sort.ts","../src/sortBy.ts","../src/sortedIndex.ts","../src/sortedIndexBy.ts","../src/sortedIndexWith.ts","../src/sortedLastIndex.ts","../src/sortedLastIndexBy.ts","../src/splice.ts","../src/split.ts","../src/splitAt.ts","../src/splitWhen.ts","../src/startsWith.ts","../src/stringToPath.ts","../src/subtract.ts","../src/sum.ts","../src/sumBy.ts","../src/swapIndices.ts","../src/swapProps.ts","../src/take.ts","../src/takeFirstBy.ts","../src/takeLast.ts","../src/takeLastWhile.ts","../src/takeWhile.ts","../src/tap.ts","../src/times.ts","../src/internal/types/OptionalOptionsWithDefaults.ts","../src/toCamelCase.ts","../src/toKebabCase.ts","../src/toLowerCase.ts","../src/toSnakeCase.ts","../src/toTitleCase.ts","../src/toUpperCase.ts","../src/internal/types/StringLength.ts","../src/truncate.ts","../src/uncapitalize.ts","../src/internal/types/Deduped.ts","../src/unique.ts","../src/uniqueBy.ts","../src/uniqueWith.ts","../src/values.ts","../src/when.ts","../src/zip.ts","../src/zipWith.ts"],"sourcesContent":["/**\nMatches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).\n\n@category Type\n*/\nexport type Primitive =\n\t| null\n\t| undefined\n\t| string\n\t| number\n\t| boolean\n\t| symbol\n\t| bigint;\n\nexport {};\n","/**\nConvert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).\n\nInspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).\n\n@example\n```\nimport type {UnionToIntersection} from 'type-fest';\n\ntype Union = {the(): void} | {great(arg: string): void} | {escape: boolean};\n\ntype Intersection = UnionToIntersection<Union>;\n//=> {the(): void; great(arg: string): void; escape: boolean};\n```\n\n@category Type\n*/\nexport type UnionToIntersection<Union> = (\n\t// `extends unknown` is always going to be the case and is used to convert the\n\t// `Union` into a [distributive conditional\n\t// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).\n\tUnion extends unknown\n\t\t// The union type is used as the only argument to a function since the union\n\t\t// of function arguments is an intersection.\n\t\t? (distributedUnion: Union) => void\n\t\t// This won't happen.\n\t\t: never\n\t\t// Infer the `Intersection` type since TypeScript represents the positional\n\t\t// arguments of unions of functions as an intersection of the union.\n) extends ((mergedIntersection: infer Intersection) => void)\n\t// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`\n\t? Intersection & Union\n\t: never;\n\nexport {};\n","import type {UnionToIntersection} from './union-to-intersection.d.ts';\n\n/**\nCreate a union of all keys from a given type, even those exclusive to specific union members.\n\nUnlike the native `keyof` keyword, which returns keys present in **all** union members, this type returns keys from **any** member.\n\n@link https://stackoverflow.com/a/49402091\n\n@example\n```\nimport type {KeysOfUnion} from 'type-fest';\n\ntype A = {\n\tcommon: string;\n\ta: number;\n};\n\ntype B = {\n\tcommon: string;\n\tb: string;\n};\n\ntype C = {\n\tcommon: string;\n\tc: boolean;\n};\n\ntype Union = A | B | C;\n\ntype CommonKeys = keyof Union;\n//=> 'common'\n\ntype AllKeys = KeysOfUnion<Union>;\n//=> 'common' | 'a' | 'b' | 'c'\n```\n\n@category Object\n*/\nexport type KeysOfUnion<ObjectType> =\n // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008\n keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;\n\nexport {};\n","declare const emptyObjectSymbol: unique symbol;\n\n/**\nRepresents a strictly empty plain object, the `{}` value.\n\nWhen you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).\n\n@example\n```\nimport type {EmptyObject} from 'type-fest';\n\n// The following illustrates the problem with `{}`.\nconst foo1: {} = {}; // Pass\nconst foo2: {} = []; // Pass\nconst foo3: {} = 42; // Pass\nconst foo4: {} = {a: 1}; // Pass\n\n// With `EmptyObject` only the first case is valid.\nconst bar1: EmptyObject = {}; // Pass\n// @ts-expect-error\nconst bar2: EmptyObject = []; // Fail\n// @ts-expect-error\nconst bar3: EmptyObject = 42; // Fail\n// @ts-expect-error\nconst bar4: EmptyObject = {a: 1}; // Fail\n```\n\nUnfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.\n\n@category Object\n*/\nexport type EmptyObject = {[emptyObjectSymbol]?: never};\n\n/**\nReturns a `boolean` for whether the type is strictly equal to an empty plain object, the `{}` value.\n\n@example\n```\nimport type {IsEmptyObject} from 'type-fest';\n\ntype Pass = IsEmptyObject<{}>; //=> true\ntype Fail1 = IsEmptyObject<[]>; //=> false\ntype Fail2 = IsEmptyObject<null>; //=> false\n```\n\n@see {@link EmptyObject}\n@category Object\n*/\nexport type IsEmptyObject<T> = T extends EmptyObject ? true : false;\n\nexport {};\n","/**\nReturns a boolean for whether the given type is `any`.\n\n@link https://stackoverflow.com/a/49928360/1490091\n\nUseful in type utilities, such as disallowing `any`s to be passed to a function.\n\n@example\n```\nimport type {IsAny} from 'type-fest';\n\nconst typedObject = {a: 1, b: 2} as const;\nconst anyObject: any = {a: 1, b: 2};\n\nfunction get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {\n\treturn object[key];\n}\n\nconst typedA = get(typedObject, 'a');\n//=> 1\n\nconst anyA = get(anyObject, 'a');\n//=> any\n```\n\n@category Type Guard\n@category Utilities\n*/\nexport type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;\n\nexport {};\n","import type {IsAny} from './is-any.d.ts';\n\n/**\nReturns a boolean for whether the given key is an optional key of type.\n\nThis is useful when writing utility types or schema validators that need to differentiate `optional` keys.\n\n@example\n```\nimport type {IsOptionalKeyOf} from 'type-fest';\n\ntype User = {\n\tname: string;\n\tsurname: string;\n\n\tluckyNumber?: number;\n};\n\ntype Admin = {\n\tname: string;\n\tsurname?: string;\n};\n\ntype T1 = IsOptionalKeyOf<User, 'luckyNumber'>;\n//=> true\n\ntype T2 = IsOptionalKeyOf<User, 'name'>;\n//=> false\n\ntype T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;\n//=> boolean\n\ntype T4 = IsOptionalKeyOf<User | Admin, 'name'>;\n//=> false\n\ntype T5 = IsOptionalKeyOf<User | Admin, 'surname'>;\n//=> boolean\n```\n\n@category Type Guard\n@category Utilities\n*/\nexport type IsOptionalKeyOf<Type extends object, Key extends keyof Type> =\n\tIsAny<Type | Key> extends true ? never\n\t\t: Key extends keyof Type\n\t\t\t? Type extends Record<Key, Type[Key]>\n\t\t\t\t? false\n\t\t\t\t: true\n\t\t\t: false;\n\nexport {};\n","import type {IsOptionalKeyOf} from './is-optional-key-of.d.ts';\n\n/**\nExtract all optional keys from the given type.\n\nThis is useful when you want to create a new type that contains different type values for the optional keys only.\n\n@example\n```\nimport type {OptionalKeysOf, Except} from 'type-fest';\n\ntype User = {\n\tname: string;\n\tsurname: string;\n\n\tluckyNumber?: number;\n};\n\nconst REMOVE_FIELD = Symbol('remove field symbol');\ntype UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {\n\t[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;\n};\n\nconst update1: UpdateOperation<User> = {\n\tname: 'Alice',\n};\n\nconst update2: UpdateOperation<User> = {\n\tname: 'Bob',\n\tluckyNumber: REMOVE_FIELD,\n};\n```\n\n@category Utilities\n*/\nexport type OptionalKeysOf<Type extends object> =\n\tType extends unknown // For distributing `Type`\n\t\t? (keyof {[Key in keyof Type as\n\t\t\tIsOptionalKeyOf<Type, Key> extends false\n\t\t\t\t? never\n\t\t\t\t: Key\n\t\t\t]: never\n\t\t}) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`\n\t\t: never; // Should never happen\n\nexport {};\n","import type {OptionalKeysOf} from './optional-keys-of.d.ts';\n\n/**\nExtract all required keys from the given type.\n\nThis is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...\n\n@example\n```\nimport type {RequiredKeysOf} from 'type-fest';\n\ndeclare function createValidation<\n\tEntity extends object,\n\tKey extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,\n>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;\n\ntype User = {\n\tname: string;\n\tsurname: string;\n\tluckyNumber?: number;\n};\n\nconst validator1 = createValidation<User>('name', value => value.length < 25);\nconst validator2 = createValidation<User>('surname', value => value.length < 25);\n\n// @ts-expect-error\nconst validator3 = createValidation<User>('luckyNumber', value => value > 0);\n// Error: Argument of type '\"luckyNumber\"' is not assignable to parameter of type '\"name\" | \"surname\"'.\n```\n\n@category Utilities\n*/\nexport type RequiredKeysOf<Type extends object> =\n\tType extends unknown // For distributing `Type`\n\t\t? Exclude<keyof Type, OptionalKeysOf<Type>>\n\t\t: never; // Should never happen\n\nexport {};\n","import type {RequiredKeysOf} from './required-keys-of.d.ts';\n\n/**\nCreates a type that represents `true` or `false` depending on whether the given type has any required fields.\n\nThis is useful when you want to create an API whose behavior depends on the presence or absence of required fields.\n\n@example\n```\nimport type {HasRequiredKeys} from 'type-fest';\n\ntype GeneratorOptions<Template extends object> = {\n\tprop1: number;\n\tprop2: string;\n} & (HasRequiredKeys<Template> extends true\n\t? {template: Template}\n\t: {template?: Template});\n\ntype Template1 = {\n\toptionalSubParam?: string;\n};\n\ntype Template2 = {\n\trequiredSubParam: string;\n};\n\ntype Options1 = GeneratorOptions<Template1>;\ntype Options2 = GeneratorOptions<Template2>;\n\nconst optA: Options1 = {\n\tprop1: 0,\n\tprop2: 'hi',\n};\nconst optB: Options1 = {\n\tprop1: 0,\n\tprop2: 'hi',\n\ttemplate: {},\n};\nconst optC: Options1 = {\n\tprop1: 0,\n\tprop2: 'hi',\n\ttemplate: {\n\t\toptionalSubParam: 'optional value',\n\t},\n};\n\nconst optD: Options2 = {\n\tprop1: 0,\n\tprop2: 'hi',\n\ttemplate: {\n\t\trequiredSubParam: 'required value',\n\t},\n};\n\n```\n\n@category Utilities\n*/\nexport type HasRequiredKeys<BaseType extends object> = RequiredKeysOf<BaseType> extends never ? false : true;\n\nexport {};\n","/**\nReturns a boolean for whether the given type is `never`.\n\n@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919\n@link https://stackoverflow.com/a/53984913/10292952\n@link https://www.zhenghao.io/posts/ts-never\n\nUseful in type utilities, such as checking if something does not occur.\n\n@example\n```\nimport type {IsNever, And} from 'type-fest';\n\ntype A = IsNever<never>;\n//=> true\n\ntype B = IsNever<any>;\n//=> false\n\ntype C = IsNever<unknown>;\n//=> false\n\ntype D = IsNever<never[]>;\n//=> false\n\ntype E = IsNever<object>;\n//=> false\n\ntype F = IsNever<string>;\n//=> false\n```\n\n@example\n```\nimport type {IsNever} from 'type-fest';\n\ntype IsTrue<T> = T extends true ? true : false;\n\n// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.\ntype A = IsTrue<never>;\n// ^? type A = never\n\n// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.\ntype IsTrueFixed<T> =\n\tIsNever<T> extends true ? false : T extends true ? true : false;\n\ntype B = IsTrueFixed<never>;\n// ^? type B = false\n```\n\n@category Type Guard\n@category Utilities\n*/\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\nexport {};\n","import type {IsNever} from './is-never.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.\n\nUse-cases:\n- You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.\n\nNote:\n- Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.\n- Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.\n\n@example\n```\nimport type {If} from 'type-fest';\n\ntype A = If<true, 'yes', 'no'>;\n//=> 'yes'\n\ntype B = If<false, 'yes', 'no'>;\n//=> 'no'\n\ntype C = If<boolean, 'yes', 'no'>;\n//=> 'yes' | 'no'\n\ntype D = If<any, 'yes', 'no'>;\n//=> 'yes' | 'no'\n\ntype E = If<never, 'yes', 'no'>;\n//=> 'no'\n```\n\n@example\n```\nimport type {If, IsAny, IsNever} from 'type-fest';\n\ntype A = If<IsAny<unknown>, 'is any', 'not any'>;\n//=> 'not any'\n\ntype B = If<IsNever<never>, 'is never', 'not never'>;\n//=> 'is never'\n```\n\n@example\n```\nimport type {If, IsEqual} from 'type-fest';\n\ntype IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;\n\ntype A = IfEqual<string, string, 'equal', 'not equal'>;\n//=> 'equal'\n\ntype B = IfEqual<string, number, 'equal', 'not equal'>;\n//=> 'not equal'\n```\n\nNote: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:\n\n@example\n```\nimport type {If, IsEqual, StringRepeat} from 'type-fest';\n\ntype HundredZeroes = StringRepeat<'0', 100>;\n\n// The following implementation is not tail recursive\ntype Includes<S extends string, Char extends string> =\n\tS extends `${infer First}${infer Rest}`\n\t\t? If<IsEqual<First, Char>,\n\t\t\t'found',\n\t\t\tIncludes<Rest, Char>>\n\t\t: 'not found';\n\n// Hence, instantiations with long strings will fail\n// @ts-expect-error\ntype Fails = Includes<HundredZeroes, '1'>;\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n// Error: Type instantiation is excessively deep and possibly infinite.\n\n// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive\ntype IncludesWithoutIf<S extends string, Char extends string> =\n\tS extends `${infer First}${infer Rest}`\n\t\t? IsEqual<First, Char> extends true\n\t\t\t? 'found'\n\t\t\t: IncludesWithoutIf<Rest, Char>\n\t\t: 'not found';\n\n// Now, instantiations with long strings will work\ntype Works = IncludesWithoutIf<HundredZeroes, '1'>;\n//=> 'not found'\n```\n\n@category Type Guard\n@category Utilities\n*/\nexport type If<Type extends boolean, IfBranch, ElseBranch> =\n\tIsNever<Type> extends true\n\t\t? ElseBranch\n\t\t: Type extends true\n\t\t\t? IfBranch\n\t\t\t: ElseBranch;\n\nexport {};\n","/**\nRepresents an array with `unknown` value.\n\nUse case: You want a type that all arrays can be assigned to, but you don't care about the value.\n\n@example\n```\nimport type {UnknownArray} from 'type-fest';\n\ntype IsArray<T> = T extends UnknownArray ? true : false;\n\ntype A = IsArray<['foo']>;\n//=> true\n\ntype B = IsArray<readonly number[]>;\n//=> true\n\ntype C = IsArray<string>;\n//=> false\n```\n\n@category Type\n@category Array\n*/\nexport type UnknownArray = readonly unknown[];\n\nexport {};\n","import type {If} from '../if.d.ts';\nimport type {IsAny} from '../is-any.d.ts';\nimport type {IsNever} from '../is-never.d.ts';\nimport type {Primitive} from '../primitive.d.ts';\nimport type {UnknownArray} from '../unknown-array.d.ts';\n\n/**\nMatches any primitive, `void`, `Date`, or `RegExp` value.\n*/\nexport type BuiltIns = Primitive | void | Date | RegExp;\n\n/**\nMatches non-recursive types.\n*/\nexport type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown) | Promise<unknown>;\n\n/**\nMatches maps, sets, or arrays.\n*/\nexport type MapsSetsOrArrays = ReadonlyMap<unknown, unknown> | WeakMap<WeakKey, unknown> | ReadonlySet<unknown> | WeakSet<WeakKey> | UnknownArray;\n\n/**\nReturns a boolean for whether the two given types extends the base type.\n*/\nexport type IsBothExtends<BaseType, FirstType, SecondType> = FirstType extends BaseType\n\t? SecondType extends BaseType\n\t\t? true\n\t\t: false\n\t: false;\n\n/**\nTest if the given function has multiple call signatures.\n\nNeeded to handle the case of a single call signature with properties.\n\nMultiple call signatures cannot currently be supported due to a TypeScript limitation.\n@see https://github.com/microsoft/TypeScript/issues/29732\n*/\nexport type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> =\n\tT extends {(...arguments_: infer A): unknown; (...arguments_: infer B): unknown}\n\t\t? B extends A\n\t\t\t? A extends B\n\t\t\t\t? false\n\t\t\t\t: true\n\t\t\t: true\n\t\t: false;\n\n/**\nReturns a boolean for whether the given `boolean` is not `false`.\n*/\nexport type IsNotFalse<T extends boolean> = [T] extends [false] ? false : true;\n\n/**\nReturns a boolean for whether the given type is primitive value or primitive type.\n\n@example\n```\ntype A = IsPrimitive<'string'>;\n//=> true\n\ntype B = IsPrimitive<string>;\n//=> true\n\ntype C = IsPrimitive<Object>;\n//=> false\n```\n*/\nexport type IsPrimitive<T> = [T] extends [Primitive] ? true : false;\n\n/**\nReturns a boolean for whether A is false.\n\n@example\n```\ntype A = Not<true>;\n//=> false\n\ntype B = Not<false>;\n//=> true\n```\n*/\nexport type Not<A extends boolean> = A extends true\n\t? false\n\t: A extends false\n\t\t? true\n\t\t: never;\n\n/**\nAn if-else-like type that resolves depending on whether the given type is `any` or `never`.\n\n@example\n```\n// When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch\ntype A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;\n//=> 'VALID'\n\n// When `T` is `any` => Returns `IfAny` branch\ntype B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;\n//=> 'IS_ANY'\n\n// When `T` is `never` => Returns `IfNever` branch\ntype C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;\n//=> 'IS_NEVER'\n```\n\nNote: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example:\n\n@example\n```ts\nimport type {StringRepeat} from 'type-fest';\n\ntype NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;\n\n// The following implementation is not tail recursive\ntype TrimLeft<S extends string> = IfNotAnyOrNever<S, S extends ` ${infer R}` ? TrimLeft<R> : S>;\n\n// Hence, instantiations with long strings will fail\n// @ts-expect-error\ntype T1 = TrimLeft<NineHundredNinetyNineSpaces>;\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n// Error: Type instantiation is excessively deep and possibly infinite.\n\n// To fix this, move the recursion into a helper type\ntype TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, _TrimLeftOptimised<S>>;\n\ntype _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;\n\ntype T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;\n//=> ''\n```\n*/\nexport type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> =\n\tIf<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;\n\n/**\nReturns a boolean for whether the given type is `any` or `never`.\n\nThis type can be better to use than {@link IfNotAnyOrNever `IfNotAnyOrNever`} in recursive types because it does not evaluate any branches.\n\n@example\n```\n// When `T` is a NOT `any` or `never` (like `string`) => Returns `false`\ntype A = IsAnyOrNever<string>;\n//=> false\n\n// When `T` is `any` => Returns `true`\ntype B = IsAnyOrNever<any>;\n//=> true\n\n// When `T` is `never` => Returns `true`\ntype C = IsAnyOrNever<never>;\n//=> true\n```\n*/\nexport type IsAnyOrNever<T> = IsNotFalse<IsAny<T> | IsNever<T>>;\n\n/**\nIndicates the value of `exactOptionalPropertyTypes` compiler option.\n*/\nexport type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?]\n\t? false\n\t: true;\n\nexport {};\n","import type {If} from '../if.d.ts';\nimport type {IsNever} from '../is-never.d.ts';\nimport type {OptionalKeysOf} from '../optional-keys-of.d.ts';\nimport type {UnknownArray} from '../unknown-array.d.ts';\nimport type {IsExactOptionalPropertyTypesEnabled, IfNotAnyOrNever} from './type.d.ts';\n\n/**\nInfer the length of the given array `<T>`.\n\n@link https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f\n*/\ntype ArrayLength<T extends readonly unknown[]> = T extends {readonly length: infer L} ? L : never;\n\n/**\nMatches any unknown array or tuple.\n*/\nexport type UnknownArrayOrTuple = readonly [...unknown[]];\n// TODO: should unknown-array be updated?\n\n/**\nExtracts the type of the first element of an array or tuple.\n*/\nexport type FirstArrayElement<TArray extends UnknownArrayOrTuple> = TArray extends readonly [infer THead, ...unknown[]]\n\t? THead\n\t: never;\n\n/**\nReturns the static, fixed-length portion of the given array, excluding variable-length parts.\n\n@example\n```\ntype A = [string, number, boolean, ...string[]];\ntype B = StaticPartOfArray<A>;\n//=> [string, number, boolean]\n```\n*/\nexport type StaticPartOfArray<T extends UnknownArray, Result extends UnknownArray = []> =\n\tT extends unknown\n\t\t? number extends T['length'] ?\n\t\t\tT extends readonly [infer U, ...infer V]\n\t\t\t\t? StaticPartOfArray<V, [...Result, U]>\n\t\t\t\t: Result\n\t\t\t: T\n\t\t: never; // Should never happen\n\n/**\nReturns the variable, non-fixed-length portion of the given array, excluding static-length parts.\n\n@example\n```\ntype A = [string, number, boolean, ...string[]];\ntype B = VariablePartOfArray<A>;\n//=> string[]\n```\n*/\nexport type VariablePartOfArray<T extends UnknownArray> =\n\tT extends unknown\n\t\t? T extends readonly [...StaticPartOfArray<T>, ...infer U]\n\t\t\t? U\n\t\t\t: []\n\t\t: never; // Should never happen\n\n/**\nSet the given array to readonly if `IsReadonly` is `true`, otherwise set the given array to normal, then return the result.\n\n@example\n```\ntype ReadonlyStringArray = readonly string[];\ntype NormalStringArray = string[];\n\ntype ReadonlyResult = SetArrayAccess<NormalStringArray, true>;\n//=> readonly string[]\n\ntype NormalResult = SetArrayAccess<ReadonlyStringArray, false>;\n//=> string[]\n```\n*/\nexport type SetArrayAccess<T extends UnknownArray, IsReadonly extends boolean> =\nT extends readonly [...infer U] ?\n\tIsReadonly extends true\n\t\t? readonly [...U]\n\t\t: [...U]\n\t: T;\n\n/**\nReturns whether the given array `T` is readonly.\n*/\nexport type IsArrayReadonly<T extends UnknownArray> = If<IsNever<T>, false, T extends unknown[] ? false : true>;\n\n/**\nTransforms a tuple type by replacing it's rest element with a single element that has the same type as the rest element, while keeping all the non-rest elements intact.\n\n@example\n```\ntype A = CollapseRestElement<[string, string, ...number[]]>;\n//=> [string, string, number]\n\ntype B = CollapseRestElement<[...string[], number, number]>;\n//=> [string, number, number]\n\ntype C = CollapseRestElement<[string, string, ...Array<number | bigint>]>;\n//=> [string, string, number | bigint]\n\ntype D = CollapseRestElement<[string, number]>;\n//=> [string, number]\n```\n\nNote: Optional modifiers (`?`) are removed from elements unless the `exactOptionalPropertyTypes` compiler option is disabled. When disabled, there's an additional `| undefined` for optional elements.\n\n@example\n```\n// `exactOptionalPropertyTypes` enabled\ntype A = CollapseRestElement<[string?, string?, ...number[]]>;\n//=> [string, string, number]\n\n// `exactOptionalPropertyTypes` disabled\ntype B = CollapseRestElement<[string?, string?, ...number[]]>;\n//=> [string | undefined, string | undefined, number]\n```\n*/\nexport type CollapseRestElement<TArray extends UnknownArray> = IfNotAnyOrNever<TArray, _CollapseRestElement<TArray>>;\n\ntype _CollapseRestElement<\n\tTArray extends UnknownArray,\n\tForwardAccumulator extends UnknownArray = [],\n\tBackwardAccumulator extends UnknownArray = [],\n> =\n\tTArray extends UnknownArray // For distributing `TArray`\n\t\t? keyof TArray & `${number}` extends never\n\t\t\t// Enters this branch, if `TArray` is empty (e.g., []),\n\t\t\t// or `TArray` contains no non-rest elements preceding the rest element (e.g., `[...string[]]` or `[...string[], string]`).\n\t\t\t? TArray extends readonly [...infer Rest, infer Last]\n\t\t\t\t? _CollapseRestElement<Rest, ForwardAccumulator, [Last, ...BackwardAccumulator]> // Accumulate elements that are present after the rest element.\n\t\t\t\t: TArray extends readonly []\n\t\t\t\t\t? [...ForwardAccumulator, ...BackwardAccumulator]\n\t\t\t\t\t: [...ForwardAccumulator, TArray[number], ...BackwardAccumulator] // Add the rest element between the accumulated elements.\n\t\t\t: TArray extends readonly [(infer First)?, ...infer Rest]\n\t\t\t\t? _CollapseRestElement<\n\t\t\t\t\tRest,\n\t\t\t\t\t[\n\t\t\t\t\t\t...ForwardAccumulator,\n\t\t\t\t\t\t'0' extends OptionalKeysOf<TArray>\n\t\t\t\t\t\t\t? If<IsExactOptionalPropertyTypesEnabled, First, First | undefined> // Add `| undefined` for optional elements, if `exactOptionalPropertyTypes` is disabled.\n\t\t\t\t\t\t\t: First,\n\t\t\t\t\t],\n\t\t\t\t\tBackwardAccumulator\n\t\t\t\t>\n\t\t\t\t: never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.\n\t\t: never; // Should never happen\n\nexport {};\n","export type Whitespace =\n\t| '\\u{9}' // '\\t'\n\t| '\\u{A}' // '\\n'\n\t| '\\u{B}' // '\\v'\n\t| '\\u{C}' // '\\f'\n\t| '\\u{D}' // '\\r'\n\t| '\\u{20}' // ' '\n\t| '\\u{85}'\n\t| '\\u{A0}'\n\t| '\\u{1680}'\n\t| '\\u{2000}'\n\t| '\\u{2001}'\n\t| '\\u{2002}'\n\t| '\\u{2003}'\n\t| '\\u{2004}'\n\t| '\\u{2005}'\n\t| '\\u{2006}'\n\t| '\\u{2007}'\n\t| '\\u{2008}'\n\t| '\\u{2009}'\n\t| '\\u{200A}'\n\t| '\\u{2028}'\n\t| '\\u{2029}'\n\t| '\\u{202F}'\n\t| '\\u{205F}'\n\t| '\\u{3000}'\n\t| '\\u{FEFF}';\n\nexport type WordSeparators = '-' | '_' | Whitespace;\n\nexport type AsciiPunctuation =\n\t| '!'\n\t| '\"'\n\t| '#'\n\t| '$'\n\t| '%'\n\t| '&'\n\t| '\\''\n\t| '('\n\t| ')'\n\t| '*'\n\t| '+'\n\t| ','\n\t| '-'\n\t| '.'\n\t| '/'\n\t| ':'\n\t| ';'\n\t| '<'\n\t| '='\n\t| '>'\n\t| '?'\n\t| '@'\n\t| '['\n\t| '\\\\'\n\t| ']'\n\t| '^'\n\t| '_'\n\t| '`'\n\t| '{'\n\t| '|'\n\t| '}'\n\t| '~';\n\nexport {};\n","/**\nReturns a boolean for whether the given number is a float, like `1.5` or `-1.5`.\n\nUse-case:\n- If you want to make a conditional branch based on the result of whether a number is a float or not.\n\n@example\n```\nimport type {IsFloat, PositiveInfinity} from 'type-fest';\n\ntype A = IsFloat<1.5>;\n//=> true\n\ntype B = IsFloat<-1.5>;\n//=> true\n\ntype C = IsFloat<1e-7>;\n//=> true\n\ntype D = IsFloat<1.0>;\n//=> false\n\ntype E = IsFloat<PositiveInfinity>;\n//=> false\n\ntype F = IsFloat<1.23e+21>;\n//=> false\n```\n\n@category Type Guard\n@category Numeric\n*/\nexport type IsFloat<T> = T extends number\n\t? `${T}` extends `${number}e${infer E extends '-' | '+'}${number}`\n\t\t? E extends '-'\n\t\t\t? true\n\t\t\t: false\n\t\t: `${T}` extends `${number}.${number}`\n\t\t\t? true\n\t\t\t: false\n\t: false;\n\nexport {};\n","import type {Not} from './internal/index.d.ts';\nimport type {IsFloat} from './is-float.d.ts';\nimport type {PositiveInfinity, NegativeInfinity} from './numeric.d.ts';\n\n/**\nReturns a boolean for whether the given number is an integer, like `-5`, `1.0`, or `100`.\n\nUse-case:\n- If you want to make a conditional branch based on the result of whether a number is an integer or not.\n\n@example\n```\nimport type {IsInteger, PositiveInfinity} from 'type-fest';\n\ntype A = IsInteger<1>;\n//=> true\n\ntype B = IsInteger<1.0>;\n//=> true\n\ntype C = IsInteger<-1>;\n//=> true\n\ntype D = IsInteger<0b10>;\n//=> true\n\ntype E = IsInteger<0o10>;\n//=> true\n\ntype F = IsInteger<0x10>;\n//=> true\n\ntype G = IsInteger<1.23e+21>;\n//=> true\n\ntype H = IsInteger<1.5>;\n//=> false\n\ntype I = IsInteger<PositiveInfinity>;\n//=> false\n\ntype J = IsInteger<1e-7>;\n//=> false\n```\n\n@category Type Guard\n@category Numeric\n*/\nexport type IsInteger<T> =\nT extends bigint\n\t? true\n\t: T extends number\n\t\t? number extends T\n\t\t\t? false\n\t\t\t: T extends PositiveInfinity | NegativeInfinity\n\t\t\t\t? false\n\t\t\t\t: Not<IsFloat<T>>\n\t\t: false;\n\nexport {};\n","import type {IsFloat} from './is-float.d.ts';\nimport type {IsInteger} from './is-integer.d.ts';\n\nexport type _Numeric = number | bigint;\n\ntype Zero = 0 | 0n;\n\n/**\nMatches the hidden `Infinity` type.\n\nPlease upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.\n\n@see {@link NegativeInfinity}\n\n@category Numeric\n*/\n// See https://github.com/microsoft/TypeScript/issues/31752\n// eslint-disable-next-line no-loss-of-precision\nexport type PositiveInfinity = 1e999;\n\n/**\nMatches the hidden `-Infinity` type.\n\nPlease upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.\n\n@see {@link PositiveInfinity}\n\n@category Numeric\n*/\n// See https://github.com/microsoft/TypeScript/issues/31752\n// eslint-disable-next-line no-loss-of-precision\nexport type NegativeInfinity = -1e999;\n\n/**\nA finite `number`.\nYou can't pass a `bigint` as they are already guaranteed to be finite.\n\nUse-case: Validating and documenting parameters.\n\nNote: This can't detect `NaN`, please upvote [this issue](https://github.com/microsoft/TypeScript/issues/28682) if you want to have this type as a built-in in TypeScript.\n\n@example\n```\nimport type {Finite} from 'type-fest';\n\ndeclare function setScore<T extends number>(length: Finite<T>): void;\n```\n\n@category Numeric\n*/\nexport type Finite<T extends number> = T extends PositiveInfinity | NegativeInfinity ? never : T;\n\n/**\nA `number` that is an integer.\n\nUse-case: Validating and documenting parameters.\n\n@example\n```\nimport type {Integer} from 'type-fest';\n\ntype SomeInteger = Integer<1>;\n//=> 1\n\ntype IntegerWithDecimal = Integer<1.0>;\n//=> 1\n\ntype NegativeInteger = Integer<-1>;\n//=> -1\n\ntype Float = Integer<1.5>;\n//=> never\n\n// Supports non-decimal numbers\n\ntype OctalInteger = Integer<0o10>;\n//=> 0o10\n\ntype BinaryInteger = Integer<0b10>;\n//=> 0b10\n\ntype HexadecimalInteger = Integer<0x10>;\n//=> 0x10\n```\n\n@example\n```\nimport type {Integer} from 'type-fest';\n\ndeclare function setYear<T extends number>(length: Integer<T>): void;\n```\n\n@see {@link NegativeInteger}\n@see {@link NonNegativeInteger}\n\n@category Numeric\n*/\n// `${bigint}` is a type that matches a valid bigint literal without the `n` (ex. 1, 0b1, 0o1, 0x1)\n// Because T is a number and not a string we can effectively use this to filter out any numbers containing decimal points\nexport type Integer<T> =\n\tT extends unknown // To distributive type\n\t\t? IsInteger<T> extends true ? T : never\n\t\t: never; // Never happens\n\n/**\nA `number` that is not an integer.\n\nUse-case: Validating and documenting parameters.\n\nIt does not accept `Infinity`.\n\n@example\n```\nimport type {Float} from 'type-fest';\n\ndeclare function setPercentage<T extends number>(length: Float<T>): void;\n```\n\n@see {@link Integer}\n\n@category Numeric\n*/\nexport type Float<T> =\nT extends unknown // To distributive type\n\t? IsFloat<T> extends true ? T : never\n\t: never; // Never happens\n\n/**\nA negative (`-∞ < x < 0`) `number` that is not an integer.\nEquivalent to `Negative<Float<T>>`.\n\nUse-case: Validating and documenting parameters.\n\n@see {@link Negative}\n@see {@link Float}\n\n@category Numeric\n*/\nexport type NegativeFloat<T extends number> = Negative<