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. |
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. |
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). |
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. |
deepCompare | object | Deep comparison of two objects that returns detailed information about differences. |
deepEquals | array | Deep comparison of two arrays that only returns true or false. Arrays are considered equal if they have the same length and all elements at corresponding positions are strictly equal. Only compares arrays, does not go into deep object comparison. |
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). |
equals | array | Simple helper that checks if two lists are identical. The order of elements in the list is not important. |
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. |
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. |
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. |
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. |
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. |
isDate | type | Checks if a value is a Date instance. Note: this only checks the type, not whether the Date is valid. Use isValidDate 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). |
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. |
isNegativeNumber | type | Checks if a value is a number less than 0. Returns false for NaN, 0, positive numbers, and non-number types. |
isNonEmptyArray | type | Checks if a value is a non-empty array (length > 0). |
isNonEmptyString | type | Checks if a value is a non-empty string (length > 0). |
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. |
isPositiveNumber | type | Checks if a value is a number greater than 0. Returns false for NaN, 0, negative numbers, and non-number types. |
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. |
isValidDate | type | Checks if a value is a valid Date instance (not Invalid Date). Unlike isDate, 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. |
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+. |
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. |
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) |
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. |
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. |
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. |
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. |
shallowEquals | array | Quick comparison of two arrays using JSON.stringify. This is a fast but simple comparison that may not work for all edge cases. |
shallowEquals | object | Quick comparison of two objects using JSON.stringify. This is a fast but simple comparison that may not work for all edge cases. |
shuffle | array | Randomly reorders elements of an array using the Fisher-Yates algorithm. Returns a new array without mutating the original. |
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. |
sum | number | Calculates the sum of an array of numbers. |
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()). |
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. |
uuid7 | math | 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. |