THOUSANDconstant
One thousand.
Named constants for common numeric magnitudes, time durations, whitespace characters, and control symbols. Import these instead of magic numbers to keep code readable and consistent.
SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR) are in milliseconds, matching the Date API.MONTH is 30 days and YEAR is 365 days — fixed approximations, not calendar-aware.ABORT, NONE, SKIP) are unique symbols, safe to use as sentinel values in union types.import { SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR } from "shelving/util";
const cache = new Map();
setTimeout(() => cache.clear(), 5 * MINUTE);
const expiresAt = Date.now() + 30 * DAY;import { THOUSAND, TEN_THOUSAND, HUNDRED_THOUSAND, MILLION, BILLION, TRILLION } from "shelving/util";
const limit = 2 * MILLION;import { NBSP, THINSP, NNBSP } from "shelving/util";
// Non-breaking space — prevents line breaks between words
const label = `100${NBSP}km`;
// Narrow non-breaking space — conventional between a number and its unit
const formatted = `42${NNBSP}°C`;import { ABORT, NONE, SKIP } from "shelving/util";
function process(value: unknown): string | typeof ABORT {
if (cancelled) return ABORT;
return String(value);
}import { WAITING, SUCCESS, FAILURE, UP, DOWN, LEFT, RIGHT } from "shelving/util";
console.log(`${SUCCESS} Done`);
console.log(`${FAILURE} Failed`);One thousand.
Ten thousand.
Hundred thousand.
One million.
One billion.
One trillion.
One second in milliseconds.
One minute in milliseconds.
One hour in milliseconds.
One day in milliseconds.
One week in milliseconds.
One month in milliseconds.
One year in milliseconds.
Non-breaking space (U+00A0).
Thin space (U+2009).
Non-breaking narrow space (U+202F, goes between numbers and their corresponding units).
The ABORT symbol indicates something was manually aborted.
ABORT: unique symbol
The NONE symbol indicates something is nothing.
NONE: unique symbol
The SKIP symbol indicates something should be silently skipped.
SKIP: unique symbol
Waiting/ellipsis icon character (⋯).
Success/check icon character (✓).
Failure/cross icon character (✗).
Up arrow icon character (↑).
Down arrow icon character (↓).
Right arrow icon character (→).
Left arrow icon character (←).