All Functions
All Functions
Section titled “All Functions”230 implemented helpers + 44 covered by native JavaScript APIs, sorted alphabetically.
| Function | Category | Description |
|---|---|---|
add / subtract (date arithmetic) | date | native JS Temporal.PlainDate.prototype.add(duration) / .subtract(duration) (Temporal (Stage 3)) |
addDays | date | Adds days to a date. |
addMonths | date | Adds months to a date. |
addYears | date | Adds years to a date. |
analyzeCommits | commit | Analyses a list of commits to suggest a semantic version bump. |
buildConventionalCommitRegex | commit | Builds a regular expression matching the subject line of a Conventional Commits message. |
buildStatusTable | ci | Builds a Markdown table body from a map of job names to CI/CD statuses. |
camelCase | string | Converts kebab-case to camelCase |
capitalize | string | Capitalizes the first letter of a string. |
cartesianProduct | array | Computes the Cartesian product of the provided arrays. |
ceil / floor | number | native JS Math.ceil() / Math.floor() (ES1) |
chunk | array | Chunks an array into smaller arrays of specified size |
clamp | number | Clamps a number between min and max values |
clampDate | date | Clamps a date to a [min, max] range. |
cleanPath | url | Clean an URL by removing duplicate slashes. |
combine | observable | Combine two observables with a map function and an optional pre-treatment. |
combineLatest | observable | Combines multiple Observables to create an Observable whose values are calculated from the latest values of each of i… |
compact | array | Removes all falsy values (false, null, undefined, 0, "", NaN) from an array. |
compact | object | Removes all entries with falsy values (false, null, undefined, 0, "", NaN) from an object. |
compare | date | Comparison of two dates. |
compare | version | Compares two semantic version strings according to SemVer 2.0.0 specification Supports: - Core version: MAJOR.MINOR.… |
compare (ordering) | date | native JS Temporal.PlainDate.compare(a, b) / Temporal.Instant.compare(a, b) (Temporal (Stage 3)) |
compose | function | Composes functions right-to-left: compose(f, g)(x) is equivalent to f(g(x)). |
consoleLogPromise | promise | Returns a function that logs data to the console and passes it through. |
correctFloat | number | Corrects floating-point arithmetic errors by rounding to a given number of significant digits. |
countBy | array | Groups the elements of an array by the key returned by keyFn and returns a record mapping each key to the number of… |
createSortByDateFn | array | Creates a sort function for objects by date property. |
createSortByNaturalFn | array | Creates a sort function for objects by one or more string properties using natural ordering. |
createSortByNumberFn | array | Creates a sort function for objects by number property. |
createSortByStringFn | array | Creates a sort function for objects by one or more string properties. |
curry | function | Transforms a multi-argument function into a chain of single-argument functions (Haskell-style currying). |
dateToISOString | date | Formats a date to ISO string or returns null. |
daysDifference | date | Gets the difference in days between two dates. |
daysInMonth | date | Returns the number of days in the given month of the given year. |
debounce | function | Creates a debounced function that delays invoking func until after delay milliseconds have elapsed since the last tim… |
deepClone | object | Creates a deep copy of an object or array |
deepMerge | object | Merges two or more objects deeply |
DeepPartial | type | Recursively makes all properties of T optional, including nested objects and array elements. |
DeepWritable | type | Recursively removes readonly from all properties of T, including nested objects, array elements, and tuple positions. |
defer | promise | Runs an async function and guarantees that all deferred callbacks are executed afterwards, in LIFO order (last regist… |
delay | promise | Creates a promise that resolves after specified delay |
diff | object | Structural object diff. |
difference | array | Returns the difference between two arrays (items in first array but not in second) |
difference | date | Calculates the difference between two dates in the specified unit. |
drop | array | native JS Array.prototype.slice(n) (ES3) |
eachDay | date | Returns an array of Date objects for each day from start to end (inclusive). |
eachMonth | date | Returns an array of Date objects for the first day of each month from start to end (inclusive). |
endOf | date | Returns a new Date set to the end of the given unit. |
ensureArray | array | Wraps a value in an array if it is not already one. |
ensureDate | date | Safely converts a date-like value to a valid Date object, or returns null. |
equalsDeep | array | Recursive structural array equality. |
equalsDeep | object | Recursive structural object equality. |
equalsShallow | array | Positional, one-level (shallow) array equality. |
equalsShallow | object | One-level (shallow) object equality. |
equalsUnordered | array | Order-independent (set-style) array equality. |
escape | markdown | Escapes all Markdown special characters in a string so they render as literal text rather than formatting syntax. |
escapeHtml | string | Escapes the HTML special characters &, <, >, ", and ' in a string. |
extractErrorMessage | string | Convert an error to a readable message. |
extractNumber | number | Extracts the first number embedded anywhere in a string, or passes through a number. |
extractPureURI | url | Extracts the pure URI from a URL by removing query parameters and fragments. |
falsyPromiseOrThrow | promise | Returns a function that passes through falsy data or throws an error. |
find / findIndex | array | native JS Array.prototype.find() / findIndex() (ES2015) |
flatten / flat | array | native JS Array.prototype.flat(depth?) (ES2019) |
flip | function | Creates a function that invokes fn with the first two arguments swapped. |
formatCompact | number | Formats a number using compact notation (e.g. |
formatDuration | date | Formats a duration in milliseconds as a compact human-readable string. |
formatInTimezone | date | Formats a date in a specific IANA timezone using Intl.DateTimeFormat. |
formatSize | number | Format a byte count into a human-readable string with the appropriate unit. |
from (parse temporal string) | date | native JS Temporal.Instant.from(str) / Temporal.PlainDate.from(str) / etc. (Temporal (Stage 3)) |
fromMillis | date | Creates a Date from a timestamp in milliseconds. |
fromSeconds | date | Creates a Date from a timestamp in seconds. |
get | object | Gets a value from an object using a dot-notated path |
getTimezoneOffset | date | Returns the UTC offset in minutes for the given IANA timezone at a specific point in time. |
groupBy | object | Groups an array of items by a key derived from each item. |
groupBy / group | array | native JS Object.groupBy(arr, fn) (ES2024) |
guard | promise | Wraps a function so that if it throws, a default value is returned instead of propagating the error. |
has | object | native JS Object.hasOwn(obj, key) (ES2022) |
head / first | array | native JS Array.prototype.at(0) (ES2022) |
identity | function | Returns the given value unchanged Useful as a default transform, in function composition, or as a placeholder mapper. |
includes | array | native JS Array.prototype.includes() (ES2016) |
increment | version | Increments a semantic version |
injectWordBreaks | string | Adds word-break opportunities to a string so it can wrap cleanly in narrow UI containers such as side panels or table… |
inRange | number | Checks whether a number falls within [min, max] (both inclusive by default). |
intersection | array | Compute the intersection of two arrays, meaning the elements that are present in both arrays. |
intersects | array | Simple helper that check if two lists shared at least an item in common. |
invert | object | Returns a new object with keys and values swapped. |
isArray | type | Checks if a value is an array. |
isArrayBuffer | type | Checks if a value is an ArrayBuffer instance. |
isArrayLike | type | Checks if a value is array-like: has a non-negative integer length property. |
isAsyncFunction | type | Checks if a value is an async function. |
isAsyncGenerator | type | Checks if a value is an async generator object (the result of calling an async function*). |
isAsyncGeneratorFunction | type | Checks if a value is an async generator function (an async function* declaration or expression). |
isAsyncIterable | type | Checks if a value implements the async iterable protocol. |
isBigInt | type | Checks if a value is a bigint. |
isBlank | string | Checks if a string is blank — empty or contains only whitespace characters. |
isBlob | type | Checks if a value is a Blob instance. |
isBoolean | type | Checks if a value is a boolean. |
isBuffer | node | Checks if a value is a Node.js Buffer instance. |
isBusinessDay | date | Checks whether a date falls on a business day (i.e. |
isConventionalCommit | commit | Checks whether a commit message’s subject line follows the Conventional Commits format constrained by the given options. |
isDate | type | Checks if a value is a Date instance. |
isDefined | type | Checks if a value is defined (not undefined nor null). |
isDirectInstanceOf | type | native JS value.constructor === Foo (ES1) |
isEmpty | array | Checks if an array is empty (has no elements). |
isEmpty | object | Checks if a plain object has no own enumerable string-keyed properties. |
isEmpty | string | Checks if a string is empty (""). |
isEmpty | type | Checks if a value is empty. |
isError | type | Checks if a value is an Error instance. |
isEven | number | Checks if a value is an even integer. |
isFalsy | type | Checks if a value is falsy (false, null, undefined, 0, "", NaN). |
isFinite / isFiniteNumber | type | native JS Number.isFinite(value) (ES2015) |
isFormData | type | Checks if a value is a FormData instance. |
isFunction | type | Checks if a value is a function. |
isGenerator | type | Checks if a value is a generator object (the result of calling a function*). |
isGeneratorFunction | type | Checks if a value is a generator function (a function* declaration or expression). |
isHtmlElement / isUrlInstance / isUrlSearchParams | type | native JS value instanceof HTMLElement / URL / URLSearchParams (Web API) |
isInfinite | type | native JS value === Infinity || value === -Infinity / !Number.isFinite(value) && !Number.isNaN(value) (ES2015) |
isInteger | type | native JS Number.isInteger(value) (ES2015) |
isIterable | type | Checks if a value is iterable (has a Symbol.iterator method). |
isLeapYear | date | Returns true if the given year is a leap year. |
isMap | type | Checks if a value is a Map instance. |
isNaN | type | native JS Number.isNaN(value) (ES2015) |
isNegative | number | Checks if a value is a number less than 0. |
isNodeStream | node | Checks if a value is a Node.js stream (has a .pipe() method). |
isNonEmpty | array | Checks if an array is non-empty (has at least one element). |
isNonEmpty | object | Checks if a plain object has at least one own enumerable string-keyed property. |
isNonEmpty | string | Checks if a string is non-empty (has at least one character). |
isNotBlank | string | Checks if a string is not blank — non-empty and contains at least one non-whitespace character. |
isNull | type | Checks if a value is null. |
isNullish | type | Checks if a value is null or undefined (nullish). |
isNumber | type | Checks if a value is a number. |
isObservable | observable | Checks if a value is an RxJS Observable or any compatible observable. |
isOdd | number | Checks if a value is an odd integer. |
isPlainObject | type | Checks if a value is a plain object. |
isPositive | number | Checks if a value is a number greater than 0. |
isPrerelease | version | Returns true when the version string has a prerelease suffix (i.e. |
isPrimitive | type | Checks if a value is a JavaScript primitive. |
isPromise | type | Checks if a value is a Promise or a thenable. |
isPromiseLike | type | Checks if a value is a thenable (has a .then() method). |
isPropertyKey | type | Checks if a value is a valid property key: string, number, or symbol. |
isRegExp | type | Checks if a value is a RegExp instance. |
isSafeInteger | type | native JS Number.isSafeInteger(value) (ES2015) |
isSameDay | date | Checks if two dates are the same day. |
isSameMonth | date | Checks if two dates are in the same month (and year). |
isSameYear | date | Checks if two dates are in the same year. |
isSet (Set data structure) | type | native JS value instanceof Set (ES2015) |
isSharedArrayBuffer | node | Checks if a value is a SharedArrayBuffer instance. |
isSpecialObject | type | Determines if a value is a special object that should not have its properties compared deeply. |
isString | type | Checks if a value is a string. |
isSymbol | type | Checks if a value is a symbol. |
isTemporalDuration | type | Checks if a value is a Temporal.Duration. |
isTemporalInstant | type | Checks if a value is a Temporal.Instant. |
isTemporalPlainDate | type | Checks if a value is a Temporal.PlainDate. |
isTemporalPlainDateTime | type | Checks if a value is a Temporal.PlainDateTime. |
isTemporalPlainTime | type | Checks if a value is a Temporal.PlainTime. |
isTemporalZonedDateTime | type | Checks if a value is a Temporal.ZonedDateTime. |
isTimestamp | type | Checks if a value is a valid timestamp (milliseconds or Unix seconds). |
isTimestampInSeconds | date | Checks if a timestamp is likely in seconds (Java/Unix style) vs milliseconds (JavaScript style) |
isTruthy | type | Checks if a value is truthy (not false, null, undefined, 0, "", or NaN). |
isUndefined | type | Checks if a value is undefined. |
isValid | date | Checks if a value is a valid Date instance (not Invalid Date). |
isValidDateString | date | Checks whether a string can be parsed into a valid Date. |
isValidRegex | type | Checks if a string is a valid regex pattern. |
isWeakMap / isWeakSet / isWeakRef | type | native JS value instanceof WeakMap / WeakSet / WeakRef (ES2015 / ES2021) |
isWeekend | date | Checks whether a date falls on a weekend day. |
isWithinRange | date | Checks whether a date falls within a range (inclusive on both ends). |
kebabCase | string | Converts camelCase to kebab-case |
keys / values | object | native JS Object.keys() / Object.values() (ES2017) |
last | array | native JS Array.prototype.at(-1) (ES2022) |
leadingSentence | string | Extracts the leading sentence from a string. |
lerp | number | Linearly interpolates between start and end by the factor t. |
listTimezones | date | Returns the list of IANA timezone identifiers supported by the runtime. |
map | object | Transforms the values and/or keys of a plain object in a single pass. |
max | array | Returns the maximum value in an array using a loop instead of spread, avoiding the call stack overflow that occurs wi… |
mean | number | Calculates the arithmetic mean (average) of an array of numbers. |
meaningPromiseOrThrow | promise | Returns a function that passes through meaningful data or throws an error. |
memoize | function | Returns a memoized version of the function that caches results |
merge (shallow) | object | native JS { ...a, ...b } or Object.assign({}, a, b) (ES2015) |
min | array | Returns the minimum value in an array using a loop instead of spread, avoiding the call stack overflow that occurs wi… |
min / max | number | native JS Math.min(...arr) / Math.max(...arr) (ES1) |
negate | function | Creates a function that negates the result of predicate. |
noop | function | A no-operation function that does nothing and returns undefined Useful as a default callback, placeholder, or to e… |
normalizeTimestamp | date | Converts a timestamp to JavaScript milliseconds format |
now (date/time/instant) | date | native JS Temporal.Now.instant() / .zonedDateTimeISO() / .plainDateISO() / .plainTimeISO() (Temporal (Stage 3)) |
omit | object | Creates a new object without the specified keys. |
once | function | Creates a function that is restricted to be called only once. |
onlyPath | url | Extract only the path from an URI with optional query and fragments. |
overlaps | date | Checks whether two date ranges overlap. |
padStart / padEnd | string | native JS String.prototype.padStart() / padEnd() (ES2017) |
parallel | promise | Runs an array of async functions with a concurrency limit. |
parse | version | Parses a semantic version string into its components according to SemVer 2.0.0 specification Supports: - Core versio… |
parseConventionalCommit | commit | Parses a Conventional Commits message into a structured object. |
parsePackageRepository | url | Parse the repository field from package.json into a structured object. |
partial | function | Partially applies arguments to a function, returning a new function that accepts the remaining arguments. |
partition | array | Splits an array into two groups based on a predicate function. |
pascalCase | string | Converts a string to PascalCase. |
pick | object | Creates a new object with only the specified keys. |
pipe | function | Composes functions left-to-right: the output of each function is passed as input to the next. |
randomBetween | number | Generates a random number between min and max (inclusive) |
randomIntBetween | number | Generates a random integer between min and max (inclusive) |
range | array | Generates an array of sequential numbers from start to end (exclusive). |
relativeURLToAbsolute | url | Converts a relative URL to an absolute URL using the current document base URI. |
removeUndefinedNull | object | Remove null and undefined values from an object. |
repeat | string | native JS String.prototype.repeat() (ES2015) |
resolveRecord | promise | Resolves an array of keys into a record by calling an async mapper for each key. |
retry | promise | Retries a promise-returning function up to maxAttempts times |
returnOrThrowError | function | Return a value or throw an error if null or undefined. |
reverse | array | native JS Array.prototype.toReversed() (ES2023) |
roundTo | number | Rounds a number to specified decimal places |
safeDate | date | Safely creates a Date object from various input types. |
safeFetch | promise | Wraps fetch with built-in error handling: returns null when the request fails (network error, non-OK status, or p… |
safeJsonParse | object | Parses a JSON string, returning null (or a fallback) on any parse failure. |
sample | array | Picks one or more random elements from an array. |
satisfiesRange | version | Checks if a version satisfies a range (simple implementation) |
select | array | Filters and transforms an array in a single pass. |
select / filterMap | array | native JS Array.prototype.filter().map() (ES5) |
set | object | Sets a value in an object using a dot-notated path |
shuffle | array | Randomly reorders elements of an array using the Fisher-Yates algorithm. |
slugify | string | Converts a string into a URL-friendly slug. |
snakeCase | string | Converts a string to snake_case. |
sort (basic comparator) | array | native JS (a, b) => a - b / a.localeCompare(b) (ES1) |
sortBy / orderBy | array | native JS Array.prototype.toSorted(fn?) (ES2023) |
sortNumberAscFn | array | Sort numbers in ascending order |
sortNumberDescFn | array | Sort numbers in descending order |
sortStringAscFn | array | Sort strings in ascending order |
sortStringAscInsensitiveFn | array | Sort strings in ascending order (case insensitive) |
sortStringDescFn | array | Sort strings in descending order |
sortStringNaturalAscFn | array | Sort strings in ascending order using natural (human-friendly) ordering. |
sortStringNaturalAscInsensitiveFn | array | Sort strings in ascending natural order (case insensitive). |
sortStringNaturalDescFn | array | Sort strings in descending order using natural (human-friendly) ordering. |
sortStringNaturalDescInsensitiveFn | array | Sort strings in descending natural order (case insensitive). |
startOf | date | Returns a new Date set to the start of the given unit. |
startsWith / endsWith | string | native JS String.prototype.startsWith() / endsWith() (ES2015) |
statusToBadge | ci | Maps a CI/CD job status to an inline code badge string. |
statusToIcon | ci | Maps a CI/CD job status to an emoji icon. |
stringify | version | Reconstruct a semantic version string from a ParsedVersion object. |
stripV | version | Strip the leading “v” from a version string if it exists. |
sum | number | Calculates the sum of an array of numbers. |
tail | array | native JS Array.prototype.slice(1) (ES3) |
take | array | native JS Array.prototype.slice(0, n) (ES3) |
template | string | Interpolates {{key}} placeholders in a template string with values from a data record. |
throttle | function | Creates a throttled function that only invokes func at most once per every wait milliseconds |
timeAgo | date | Formats a date as a human-readable relative time string. |
timeout | promise | Wraps a promise to reject with a TimeoutError if it does not resolve within the specified duration. |
titleCase | string | Converts a string to Title Case. |
toInt / toFloat | number | native JS parseInt(str, 10) / parseFloat(str) (ES1) |
toISO8601 | date | Converts a date to ISO 8601 format Format: YYYY-MM-DDTHH:mm:ss.sssZ |
toMillis | date | Converts a date to a timestamp in milliseconds (epoch millis). |
toPairs / fromPairs | object | native JS Object.entries() / Object.fromEntries() (ES2019) |
toPlainDate / toPlainDateTime / toPlainTime | date | native JS Temporal.ZonedDateTime.prototype.toPlainDate() / toPlainDateTime() / toPlainTime() (Temporal (Stage 3)) |
toRFC2822 | date | Converts a date to RFC 2822 format Format: Day, DD Mon YYYY HH:mm:ss +0000 Used in email headers (Date field) and HTT… |
toRFC3339 | date | Converts a date to RFC 3339 format Format: YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss+HH:mm RFC 3339 is a profile of… |
toSeconds | date | Converts a date to a timestamp in seconds (epoch seconds). |
toTemporalInstant | date | native JS Date.prototype.toTemporalInstant() (Temporal (Stage 3)) |
toZonedDateTime | date | native JS Temporal.Instant.prototype.toZonedDateTimeISO(tz) (Temporal (Stage 3)) |
trim / trimStart / trimEnd | string | native JS String.prototype.trim() / trimStart() / trimEnd() (ES2019) |
truncate | string | Truncates a string to maxLength characters, appending an ellipsis when cut. |
truthyPromiseOrThrow | promise | Returns a function that passes through truthy data or throws an error. |
tryit | promise | Wraps a function so it never throws. |
TypedArrays (isInt8Array, isFloat32Array, ...) | type | native JS value instanceof Int8Array / Float32Array / ... (ES2015) |
union | array | native JS unique([...a, ...b]) (ES2015) |
unique | array | Removes duplicate values from an array |
until / since (difference) | date | native JS Temporal.PlainDate.prototype.until(other) / .since(other) (Temporal (Stage 3)) |
unzip | array | Splits an array of tuples into separate arrays, one per position. |
uuid7 | id | Generates a UUID v7 string (RFC 9562). |
WeekDays | date | Named day-of-week constants following the JavaScript Date.getDay() convention. |
withLeadingSlash | url | Adds a leading slash / to the given URL if it is not already present. |
without | array | Returns a new array with all occurrences of the given values removed. |
withoutLeadingSlash | url | Removes the leading slash / from the given URL if it is present. |
withoutTrailingSlash | url | Removes the trailing slash / from the given URL if it is present. |
withResolvers | promise | native JS Promise.withResolvers() (ES2024) |
withTrailingSlash | url | Adds a trailing slash / to the given URL if it is not already present. |
words | string | Splits a string into an array of words. |
zip | array | Combines multiple arrays element-by-element into an array of tuples. |