Skip to content

Changelog — Helpers by version

Function Category Description
extractNumber number Extracts the first number embedded anywhere in a string, or passes through a number. Unlike a plain parseFloat/parseInt, the number does not need to be at the start of the string: digits are searched for anywhere, so leading/trailing text (units, labels, …) is ignored. A - before the digits and a scientific-notation suffix (e/E) are disambiguated with ExtractNumberOptions.sign and ExtractNumberOptions.exponent. Returns undefined if no number can be found.
Function Category Description
isArrayLike type Checks if a value is array-like: has a non-negative integer length property. Returns true for arrays, strings, arguments objects, NodeList, typed arrays, and any object with a valid length. Functions are excluded even though they have a length (arity), as they are not considered array-like in practice.
isAsyncGenerator type Checks if a value is an async generator object (the result of calling an async function*). Distinct from isAsyncGeneratorFunction: this predicate targets the instance produced by calling an async generator function, not the function itself.
isAsyncGeneratorFunction type Checks if a value is an async generator function (an async function* declaration or expression). Distinct from isAsyncGenerator: this predicate targets the function itself, not the async iterator it produces when called.
isAsyncIterable type Checks if a value implements the async iterable protocol. Returns true for any object that has a [Symbol.asyncIterator]() method, including async generators. Note that regular iterables (arrays, strings, etc.) are not async iterables.
isBlank string Checks if a string is blank — empty or contains only whitespace characters. null and undefined are considered blank and return true. Uses String.prototype.trim() internally, which covers all ECMAScript whitespace: standard ASCII whitespace (\\t, \\n, \\r, \\f, \\v), non-breaking space (U+00A0), BOM (U+FEFF), and all Unicode “Space_Separator” category characters (en space, em space, thin space, ideographic space, etc.). Zero-width characters (U+200B zero-width space, U+200C, U+200D, U+2060) are not treated as whitespace — they are Unicode “Format” (Cf) characters, not spaces. Strip them explicitly if needed: isBlank(value.replace(/[​-‍⁠]/g, ''))
isEmpty array Checks if an array is empty (has no elements). null and undefined are treated as empty arrays and return true.
isEmpty object Checks if a plain object has no own enumerable string-keyed properties. null and undefined are treated as empty objects and return true. Symbol-keyed properties are not counted. Use Object.getOwnPropertySymbols separately if symbol keys matter for your use case.
isEmpty string Checks if a string is empty (""), null, or undefined. This is a strict emptiness check — whitespace-only strings are not considered empty. Use isEmpty(value?.trim()) if you need to treat blank strings as empty.
isEven number Checks if a value is an even integer. Returns false for non-numbers, non-integers, NaN, Infinity, and odd integers.
isGenerator type Checks if a value is a generator object (the result of calling a function*). Distinct from isGeneratorFunction: this predicate targets the instance produced by calling a generator function, not the function itself.
isGeneratorFunction type Checks if a value is a generator function (a function* declaration or expression). Distinct from isGenerator: this predicate targets the function itself, not the iterator it produces when called.
isNodeStream node Checks if a value is a Node.js stream (has a .pipe() method). Uses duck-typing: any object with a pipe function qualifies, covering Readable, Writable, Duplex, Transform, and custom stream-compatible objects without importing from node:stream.
isNonEmpty array Checks if an array is non-empty (has at least one element). null and undefined are treated as empty arrays and return false.
isNonEmpty object Checks if a plain object has at least one own enumerable string-keyed property. null and undefined are treated as empty objects and return false. Symbol-keyed properties are not counted. Use Object.getOwnPropertySymbols separately if symbol keys matter for your use case.
isNonEmpty string Checks if a string is non-empty (has at least one character). null and undefined are considered empty and return false. Whitespace-only strings are considered non-empty. Use isNonEmpty(value?.trim()) if you need to exclude blank strings.
isNotBlank string Checks if a string is not blank — non-empty and contains at least one non-whitespace character. null and undefined are considered blank and return false. Uses String.prototype.trim() internally. See isBlank for the full list of characters considered whitespace (includes non-breaking space, en/em space, ideographic space, etc.).
isObservable observable Checks if a value is an RxJS Observable or any compatible observable. Uses duck-typing: returns true for any object with both .subscribe() and .pipe() methods, covering Observable, Subject, BehaviorSubject, ReplaySubject, and any RxJS-compatible observable implementation.
isOdd number Checks if a value is an odd integer. Returns false for non-numbers, non-integers, NaN, Infinity, and even integers.
isPromiseLike type Checks if a value is a thenable (has a .then() method). Looser than isPromise: accepts any object or function with a then method, including non-standard Promise implementations without .catch(). Follows the Promise/A+ specification for thenables.
isPropertyKey type Checks if a value is a valid property key: string, number, or symbol.
isSharedArrayBuffer node Checks if a value is a SharedArrayBuffer instance. SharedArrayBuffer enables shared memory between the main thread and worker threads. In browsers without COOP/COEP headers, SharedArrayBuffer may be unavailable; this function returns false in that case.
select array Filters and transforms an array in a single pass. Similar to .filter(condition).map(mapper) but iterates the array only once. Index semantics differ from .filter().map(): the index passed to both condition and mapper is the index in the original array, not the post-filter position. Use index-agnostic callbacks when the two must behave identically.
Function Category Description
correctFloat number Corrects floating-point arithmetic errors by rounding to a given number of significant digits. Useful after calculations that accumulate binary floating-point drift (e.g. 0.1 + 0.2 === 0.30000000000000004). The default precision of 14 significant digits eliminates typical rounding noise for values in the range used by most applications. Note: for values whose integer part already consumes 14 or more digits (i.e. |value| ≥ 1e13), toPrecision(14) has no room left for decimal digits and will silently truncate them. Increase precision if you need to correct drift in very large numbers. Note: IEEE-754 doubles carry at most ~17 significant decimal digits. Precision values above 17 pad with digits that reflect the underlying binary representation rather than correcting drift.
createSortByNaturalFn array Creates a sort function for objects by one or more string properties using natural ordering. Numbers embedded in values are compared numerically: “W2” < “W11” < “W20”. When multiple properties are given, ties on the first key are broken by the second key, then the third, and so on.
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.
max array Returns the maximum value in an array using a loop instead of spread, avoiding the call stack overflow that occurs with Math.max(...array) for very large arrays (> ~65 000 elements). null and undefined are treated as empty arrays and return undefined.
min array Returns the minimum value in an array using a loop instead of spread, avoiding the call stack overflow that occurs with Math.min(...array) for very large arrays (> ~65 000 elements). null and undefined are treated as empty arrays and return undefined.
sortStringNaturalAscFn array Sort strings in ascending order using natural (human-friendly) ordering. Numbers embedded in strings are compared numerically: “W2” < “W11” < “W20”.
sortStringNaturalAscInsensitiveFn array Sort strings in ascending natural order, ignoring case and diacritics (Intl.Collator { sensitivity: 'base' } — treats é, E, and e as equal). Numbers embedded in strings are compared numerically: “W2” < “W11” < “W20”.
sortStringNaturalDescFn array Sort strings in descending order using natural (human-friendly) ordering. Numbers embedded in strings are compared numerically: “W20” > “W11” > “W2”.
sortStringNaturalDescInsensitiveFn array Sort strings in descending natural order, ignoring case and diacritics (Intl.Collator { sensitivity: 'base' } — treats é, E, and e as equal). Numbers embedded in strings are compared numerically: “W20” > “W11” > “W2”.
Function Category Description
addDays date Adds days to a date. Returns a new Date — the original is never mutated. Returns null if the input is invalid.
addMonths date Adds months to a date. Returns a new Date — the original is never mutated. When the resulting month has fewer days, JavaScript clamps to the next month (e.g. Jan 31 + 1 month → Mar 3). Use with caution. Returns null if the input is invalid.
addYears date Adds years to a date. Returns a new Date — the original is never mutated. Returns null if the input is invalid.
analyzeCommits commit Analyses a list of commits to suggest a semantic version bump. Each commit is parsed via parseConventionalCommit. The body is also scanned for BREAKING CHANGE: / BREAKING-CHANGE: markers. The bump rule is: - any breaking change → 'major' - otherwise any feat'minor' - otherwise any fix'patch' - otherwise (non-empty list of non-conventional commits) → 'patch' - empty list → 'patch' with reason “No commits to analyse”
buildConventionalCommitRegex commit Builds a regular expression matching the subject line of a Conventional Commits message. The returned regex exposes four capture groups: 1. type 2. scope (or undefined when absent) 3. breaking marker ('!' or undefined) 4. description
buildStatusTable ci Builds a Markdown table body from a map of job names to CI/CD statuses. Each row follows the format | icon | **Job Name** | badge |. Intended to be embedded in a PR comment template: | | Job | Status | |:---:|-----|:------:| ${buildStatusTable(jobs)}
cartesianProduct array Computes the Cartesian product of the provided arrays. Returns all possible tuples formed by picking one element from each input array, in lexicographic order relative to the input order.
clampDate date Clamps a date to a [min, max] range. Returns a new Date — the original is never mutated. Returns null if any of the inputs is invalid.
compact array Removes all falsy values (false, null, undefined, 0, "", NaN) from an array. null and undefined are treated as empty arrays and return [].
compact object Removes all entries with falsy values (false, null, undefined, 0, "", NaN) from an object.
compare date Comparison of two dates. Accepts any DateLike input (Date, timestamp, or date string).
compose function Composes functions right-to-left: compose(f, g)(x) is equivalent to f(g(x)). The inverse of pipe, which applies functions left-to-right.
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 matching elements. null and undefined are treated as empty arrays and return {}. Items whose computed key is a prototype-polluting string (__proto__, constructor, prototype) are silently skipped.
curry function Transforms a multi-argument function into a chain of single-argument functions (Haskell-style currying). Supports up to 5 arguments. The inverse operation of applying all arguments at once: curry(fn)(a)(b) is equivalent to fn(a, b).
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. Month is 1-based (1 = January, 12 = December) to match human convention and ISO 8601 (unlike Date.getMonth() which is 0-based). Returns NaN if the month is out of range.
defer promise Runs an async function and guarantees that all deferred callbacks are executed afterwards, in LIFO order (last registered = first executed), regardless of whether the main work succeeds or throws. Inspired by Radashi’s defer. Useful for resource cleanup, temporary file removal, or any “undo” logic that must run even on failure.
diff object Structural object diff. Returns true when both inputs are deeply equal, otherwise a DiffResult describing the differences key by key. Comparison rules: - Same reference \u2192 true. - Either side is null/undefined (and not both) \u2192 false. - Both Date \u2192 epoch comparison. - Both arrays \u2192 compared with array/equalsDeep (leaf, no diff drill-down). - Special objects (Map, Set, RegExp, Promise, class instances\u2026) \u2192 reference equality. - Plain objects \u2192 key-by-key, recursing up to options.depth levels. - Mixed types (e.g. array vs object, Date vs object) \u2192 false. For a boolean wrapper see equalsDeep from this category. For a one-level boolean check see equalsShallow from this category.
difference date Calculates the difference between two dates in the specified unit. Accepts any DateLike input (Date, timestamp, or date string).
eachDay date Returns an array of Date objects for each day from start to end (inclusive). Both boundaries are included. If start > end, an empty array is returned. Returns an empty array if either input is invalid.
eachMonth date Returns an array of Date objects for the first day of each month from start to end (inclusive). Each returned Date is normalized to the 1st of the month at 00:00:00.000. If start > end, an empty array is returned. Returns an empty array if either input is invalid.
endOf date Returns a new Date set to the end of the given unit. - 'day' — 23:59:59.999 - 'month' — last day of the month, 23:59:59.999 - 'year' — December 31st, 23:59:59.999 Returns null if the input is invalid.
ensureArray array Wraps a value in an array if it is not already one. If the value is already an array, it is returned as-is. If the value is null or undefined, returns an empty array. When a depth is specified, the resulting array is flattened to that depth (like Array.prototype.flat(depth)).
ensureDate date Safely converts a date-like value to a valid Date object, or returns null. Accepts Date, timestamps (seconds or milliseconds, auto-detected), date strings, and objects with an epochMilliseconds property (e.g. Temporal.Instant, Temporal.ZonedDateTime). Returns null for null, undefined, empty strings, 0, and any value that produces an invalid Date. This is the date equivalent of ensureArray — it normalizes flexible input into a guaranteed type (or a safe fallback).
equalsDeep array Recursive structural array equality. Two arrays are equal when they have the same length and each pair of elements at the same index is structurally equal: - Arrays recurse with equalsDeep. - Plain objects recurse key-by-key with structural comparison. - Date instances are compared by their epoch value. - All other values use strict equality (===), which means NaN !== NaN and special objects (Map, Set, RegExp, Promise, class instances\u2026) are compared by reference. For positional one-level comparison use equalsShallow. For order-independent comparison use equalsUnordered.
equalsDeep object Recursive structural object equality. Boolean wrapper around diff \u2014 returns true when the two values are deeply equal according to the same rules. Use this when you only need a yes/no answer; use diff when you also need to know what differs. For a one-level boolean check use equalsShallow.
equalsShallow array Positional, one-level (shallow) array equality. Two arrays are equal when they have the same length and each pair of elements at the same index satisfies strict equality (===). No recursion: nested arrays/objects are compared by reference. For recursive structural comparison use equalsDeep. For order-independent comparison use equalsUnordered.
equalsShallow object One-level (shallow) object equality. Two objects are equal when they share the exact same set of own enumerable string keys and each pair of values satisfies strict equality (===). No recursion: nested objects/arrays are compared by reference. Falls back to strict equality when either input is null, undefined or not an object \u2014 so primitives match if and only if they are ===. Arrays are not supported; they always return false (unless identical references). Use array/equalsShallow instead. For recursive structural comparison use equalsDeep. For a diff structure use diff.
equalsUnordered array Order-independent (set-style) array equality. Two arrays are considered equal when they have the same length and every element of arr1 has at least one structural match in arr2 (and vice versa via the length check). Nested arrays are compared recursively with the same order-independent semantics. Nested plain objects are compared with equalsShallow from object/. All other values use strict equality (===). Use this when the inputs represent unordered collections (sets, tags…). For positional equality use equalsShallow or equalsDeep from this category.
escape markdown Escapes all Markdown special characters in a string so they render as literal text rather than formatting syntax. Escaped characters: \\ \\ * _ { } [ ] ( ) # + - . ! Pass{ cell: true }` to also escape pipe characters and replace newlines with spaces, making the result safe for embedding in a Markdown table cell.
escapeHtml string Escapes the HTML special characters &, <, >, ", and ' in a string. Use this to safely embed untrusted content into HTML attribute values or text nodes without risk of XSS injection.
flip function Creates a function that invokes fn with the first two arguments swapped. Useful when adapting a function for use in higher-order pipelines where the argument order is reversed (e.g. passing a binary callback to reduce).
formatCompact number Formats a number using compact notation (e.g. 1_500_000 → "1.5M"). Thin wrapper over Intl.NumberFormat with notation: 'compact'. Companion of formatSize in the same format* family.
formatDuration date Formats a duration in milliseconds as a compact human-readable string. Produces output like "1h 23m 45s". Zero-valued leading units are omitted (e.g. "23m 45s" instead of "0h 23m 45s"), but trailing zeros are kept up to the minimum unit ("1h 0m 0s" when minUnit is 'seconds'). Negative durations are prefixed with "-". A zero duration returns "0s" (or "0m" / "0h" depending on minUnit).
formatInTimezone date Formats a date in a specific IANA timezone using Intl.DateTimeFormat. Returns null if the date or timezone is invalid.
formatSize number Format a byte count into a human-readable string with the appropriate unit. Each unit is 1024 of the previous (binary prefix). The result is formatted with one decimal place.
fromMillis date Creates a Date from a timestamp in milliseconds. Use this when receiving a timestamp from a JS-native source (e.g. Date.now(), performance.timeOrigin). No heuristic — the input is always treated as milliseconds.
fromSeconds date Creates a Date from a timestamp in seconds. Use this when receiving a timestamp from a backend that sends seconds (e.g. Java Instant.getEpochSecond()). No heuristic — the input is always treated as seconds.
getTimezoneOffset date Returns the UTC offset in minutes for the given IANA timezone at a specific point in time. A positive value means the timezone is ahead of UTC (e.g. +60 for CET). Returns null if the timezone is invalid or the date cannot be parsed. The implementation uses Intl.DateTimeFormat to extract the local representation in the target timezone, then computes the delta from UTC.
groupBy object Groups an array of items by a key derived from each item. A thin, typed wrapper around Object.groupBy (ES2024) that works on older targets and provides stricter return-type inference. null and undefined are treated as empty arrays and return {}. Items whose computed key is a prototype-polluting string (__proto__, constructor, prototype) are silently skipped.
guard promise Wraps a function so that if it throws, a default value is returned instead of propagating the error. Works with both synchronous and asynchronous functions.
identity function Returns the given value unchanged Useful as a default transform, in function composition, or as a placeholder mapper.
injectWordBreaks string Adds word-break opportunities to a string so it can wrap cleanly in narrow UI containers such as side panels or table cells. Invisible zero-width spaces (\\u200B) are inserted at meaningful boundaries — camelCase splits, path separators, token edges — while protected spans (URLs, emails, HTML) and atomic numeric values (-0.1%, 12ms, 1e-3) are never broken. The visible text content is unchanged.
inRange number Checks whether a number falls within [min, max] (both inclusive by default).
invert object Returns a new object with keys and values swapped. If multiple keys share the same value, the last one wins. null and undefined are treated as empty objects and return {}. Entries whose source key or value is a prototype-polluting string (__proto__, constructor, prototype) are silently skipped.
isArrayBuffer type Checks if a value is an ArrayBuffer instance. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isArrayBuffer)
isAsyncFunction type Checks if a value is an async function. Returns true for any function declared with async.
isBigInt type Checks if a value is a bigint.
isBlob type Checks if a value is a Blob instance. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isBlob)
isBuffer node Checks if a value is a Node.js Buffer instance. Buffer extends Uint8Array and is specific to Node.js, Bun, and Deno. In browser-only environments where Buffer is not defined, this function always returns false. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isBuffer)
isBusinessDay date Checks whether a date falls on a business day (i.e. not a weekend day). This is the logical inverse of isWeekend. By default, business days are Monday through Friday. Pass a custom weekendDays to adapt to other calendars. > Note: This helper does not account for public holidays — those are > country- and region-specific. Use it in combination with your own holiday > list if needed. Returns false if the input is invalid.
isConventionalCommit commit Checks whether a commit message’s subject line follows the Conventional Commits format constrained by the given options. Only the first line is inspected — body and footer are ignored.
isDate type Checks if a value is a Date instance. Note: this only checks the type, not whether the Date is valid. Use date/isValid to also validate that the Date is not Invalid Date.
isDefined type Checks if a value is defined (not undefined nor null). This is the inverse of isNullish. Use as a type-safe filter callback to remove null/undefined from arrays.
isEmpty type Checks if a value is empty. Supported types: - null / undefined → empty - string → length === 0 - array → length === 0 - Map / Set → size === 0 - plain object → no own enumerable properties
isError type Checks if a value is an Error instance.
isFalsy type Checks if a value is falsy (false, null, undefined, 0, "", NaN).
isFormData type Checks if a value is a FormData instance. Useful for filtering or type-narrowing in a functional pipeline: values.filter(isFormData)
isIterable type Checks if a value is iterable (has a Symbol.iterator method). Returns true for strings, arrays, Maps, Sets, generators, and any object implementing the iterable protocol.
isLeapYear date Returns true if the given year is a leap year. A year is a leap year when it is divisible by 4, except century years which must also be divisible by 400.
isMap type Checks if a value is a Map instance.
isNegative number Checks if a value is a number less than 0. Returns false for NaN, 0, positive numbers, and non-number types.
isNull type Checks if a value is null.
isNullish type Checks if a value is null or undefined (nullish).
isPlainObject type Checks if a value is a plain object. A plain object is created by {}, new Object(), or Object.create(null). Returns false for arrays, Date, Map, Set, RegExp, class instances, etc.
isPositive number Checks if a value is a number greater than 0. Returns false for NaN, 0, negative numbers, and non-number types.
isPrerelease version Returns true when the version string has a prerelease suffix (i.e. contains a - after the core MAJOR.MINOR.PATCH).
isPrimitive type Checks if a value is a JavaScript primitive. Primitive types: string, number, boolean, bigint, symbol, null, undefined.
isPromise type Checks if a value is a Promise or a thenable. Returns true for any object that has .then() and .catch() methods, including native Promises and userland implementations.
isRegExp type Checks if a value is a RegExp instance.
isSameDay date Checks if two dates are the same day. Accepts any DateLike input (Date, timestamp, or date string).
isSameMonth date Checks if two dates are in the same month (and year). Accepts any DateLike input (Date, timestamp, or date string).
isSameYear date Checks if two dates are in the same year. Accepts any DateLike input (Date, timestamp, or date string).
isSpecialObject type Determines if a value is a special object that should not have its properties compared deeply. Special objects include: Date, Function, Promise, Observable, RegExp, Error, Map, Set, WeakMap, WeakSet, etc.
isSymbol type Checks if a value is a symbol.
isTemporalDuration type Checks if a value is a Temporal.Duration. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers).
isTemporalInstant type Checks if a value is a Temporal.Instant. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers).
isTemporalPlainDate type Checks if a value is a Temporal.PlainDate. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers).
isTemporalPlainDateTime type Checks if a value is a Temporal.PlainDateTime. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers).
isTemporalPlainTime type Checks if a value is a Temporal.PlainTime. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers).
isTemporalZonedDateTime type Checks if a value is a Temporal.ZonedDateTime. Uses instanceof when Temporal is available globally, and falls back to Symbol.toStringTag for environments without Temporal (e.g. browsers).
isTimestamp type Checks if a value is a valid timestamp (milliseconds or Unix seconds). Supports: - JavaScript / Java timestamps (milliseconds since epoch) - Unix timestamps (seconds since epoch) The function uses a heuristic to distinguish between the two: numbers ≤ ~7.26 billion are treated as seconds, larger as milliseconds.
isTruthy type Checks if a value is truthy (not false, null, undefined, 0, "", or NaN). This is the type-safe alternative to Boolean() as a filter callback. Unlike filter(Boolean), using filter(isTruthy) correctly narrows the resulting array type by excluding falsy values.
isUndefined type Checks if a value is undefined.
isValid date Checks if a value is a valid Date instance (not Invalid Date). Unlike isDate (in type/), this also verifies that the internal timestamp is not NaN.
isValidDateString date Checks whether a string can be parsed into a valid Date. Uses the native Date constructor. Returns false for empty strings and any string that produces an Invalid Date. > Caveat: The native parser is lenient and implementation-dependent > for non-ISO formats. For strict format validation, prefer a dedicated > library or manual regex checks.
isWeekend date Checks whether a date falls on a weekend day. By default, weekend days are Saturday and Sunday (Western convention). Pass a custom weekendDays tuple to adapt to other calendars (e.g. [5, 6] for Friday/Saturday in many Middle-Eastern countries). Returns false if the input is invalid.
isWithinRange date Checks whether a date falls within a range (inclusive on both ends). Returns false if any of the inputs is invalid.
leadingSentence string Extracts the leading sentence from a string. null and undefined are passed through unchanged. A sentence boundary is detected at the first occurrence of ., ?, !, , or ; followed by whitespace or end of string. Newlines are collapsed to spaces before matching. If no boundary is found the entire (cleaned) string is returned. To cap the result at a maximum length, combine with truncate: ts truncate(leadingSentence(input), 120)
lerp number Linearly interpolates between start and end by the factor t. - t = 0 returns start. - t = 1 returns end. - Values of t outside [0, 1] extrapolate beyond the range.
listTimezones date Returns the list of IANA timezone identifiers supported by the runtime. Wraps Intl.supportedValuesOf('timeZone') which is available in Node 18+, Chrome 93+, Firefox 93+, Safari 15.4+.
map object Transforms the values and/or keys of a plain object in a single pass. Both callbacks are optional and default to identity (no transformation). When mapValue is omitted the original values are preserved; when mapKey is omitted the original keys are preserved. Note: if two different keys map to the same output key the last one wins (insertion order). Entries whose mapped key is a prototype-polluting string (__proto__, constructor, prototype) are silently skipped.
mean array Calculates the arithmetic mean (average) of an array of numbers. Returns NaN for an empty array. Pairs with sum for aggregate operations.
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 explicitly ignore a value.
omit object Creates a new object without the specified keys.
once function Creates a function that is restricted to be called only once. Subsequent calls return the cached result of the first invocation. The returned function exposes a .reset() method to clear the cache and allow the original function to be called again.
overlaps date Checks whether two date ranges overlap. Two ranges overlap when rangeA.start <= rangeB.end AND rangeB.start <= rangeA.end (inclusive on both ends). Returns false if any date is invalid.
parallel promise Runs an array of async functions with a concurrency limit. At most limit functions will be running at any time.
parse version Parses a semantic version string into its components according to SemVer 2.0.0 specification Supports: - Core version: MAJOR.MINOR.PATCH - Pre-release: -alpha, -beta.1, -rc.1, -0.3.7, -x.7.z.92 - Build metadata: +build, +sha.abc123, +20130313144700 - Optional ‘v’ prefix (commonly used in git tags)
parseConventionalCommit commit Parses a Conventional Commits message into a structured object. The first line is matched against the regex produced by buildConventionalCommitRegex(options). The remaining content is split into a body and an optional trailing footer block (lines matching Token: value / Token #value, including BREAKING CHANGE: ...).
parsePackageRepository url Parse the repository field from package.json into a structured object. Supports all npm-specified formats: - Object form: { "type": "git", "url": "...", "directory": "..." } - GitHub shorthand: "owner/repo" or "github:owner/repo" - Platform shorthands: "gitlab:owner/repo", "bitbucket:owner/repo" - Gist shorthand: "gist:<id>" - URL forms: git+https://, https://, git://, git@ SSH, git+ssh:// Returns undefined for null, undefined, arrays, or values that cannot be matched to any recognised format.
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. The first group contains elements for which the predicate returns true, the second group contains the rest. null and undefined are treated as empty arrays and return [[], []].
pascalCase string Converts a string to PascalCase. Handles camelCase, kebab-case, snake_case, spaces, and mixed formats.
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. The inverse of compose, which applies functions right-to-left.
range array Generates an array of sequential numbers from start to end (exclusive). If only one argument is provided, it generates numbers from 0 to that value.
resolveRecord promise Resolves an array of keys into a record by calling an async mapper for each key. All mapper calls run concurrently via Promise.all. Unlike parallel, which returns an array, resolveRecord preserves the key-to-value relationship in the result.
safeFetch promise Wraps fetch with built-in error handling: returns null when the request fails (network error, non-OK status, or parse error) instead of throwing.
safeJsonParse object Parses a JSON string, returning null (or a fallback) on any parse failure. Unlike JSON.parse, this never throws. Invalid JSON strings and other parsing edge-cases resolve to null or the provided fallback.
sample array Picks one or more random elements from an array. When called without a count, returns a single element or undefined if the array is empty. When called with a count, returns an array of up to count random elements sampled without replacement.
shuffle array Randomly reorders elements of an array using the Fisher-Yates algorithm. Returns a new array without mutating the original. null and undefined are treated as empty arrays and return [].
slugify string Converts a string into a URL-friendly slug.
snakeCase string Converts a string to snake_case. Handles camelCase, PascalCase, kebab-case, spaces, and mixed formats.
startOf date Returns a new Date set to the start of the given unit. - 'day' — 00:00:00.000 - 'month' — 1st of the month, 00:00:00.000 - 'year' — January 1st, 00:00:00.000 Returns null if the input is invalid.
statusToBadge ci Maps a CI/CD job status to an inline code badge string. | Status | Badge | |––––|—––| | success | `passing` | | failure | `failing` | | skipped | `skipped` | | (other) | `unknown` |
statusToIcon ci Maps a CI/CD job status to an emoji icon. | Status | Icon | |––––|——| | success | ✅ | | failure | ❌ | | skipped | ⏭️ | | (other) | ⚠️ |
stringify version Reconstruct a semantic version string from a ParsedVersion object. This is the inverse of parse: stringify(parse(v)) === stripV(v) for any valid SemVer string v.
sum array Calculates the sum of an array of numbers. null and undefined are treated as empty arrays and return 0.
template string Interpolates {{key}} placeholders in a template string with values from a data record. Unknown keys are replaced with an empty string. No eval or Function constructor is used — substitution is purely regex-based. Nested expressions and logic are intentionally out of scope.
timeAgo date Formats a date as a human-readable relative time string. Uses Intl.RelativeTimeFormat under the hood, making the output locale-aware (e.g. “il y a 3 jours” in French). Returns null if the input date is invalid.
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. Handles camelCase, PascalCase, kebab-case, snake_case, spaces, and mixed formats.
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). Use this when you need a plain number from a DateLike value (e.g. for Date.now() comparisons, localStorage, or JS-native APIs).
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 HTTP headers
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 ISO 8601, but without milliseconds by default
toSeconds date Converts a date to a timestamp in seconds (epoch seconds). Use this when sending a date to a backend API that expects seconds (e.g. Java Instant.getEpochSecond(), Python time.time()).
truncate string Truncates a string to maxLength characters, appending an ellipsis when cut. The ellipsis counts toward maxLength, so the result is always at most maxLength characters long. If the string is already within the limit, it is returned unchanged (no ellipsis appended). null and undefined inputs are returned as-is to align with other string helpers.
tryit promise Wraps a function so it never throws. Instead, it returns a [error, result] tuple. Useful for avoiding try/catch blocks and handling errors in a functional style.
unzip array Splits an array of tuples into separate arrays, one per position. The inverse of zip.
uuid7 id Generates a UUID v7 string (RFC 9562). UUID v7 embeds a Unix timestamp in milliseconds, making it chronologically sortable while retaining randomness.
WeekDays date Named day-of-week constants following the JavaScript Date.getDay() convention. Use these instead of raw numbers for readability.
without array Returns a new array with all occurrences of the given values removed. Unlike difference, which operates on two arrays as set operands, without uses a variadic API suited for removing known sentinel values inline. Uses SameValueZero equality (same as Array.prototype.includes). null and undefined are treated as empty arrays and return [].
words string Splits a string into an array of words. null and undefined return []. Handles camelCase, PascalCase, SCREAMING_SNAKE_CASE, kebab-case, snake_case, and regular whitespace-separated text. Numbers are treated as word tokens.
zip array Combines multiple arrays element-by-element into an array of tuples. The result length equals the length of the shortest input array. The inverse of unzip.

Looking for older releases? See the v1 changelog.