@metarhia/common
Advanced tools
Changelog
[2.2.2][] - 2023-07-17
Changelog
[2.2.1][] - 2023-05-10
Iterator.indices()
to simplify iterating over indices of an array.Iterator.last()
to return last value of this iterator or provided
defaultValue
.Iterator.firstNonNullable()
to find first non-nullable value or
provided defaultValue
.common.shuffle()
having non-uniform distribution.Changelog
[2.2.0][] - 2020-07-10
MemoryWritable
stream.common.mkdirpPromise()
function.Iterator#apply()
and Iterator#chainApply()
to improve iterator
interaction with chained calls.captureMaxStack()
utility to get maximum available stack trace.sample(array)
.Iterator#min()
, Iterator#max()
, and Iterator#findCompare()
to
simplify consumption of iterator in common use-cases
(finding minimum, maximum, or using a custom condition appropriately).Iterator#partition()
to allow splitting iterator values into
multiple arrays.Iterator.zip()
- static method for zipping iterators.Iterator#groupBy()
to group iterator value into Map by
specific keys.cryptoPrefetcher()
to throw when bufSize
is not a multiple of
valueSize
.MemoryWritable
internal buffer size is now limited to 8 MB by default.callerFilepath()
to allow passing RegExp
as depth to be used
for filtering of stack frames.cryptoPrefetcher()
now implements the Iterable interface.common.subst()
behavior for @.value@ variables.common.callerFilepath()
working incorrectly on paths with colon in them.Changelog
[2.1.0][] - 2019-06-18
rmRecursive()
and rmRecursivePromise()
functions.Iterator#filterMap()
to enable more efficient filter+map. It will only
return values from mapper function that do not match the passed
filterValue (undefined
by default).Iterator#skipWhile()
to enable skipping elements while predicate holds.MemoryWritable
stream implementation.@metarhia/doc
(changelog).Changelog
[2.0.0][] - 2019-04-26
Iterator#collectWith()
now returns the provided object.Iterator#toObject()
to collect iterable into an Object similar to
Object.fromEntries()
.common.iterEntries()
, common.iterKeys()
, common.iterValues()
utility
methods.AuthenticationStrength
's compliance
number property instead of
strength
string.Cache
and
EnhancedEmitter
.merger()
in mergeObjects()
to also contain the merging key.inherits()
method (in favor of util.inherits()
available in
Node.js).common.ip2int()
- replace with common.ipToInt()
common.cb()
- replace with common.once()
common.extractCallback()
- replace with common.unsafeCallback()
common.cbUnsafe()
- replace with common.unsafeCallback()
common.cbExtract()
- replace with common.safeCallback()
common.crcSID()
- replace with common.crcToken()
common.generateSID()
- replace with common.generateToken()
common.validateSID()
- replace with common.validateToken()
util.deprecate()
available in Node.js:
common.deprecate()
common.alias()
common.clone()
, common.deleteByPath()
, and
common.mergeObjects()
throwing when used on objects without prototype.Changelog
[1.5.0][] - 2019-04-12
Symbol.toStringTag
property to Iterator
.Changelog
[1.4.1][] - 2019-03-27
metasync
package.Changelog
[1.4.0][] - 2019-03-27
rmdir
implementation rmdirp()
.Iterator#includes()
working incorrectly for non-number values.