Static ReadonlyregexesPredefined regular expressions for common string cleaning operations.
StaticarraysCollection of utility functions for working with arrays.
Asynchronously map over an array with async callback functions.
Group array items by a key generated from a function.
Collect array items into groups using a grouping function, returning only the grouped arrays.
Get the first item in the array.
Get the last item in the array.
StaticcleanStaticautoAutomatically capitalize the first letter of each word in a string.
The string to capitalize
The string with each word capitalized
StaticenumStaticflattenStatichierachialGet hierarchical availability of objects based on key-parent relationships.
Array of matching objects including hierarchical children
StaticdecodeDecode a base64 data URL string and extract the image type and data.
Base64 data URL string (e.g., "data:image/png;base64,...")
Object with type and data properties, or Error if invalid
StaticGetGet a value from a nested object using a string path (e.g., "user.profile.name"). Supports comma-separated paths for concatenation and "*" wildcard for all properties.
The object to search in
Dot-notation path string or comma-separated paths
The value at the specified path, or null if not found
StaticmergeMerge two objects deeply, with the second object taking precedence.
Source object to merge into
Object to merge from (takes precedence)
Whether to clone objects before merging (default: true)
OptionalreferenceKey: MergeObjectsKeyOptional reference key for merge operations
The merged object
StaticStringReplace placeholders in a string with values from an object using {key} syntax.
Object containing replacement values
String with placeholders (e.g., "Hello {name}")
String with placeholders replaced by object values
StaticgetConvert milliseconds to a human-readable time string.
Time in milliseconds
Human-readable time string (e.g., "5 minutes", "2 hours")
StaticdelayCreate a delay/sleep for the specified number of milliseconds.
Time to delay in milliseconds (default: 1000)
Promise that resolves after the specified time
StaticwaitWait with delays while checking a condition, throwing an error on timeout.
Function that returns true while waiting should continue
Function to call on timeout (before throwing)
Delay between checks in milliseconds (default: 1000)
Maximum number of check attempts (default: 10)
StaticisCheck if a value is a simple primitive type (string, number, or boolean).
The value to check
True if the value is a string, number, or boolean
StaticisType guard to check if a value is a string.
The value to check
True if the value is a string
StaticisType guard to check if a value is a Date object.
The value to check
Currently unused parameter for potential string date matching
True if the value is a Date instance
StaticisType guard to check if a value is an array.
The value to check
True if the value is an array
StaticisType guard to check if a value is a function.
The value to check
True if the value is a function
StaticisType guard to check if a value is a symbol.
The value to check
True if the value is a symbol
StaticisType guard to check if a value is a valid number (not NaN).
The value to check
True if the value is a number and not NaN
StaticisCheck if a value can be parsed as a valid number and return the parsed result.
The value to check and parse
Object with status (true if valid) and value (the parsed number)
StaticisType guard to check if a value is a boolean.
The value to check
True if the value is a boolean
StaticisType guard to check if a value is undefined.
The value to check
True if the value is undefined
StaticisType guard to check if a value is null.
The value to check
True if the value is null
StaticisType guard to check if a value is a plain object (not array, null, etc.).
The value to check
True if the value is a plain object
StaticTypeofType guard to check object constructor type (array or object).
The value to check
The type to check for ("array" or "object")
True if the value matches the specified constructor type
StaticisType guard to check if a value is a plain object with string keys.
The value to check
True if the value is a plain object
StaticisType guard to check if a value is null or undefined.
The value to check
True if the value is null or undefined
StaticgenGenerate a random integer between min and max (inclusive).
Minimum value (inclusive)
Maximum value (inclusive)
Random integer between min and max
StaticclampClamp a number between a minimum and maximum value.
Minimum allowed value
Maximum allowed value
Value to clamp
The clamped value
StaticsleepSleep/delay execution for the specified number of milliseconds.
Time to sleep in milliseconds (default: 1000)
Promise that resolves after the specified time
Just a bunch of utility functions - some are used within the framework, others are just general purpose. You can use any of these functions instead of writing your own or importing from an additional library.
This class only has static methods, so don't going creating instances of it.
If you want to use it, like for isNullOrUndefined, you can just call it directly on the class:
Tools.isNullOrUndefined(value).See
API: Tools