@tempots/std
Version:
Std library for TypeScript. Natural complement to the Tempo libraries.
197 lines (196 loc) • 8.27 kB
JavaScript
import { allElements as t, anyElement as i, applyArrayDiffOperations as s, areArraysEqual as a, arrayDiffOperations as n, arrayHasValues as o, arrayHead as l, arrayOfIterableIterator as m, arrayTail as p, compareArrays as c, concatArrays as y, createFilledArray as g, filterArray as A, filterMapArray as d, filterNullsFromArray as f, flatMapArray as u, flattenArray as b, foldLeftArray as S, forEachElement as C, generateArray as x, generateSequenceArray as h, isArrayEmpty as v, joinArrayWithConjunction as E, mapArray as O, rankArray as I, removeAllFromArray as F, removeAllFromArrayByPredicate as W, removeOneFromArray as j, removeOneFromArrayByPredicate as q, sortArray as P, uniqueByPrimitive as T, uniquePrimitives as L } from "./array.js";
import { AsyncResult as B } from "./async-result.js";
import { biAbs as D, biCeilDiv as z, biCompare as H, biFloorDiv as M, biGcd as R, biIsEven as J, biIsNegative as V, biIsOdd as k, biIsOne as K, biIsPositive as Q, biIsPrime as Z, biIsZero as G, biLcm as U, biMax as X, biMin as Y, biNextPrime as _, biPow as $, biPrevPrime as ee } from "./bigint.js";
import { deferred as te } from "./deferred.js";
import { deepEqual as se, looseEqual as ae, strictEqual as ne } from "./equal.js";
import { curryLeft as le, identity as me, memoize as pe } from "./function.js";
import { isJSONArray as ye, isJSONObject as ge, isJSONPrimitive as Ae, parseJSON as de } from "./json.js";
import { EPSILON as ue, angleDifference as be, ceilTo as Se, clamp as Ce, clampInt as xe, clampSym as he, compareNumbers as ve, floorTo as Ee, interpolate as Oe, interpolateAngle as Ie, interpolateAngleCCW as Fe, interpolateAngleCW as We, interpolateWidestAngle as je, nearEqualAngles as qe, nearEquals as Pe, nearZero as Te, root as Le, roundTo as Ne, sign as Be, toHex as we, widestAngleDifference as De, wrap as ze, wrapCircular as He } from "./number.js";
import { isEmptyObject as Re, isObject as Je, mergeObjects as Ve, objectEntries as ke, objectFromEntries as Ke, objectKeys as Qe, objectValues as Ze, removeObjectFields as Ge, sameObjectKeys as Ue } from "./object.js";
import { sleep as Ye } from "./promise.js";
import { mapRegExp as $e } from "./regexp.js";
import { R as rr, V as tr } from "./result-CGd0jCdl.js";
import { canonicalizeNewlines as sr, capitalize as ar, capitalizeWords as nr, chunkString as or, collapseText as lr, compareCaseInsensitive as mr, compareStrings as pr, containsAllText as cr, containsAllTextCaseInsensitive as yr, containsAnyText as gr, containsAnyTextCaseInsensitive as Ar, countStringOccurrences as dr, dasherize as fr, decodeBase64 as ur, deleteFirstFromString as br, deleteStringAfter as Sr, deleteStringBefore as Cr, deleteSubstring as xr, ellipsis as hr, ellipsisMiddle as vr, encodeBase64 as Er, filterCharcodes as Or, filterChars as Ir, humanize as Fr, ifEmptyString as Wr, isAlpha as jr, isAlphaNum as qr, isBreakingWhitespace as Pr, isDigitsOnly as Tr, isEmptyString as Lr, isLowerCase as Nr, isSpaceAt as Br, isUpperCase as wr, jsQuote as Dr, lowerCaseFirst as zr, lpad as Hr, mapChars as Mr, quote as Rr, randomString as Jr, randomStringSequence as Vr, randomStringSequenceBase64 as kr, repeatString as Kr, replaceAll as Qr, reverseString as Zr, rpad as Gr, smartQuote as Ur, splitStringOnFirst as Xr, splitStringOnLast as Yr, splitStringOnce as _r, stringContains as $r, stringEndsWith as et, stringEndsWithAny as rt, stringHasContent as tt, stringHashCode as it, stringStartsWith as st, stringStartsWithAny as at, stringToCharcodes as nt, stringToChars as ot, stringsDifferAtIndex as lt, substringAfter as mt, substringAfterLast as pt, substringBefore as ct, substringBeforeLast as yt, surroundString as gt, textContainsCaseInsensitive as At, textEndsWithAnyCaseInsensitive as dt, textEndsWithCaseInsensitive as ft, textStartsWithAnyCaseInsensitive as ut, textStartsWithCaseInsensitive as bt, textToLines as St, trimChars as Ct, trimCharsLeft as xt, trimCharsRight as ht, trimStringSlice as vt, underscore as Et, upperCaseFirst as Ot, wrapColumns as It, wrapLine as Ft } from "./string.js";
import { debounce as jt, delayed as qt, interval as Pt, throttle as Tt } from "./timer.js";
export {
B as AsyncResult,
ue as EPSILON,
rr as Result,
tr as Validation,
t as allElements,
be as angleDifference,
i as anyElement,
s as applyArrayDiffOperations,
a as areArraysEqual,
n as arrayDiffOperations,
o as arrayHasValues,
l as arrayHead,
m as arrayOfIterableIterator,
p as arrayTail,
D as biAbs,
z as biCeilDiv,
H as biCompare,
M as biFloorDiv,
R as biGcd,
J as biIsEven,
V as biIsNegative,
k as biIsOdd,
K as biIsOne,
Q as biIsPositive,
Z as biIsPrime,
G as biIsZero,
U as biLcm,
X as biMax,
Y as biMin,
_ as biNextPrime,
$ as biPow,
ee as biPrevPrime,
sr as canonicalizeNewlines,
ar as capitalize,
nr as capitalizeWords,
Se as ceilTo,
or as chunkString,
Ce as clamp,
xe as clampInt,
he as clampSym,
lr as collapseText,
c as compareArrays,
mr as compareCaseInsensitive,
ve as compareNumbers,
pr as compareStrings,
y as concatArrays,
cr as containsAllText,
yr as containsAllTextCaseInsensitive,
gr as containsAnyText,
Ar as containsAnyTextCaseInsensitive,
dr as countStringOccurrences,
g as createFilledArray,
le as curryLeft,
fr as dasherize,
jt as debounce,
ur as decodeBase64,
se as deepEqual,
te as deferred,
qt as delayed,
br as deleteFirstFromString,
Sr as deleteStringAfter,
Cr as deleteStringBefore,
xr as deleteSubstring,
hr as ellipsis,
vr as ellipsisMiddle,
Er as encodeBase64,
A as filterArray,
Or as filterCharcodes,
Ir as filterChars,
d as filterMapArray,
f as filterNullsFromArray,
u as flatMapArray,
b as flattenArray,
Ee as floorTo,
S as foldLeftArray,
C as forEachElement,
x as generateArray,
h as generateSequenceArray,
Fr as humanize,
me as identity,
Wr as ifEmptyString,
Oe as interpolate,
Ie as interpolateAngle,
Fe as interpolateAngleCCW,
We as interpolateAngleCW,
je as interpolateWidestAngle,
Pt as interval,
jr as isAlpha,
qr as isAlphaNum,
v as isArrayEmpty,
Pr as isBreakingWhitespace,
Tr as isDigitsOnly,
Re as isEmptyObject,
Lr as isEmptyString,
ye as isJSONArray,
ge as isJSONObject,
Ae as isJSONPrimitive,
Nr as isLowerCase,
Je as isObject,
Br as isSpaceAt,
wr as isUpperCase,
E as joinArrayWithConjunction,
Dr as jsQuote,
ae as looseEqual,
zr as lowerCaseFirst,
Hr as lpad,
O as mapArray,
Mr as mapChars,
$e as mapRegExp,
pe as memoize,
Ve as mergeObjects,
qe as nearEqualAngles,
Pe as nearEquals,
Te as nearZero,
ke as objectEntries,
Ke as objectFromEntries,
Qe as objectKeys,
Ze as objectValues,
de as parseJSON,
Rr as quote,
Jr as randomString,
Vr as randomStringSequence,
kr as randomStringSequenceBase64,
I as rankArray,
F as removeAllFromArray,
W as removeAllFromArrayByPredicate,
Ge as removeObjectFields,
j as removeOneFromArray,
q as removeOneFromArrayByPredicate,
Kr as repeatString,
Qr as replaceAll,
Zr as reverseString,
Le as root,
Ne as roundTo,
Gr as rpad,
Ue as sameObjectKeys,
Be as sign,
Ye as sleep,
Ur as smartQuote,
P as sortArray,
Xr as splitStringOnFirst,
Yr as splitStringOnLast,
_r as splitStringOnce,
ne as strictEqual,
$r as stringContains,
et as stringEndsWith,
rt as stringEndsWithAny,
tt as stringHasContent,
it as stringHashCode,
st as stringStartsWith,
at as stringStartsWithAny,
nt as stringToCharcodes,
ot as stringToChars,
lt as stringsDifferAtIndex,
mt as substringAfter,
pt as substringAfterLast,
ct as substringBefore,
yt as substringBeforeLast,
gt as surroundString,
At as textContainsCaseInsensitive,
dt as textEndsWithAnyCaseInsensitive,
ft as textEndsWithCaseInsensitive,
ut as textStartsWithAnyCaseInsensitive,
bt as textStartsWithCaseInsensitive,
St as textToLines,
Tt as throttle,
we as toHex,
Ct as trimChars,
xt as trimCharsLeft,
ht as trimCharsRight,
vt as trimStringSlice,
Et as underscore,
T as uniqueByPrimitive,
L as uniquePrimitives,
Ot as upperCaseFirst,
De as widestAngleDifference,
ze as wrap,
He as wrapCircular,
It as wrapColumns,
Ft as wrapLine
};