Functions
blobToFile
- blobToFile(binary: Blob, fileName: string): File
Parameters
binary: Blob
fileName: string
Returns File
bytesToShortestUnit
- bytesToShortestUnit(bytesCount: number): string
downloadFile
- downloadFile(filename: string, data: string | Blob): void
Parameters
filename: string
data: string | Blob
Returns void
fileListToArray
- fileListToArray(fileList: FileList): File[]
getAbbreviatedCount
- getAbbreviatedCount(count: Nullable<number>): string | null
Parameters
Returns string | null
getArrayBufferFromString
- getArrayBufferFromString(inputString: Nullable<string>): Uint8Array | null
Parameters
Returns Uint8Array | null
getArrayFirstElement
- getArrayFirstElement<T>(array: T[]): T | undefined
Type Parameters
Parameters
Returns T | undefined
getArrayLastElement
- getArrayLastElement<T>(array: T[]): T | undefined
Type Parameters
Parameters
Returns T | undefined
getArrayUniqueElements
- getArrayUniqueElements(array: []): []
- getArrayUniqueElements(array: number[]): number[]
- getArrayUniqueElements(array: boolean[]): boolean[]
- getArrayUniqueElements(array: string[]): string[]
- getArrayUniqueElements<T>(array: T[]): T[]
- getArrayUniqueElements<T, K>(array: T[], compareBy: number | symbol | K): T[]
Parameters
Returns []
Parameters
Returns number[]
Parameters
Returns boolean[]
Parameters
Returns string[]
Type Parameters
Parameters
Returns T[]
Type Parameters
T extends object
K extends string
Parameters
array: T[]
compareBy: number | symbol | K
Returns T[]
getArrayWithMovedItems
- getArrayWithMovedItems<T>(array: T[], fromIndex: number, toIndex: number): T[]
Type Parameters
Parameters
array: T[]
fromIndex: number
toIndex: number
Returns T[]
getArraysDifference
- getArraysDifference(arrayA: string[], arrayB: string[]): string[]
- getArraysDifference(arrayA: boolean[], arrayB: boolean[]): boolean[]
- getArraysDifference(arrayA: number[], arrayB: number[]): number[]
- getArraysDifference(arrayA: Primitive[], arrayB: Primitive[]): Primitive[]
- getArraysDifference<T>(arrayA: T[], arrayB: T[], objectKey: string): T[]
Parameters
arrayA: string[]
arrayB: string[]
Returns string[]
Parameters
arrayA: boolean[]
arrayB: boolean[]
Returns boolean[]
Parameters
arrayA: number[]
arrayB: number[]
Returns number[]
Parameters
Type Parameters
Parameters
arrayA: T[]
arrayB: T[]
objectKey: string
Returns T[]
getClampedValue
- getClampedValue(value: number, min: number, max: number): number | undefined
Parameters
value: number
min: number
max: number
Returns number | undefined
getElementAllNestedChildren
- getElementAllNestedChildren(element: Element): Element[]
Parameters
Returns Element[]
getHslColorFromString
- getHslColorFromString(inputString: string, saturation?: number, lightness?: number): HslColor
Parameters
inputString: string
saturation: number = DEFAULT_HSL_COLOR.s
lightness: number = DEFAULT_HSL_COLOR.l
getIncrementedName
- getIncrementedName(currentName: string, namesArray?: string[]): string
Parameters
currentName: string
namesArray: string[] = []
Returns string
getObjectPropertyComparator
- getObjectPropertyComparator<T>(propertyName: string, getValueToCompare?: Converter): Comparator<T>
Type Parameters
T extends object = object
Parameters
propertyName: string
Optional getValueToCompare: Converter
getPagedArray
- getPagedArray<T>(items: T[], perPageCount: number): T[][]
Type Parameters
Parameters
items: T[]
perPageCount: number
Returns T[][]
getRegExpPattern
- getRegExpPattern(name: RegExpPatternName): RegExp | undefined
Parameters
Returns RegExp | undefined
getReversedArray
- getReversedArray<T>(array: T[]): T[]
Type Parameters
Parameters
Returns T[]
getScreamingSnakeCasedString
getShuffledArray
- getShuffledArray<T>(array: T[]): T[]
Type Parameters
Parameters
Returns T[]
getStringFromArrayBuffer
- getStringFromArrayBuffer(buffer: Nullable<Uint8Array>, offset?: number): string | null
Parameters
buffer: Nullable<Uint8Array>
offset: number = 0
Returns string | null
getStringHash
- getStringHash(inputString: string): number | undefined
Parameters
Returns number | undefined
getSubstringBetween
- getSubstringBetween(source: string, __namedParameters: Options): string
Parameters
source: string
__namedParameters: Options
Returns string
isEmpty
- isEmpty(input: unknown): boolean
Parameters
Returns boolean
isEqual
- isEqual(a: unknown, b: unknown): boolean
Parameters
Returns boolean
isNil
- isNil<T>(entity: Nullable<T>): entity is undefined | null
Type Parameters
Parameters
Returns entity is undefined | null
isNonEmptyObject
- isNonEmptyObject(input: unknown): boolean
Parameters
Returns boolean
isNumber
- isNumber(input: unknown): input is number
Parameters
Returns input is number
isObject
- isObject(input: unknown): input is object
Parameters
Returns input is object
isObjectKeyUsed
Type Parameters
T extends object
K extends string = string
Parameters
isString
- isString(input: unknown): input is string
Parameters
Returns input is string
isSymbol
- isSymbol(input: unknown): input is symbol
Parameters
Returns input is symbol
isUuid
- isUuid(input: unknown): input is Uuid
Parameters
Returns input is Uuid
mapArrayToKeyValueMap
- mapArrayToKeyValueMap<T, Key>(array: T[], key: Key): Map<T[Key], T>
Type Parameters
T extends object
Key extends string | number | symbol
Parameters
Returns Map<T[Key], T>
mergeArraysByProperty
- mergeArraysByProperty<T>(property: string & keyof T, ...arrays: T[][]): T[]
Type Parameters
Parameters
property: string & keyof T
Rest ...arrays: T[][]
Returns T[]
nullIfEmpty
- nullIfEmpty<T>(value: T): T | null
Type Parameters
Parameters
Returns T | null
sortByProperty
- sortByProperty<T>(array: T[], property: string | keyof T, comparator?: Comparator<unknown>): T[]
- sortByProperty<T, K>(array: T[], property: string | keyof T, sortDirection?: K): T[]
Type Parameters
Parameters
array: T[]
property: string | keyof T
Optional comparator: Comparator<unknown>
Returns T[]
Type Parameters
T extends object
K extends SortDirection = "ascending"
Parameters
array: T[]
property: string | keyof T
Optional sortDirection: K
Returns T[]
stringFilterPredicate
- stringFilterPredicate(targetValue: string, filterValue: string): boolean
Parameters
targetValue: string
filterValue: string
Returns boolean
trimAllSpaces
- trimAllSpaces(text: string): string
property = 'property.property...'