Modules | @vltpkg/fast-split
Type Aliases
NullReplace<T, R>
Utility type to replace null/undefined with a given type
Type Parameters
• T
• R = string
Defined in
index.ts:5
NullToString<T>
utility types to turn a null/undefined/void return into string
Type Parameters
• T
Defined in
index.ts:2
VoidReplace<T, R>
Utility type to replace void with a given type
Type Parameters
• T
• R = string
Defined in
index.ts:9
Functions
fastSplit()
fastSplit(str, delim, limit, onPart)
Split a string by a string delimiter, optionally limiting the number of parts parsed, and/or transforming the string parts into some other type of value.
Pass -1
as the limit
parameter to get all parts (useful if an onPart
method is provided)
If an onPart
method is provided, and returns undefined
, then the
original string part is included in the result set.
Type Parameters
• T = string
Parameters
• str: string
• delim: string
• limit: number
• onPart
Returns
NullToString
<T
>[]
Defined in
index.ts:48
fastSplit(str, delim, limit)
Parameters
• str: string
• delim: string
• limit?: number
Returns
string
[]
Defined in
index.ts:54