Name of an event matching the format of:
AppEventPrefix:EventPrefix:string
Prefix for an event name usually the screen, page, service, etc.
The size of a GB in base 2. More Info
The size of a KB in base 2. More Info
The size of a MB in base 2. More Info
The size of a TB in base 2. More Info
Determines if two arrays of type T[] are equal
Array of objects
Array of objects
Function for comparing objects of type T
boolean
Breaks an array T[] into an array of batches T[][]
An array of batches: T[][]
Capitalizes the first letter of a given word.
Word to capitalize
A capitalized copy of the word
Example:
const result: string = capitalize("nucleus");
console.log(result); // Nucleus
Compares two arrays of type T where T extends IComparable
Array of IComparable objects
Array of IComparable objects
boolean
Determines if two objects of type T are equivalent when stringified
First object to compare
Second object to compare
A boolean representing whether the two are equal as strings
Retrieves the filename from a path.
Filepath or Url to retrieve the filename from
A filename
Examples:
const nameFromUrl: string = filenameFrom("https://www.behaveware.org/test.jpeg");
console.log(nameFromUrl); // test.jpeg
const nameFromFilepath: string = filenameFrom("C:\\behaveware\\nucleus\\test.jpeg");
console.log(nameFromFilepath); // test.jpeg
Loops through an array executing an action on each element in parallel
Array to loop through
Function to be called on each element
(Optional) Size of batches, for working with larger arrays
Determines if text is an email. Based on the RFC 5322 Specification.
Text to check
Whether or not the text is an email
Example:
const result: boolean = isEmail("support@behaveware.org");
console.log(result); // true
Determines if text is an integer.
Text to check
Whether or not the text is an integer
Example:
const result: boolean = isInteger("42");
console.log(result); //true
Determines if text is a phone number. Based on the solution from Regular Expressions Cookbook, 2nd Edition by Jan Goyvaerts, Steven Levithan.
Text to check
Whether or not the text is a phone number
Example:
const result: boolean = isPhoneNumber("555-555-555");
console.log(result); // true
Maps an array of type T[] to an array of type T[][] in parallel. The order of the output array can not be guaranteed. When the order needs to be maintained a Synchronous approach should be used.
Array to map
Mapping function
Size of batches for dealing with large arrays
A promise with the mapped array of type TT[]
Converts bytes to gigabytes.
Example:
const gigabytes = toGigabytes(1024 * 1024 * 1024);
console.log(gigabytes); // 1
Number of bytes
Number of gigabytes
Converts bytes to kilobytes.
Example:
const kilobytes = toKilobytes(1024);
console.log(kilobytes); // 1
Number of bytes
Number of kilobytes
Converts bytes to megabytes.
Example:
const megabytes = toMegabytes(1024 * 1024);
console.log(megabytes); // 1
Number of bytes
Number of megabytes
Converts bytes to terabytes.
Example:
const terabytes = toTerabytes(1024 * 1024 * 1024 * 1024);
console.log(terabytes); // 1
Number of bytes
Number of terabytes
Trim the Buffer to a max size in bytes.
Example:
const buffer = Buffer.from("nucleus");
console.log(buffer.byteLength); // 7
const trimmedBuffer = trimBuffer(buffer, 4);
console.log(trimmedBuffer.byteLength); // 4
Buffer to be trimmed
Max size in bytes to trim to
The trimmed Buffer
Generated using TypeDoc
Application prefix for an event name