@ezez/utils
Advanced tools
Changelog
[4.1.0] - 2024-05-31
sample
adds undefined
to the result type unless the input is a tuplemerge
return type was a basic intersection, which is not a correct way to represent mergingwaitFor
will reject but call the callback indefinitely if timeout is set without maxRetries
memoize
methodu
flag, which could positively affect these functions: escapeRegExp, formatDate and isNumericStringChangelog
[4.0.0] - 2024-05-16
replaceDeep
will not mutate anything by default anymore — previously it was wrongly documented as always mutating,
but it was not mutating objects. Mutating behavior can now be enabled and additionally controlled by defining if
instances properties are allowed to be mutated.serialize
] to avoid excessive calls to serializer functions - they are now only called with non-plain objects or
unknown data types, this breaks some rare use casesserialize
custom serializers now allow things like Date
(that defines .toJSON) to be supported as the user would
expectreplaceDeepByFn
method for more granular control over replacing values. replaceDeep
is a simplified wrapper over
the new functiontrim
, trimStart
, and trimEnd
methodsChangelog
[3.0.0] - 2024-03-25
waitFor
method was upgraded:
undefined
, null
or false
is givenmaxTries
option is added to have a limit of tries unrelated to timetoggle
methodsample
methodsamples
methodshuffle
methodwaitFor
unit testsChangelog
[2.0.0] - 2023-10-09
bigint
usage, if you are not using serialize
or deserialize
you can still
transpile this lib yourselfserialize
methoddeserialize
methodreplaceDeep
methodChangelog
[1.8.1] - 2023-06-24
replace
method replacing everything with bunch of undefined
when empty map is given