{"id":19873995,"url":"https://github.com/metarhia/common","last_synced_at":"2025-05-07T17:50:18.395Z","repository":{"id":18354564,"uuid":"83913120","full_name":"metarhia/common","owner":"metarhia","description":"Metarhia Common Library 🗜️","archived":false,"fork":false,"pushed_at":"2023-10-19T11:09:49.000Z","size":1515,"stargazers_count":62,"open_issues_count":28,"forks_count":33,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-31T12:39:02.373Z","etag":null,"topics":["array","callback","cluster","common","curry","date","eventemitter","functional-programming","globalstorage","impress","javascript","js","jstp","metarhia","node","nodejs","server","strings","tools","utilities"],"latest_commit_sha":null,"homepage":"https://metarhia.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metarhia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"tshemsedinov"}},"created_at":"2017-03-04T17:54:15.000Z","updated_at":"2025-02-14T10:39:29.000Z","dependencies_parsed_at":"2024-06-18T16:45:03.683Z","dependency_job_id":"93dda2bc-f2e8-4485-bc3e-593de1cd55dc","html_url":"https://github.com/metarhia/common","commit_stats":{"total_commits":292,"total_committers":13,"mean_commits":22.46153846153846,"dds":0.6061643835616438,"last_synced_commit":"f8ba4d3e5d8d85c3406d99099b187c5bd93ada37"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fcommon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fcommon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fcommon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metarhia%2Fcommon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metarhia","download_url":"https://codeload.github.com/metarhia/common/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931391,"owners_count":21827104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","callback","cluster","common","curry","date","eventemitter","functional-programming","globalstorage","impress","javascript","js","jstp","metarhia","node","nodejs","server","strings","tools","utilities"],"created_at":"2024-11-12T16:21:01.466Z","updated_at":"2025-05-07T17:50:18.375Z","avatar_url":"https://github.com/metarhia.png","language":"JavaScript","readme":"# Metarhia Common Library\n\n[![ci status](https://github.com/metarhia/common/workflows/Testing%20CI/badge.svg)](https://github.com/metarhia/common/actions?query=workflow%3A%22Testing+CI%22+branch%3Amaster)\n[![snyk](https://snyk.io/test/github/metarhia/common/badge.svg)](https://snyk.io/test/github/metarhia/common)\n[![npm version](https://badge.fury.io/js/%40metarhia%2Fcommon.svg)](https://badge.fury.io/js/%40metarhia%2Fcommon)\n[![npm downloads/month](https://img.shields.io/npm/dm/@metarhia/common.svg)](https://www.npmjs.com/package/@metarhia/common)\n[![npm downloads](https://img.shields.io/npm/dt/@metarhia/common.svg)](https://www.npmjs.com/package/@metarhia/common)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/metarhia/common/blob/master/LICENSE)\n\n## Installation\n\n```bash\n$ npm install @metarhia/common\n```\n\n## API\n\n- [splitAt](#splitatindex-array)\n- [shuffle](#shufflearr)\n- [sample](#samplearr)\n- [range](#rangefrom-to)\n- [sequence](#sequenceseq-max)\n- [last](#lastarr)\n- [pushSame](#pushsamearr-n-value)\n- [checkLogin](#checkloginlogin-required-optional)\n- [checkPassword](#checkpasswordpassword-required-optional)\n- [checkLoginPassword](#checkloginpasswordlogin-password-required-optional)\n- [BTree](#class-btree)\n  - [BTree.prototype.constructor](#btreeprototypeconstructordegree--default_degree)\n  - [BTree.prototype.get](#btreeprototypegetkey)\n  - [BTree.prototype.iterator](#btreeprototypeiteratorstart-finish)\n  - [BTree.prototype.remove](#btreeprototyperemovekey)\n  - [BTree.prototype.set](#btreeprototypesetkey-data)\n- [cache](#cache)\n- [Cache](#class-cache-extends-map)\n  - [Cache.prototype.constructor](#cacheprototypeconstructor)\n  - [Cache.prototype.add](#cacheprototypeaddkey-val)\n  - [Cache.prototype.clr](#cacheprototypeclrprefix-fn)\n  - [Cache.prototype.del](#cacheprototypedelkey)\n- [falseness](#falseness)\n- [trueness](#trueness)\n- [emptiness](#emptiness)\n- [nop](#nopcallback)\n- [noop](#noopempty-callback)\n- [once](#oncefn)\n- [unsafeCallback](#unsafecallbackargs)\n- [safeCallback](#safecallbackargs)\n- [requiredCallback](#requiredcallbackargs)\n- [onceCallback](#oncecallbackargs)\n- [safeFunction](#safefunctionfn)\n- [unsafeFunction](#unsafefunctionfn)\n- [id](#idx)\n- [asyncId](#asyncidx-callback)\n- [isScalar](#isscalarvalue)\n- [copy](#copyds)\n- [clone](#cloneobj)\n- [duplicate](#duplicateobj)\n- [getByPath](#getbypathdata-datapath)\n- [setByPath](#setbypathdata-datapath-value)\n- [deleteByPath](#deletebypathdata-datapath)\n- [merge](#mergeargs)\n- [mergeObjects](#mergeobjectsmerger-objs)\n- [Enum](#class-enum)\n  - [Enum.from](#enumfromargs)\n  - [Enum.prototype.constructor](#enumprototypeconstructor)\n- [forwardEvents](#forwardeventsfrom-to-events)\n- [emitter](#emitter)\n- [EnhancedEmitter](#class-enhancedemitter-extends-eventemitter)\n  - [EnhancedEmitter.prototype.constructor](#enhancedemitterprototypeconstructor)\n  - [EnhancedEmitter.prototype.emit](#enhancedemitterprototypeemitargs)\n  - [EnhancedEmitter.prototype.forward](#enhancedemitterprototypeforwardto-events)\n- [Flags](#class-flags)\n  - [Flags.from](#flagsfromargs)\n  - [Flags.prototype.constructor](#flagsprototypeconstructorargs)\n- [partial](#partialfn-args)\n- [omap](#omapmapfn-obj)\n- [compose](#composefns)\n- [maybe](#maybefn-defval-value)\n- [zip](#ziparrays)\n- [replicate](#replicatecount-elem)\n- [zipWith](#zipwithfn-arrays)\n- [curryUntil](#curryuntilcondition-fn-args)\n- [curryN](#currynfn-count-args)\n- [curryTwice](#currytwicefn)\n- [curry](#curryfn-param)\n- [applyArgs](#applyargsargs)\n- [either](#eitherfn)\n- [restLeft](#restleftfn)\n- [mkdirp](#mkdirpdir-mode-cb)\n- [mkdirpPromise](#mkdirppromisedir-mode--mkdirp_default_mode)\n- [rmdirp](#rmdirpdir-cb)\n- [rmRecursive](#rmrecursivepath-callback)\n- [rmRecursivePromise](#async-rmrecursivepromisepath)\n- [generateKey](#generatekeylength-possible)\n- [generateGUID](#generateguid)\n- [generateToken](#generatetokensecret-characters-length)\n- [crcToken](#crctokensecret-key)\n- [validateToken](#validatetokensecret-token)\n- [hash](#hashpassword-salt)\n- [validateHash](#validatehashhashvalue-password-salt)\n- [generateStorageKey](#generatestoragekey)\n- [idToChunks](#idtochunksid)\n- [idToPath](#idtopathid)\n- [pathToId](#pathtoidpath)\n- [Int64](#class-int64)\n  - [Int64.add](#int64adda-b)\n  - [Int64.and](#int64anda-b)\n  - [Int64.cmp](#int64cmpa-b)\n  - [Int64.div](#int64diva-b)\n  - [Int64.mod](#int64moda-b)\n  - [Int64.mult](#int64multa-b)\n  - [Int64.not](#int64nota)\n  - [Int64.one](#int64one)\n  - [Int64.or](#int64ora-b)\n  - [Int64.shiftLeft](#int64shiftlefta-b)\n  - [Int64.shiftRight](#int64shiftrighta-b)\n  - [Int64.sub](#int64suba-b)\n  - [Int64.xor](#int64xora-b)\n  - [Int64.zero](#int64zero)\n  - [Int64.prototype.constructor](#int64prototypeconstructorvalue)\n  - [Int64.prototype.add](#int64prototypeaddb)\n  - [Int64.prototype.and](#int64prototypeandb)\n  - [Int64.prototype.dec](#int64prototypedec)\n  - [Int64.prototype.inc](#int64prototypeinc)\n  - [Int64.prototype.not](#int64prototypenot)\n  - [Int64.prototype.or](#int64prototypeorb)\n  - [Int64.prototype.shiftLeft](#int64prototypeshiftleftb)\n  - [Int64.prototype.shiftRight](#int64prototypeshiftrightb)\n  - [Int64.prototype.shiftRightArithmetic](#int64prototypeshiftrightarithmeticb)\n  - [Int64.prototype.shiftRightLogical](#int64prototypeshiftrightlogicalb)\n  - [Int64.prototype.sub](#int64prototypesubb)\n  - [Int64.prototype.toInt32](#int64prototypetoint32)\n  - [Int64.prototype.toJSON](#int64prototypetojson)\n  - [Int64.prototype.toPostgres](#int64prototypetopostgres)\n  - [Int64.prototype.toString](#int64prototypetostringradix--10)\n  - [Int64.prototype.toUint32](#int64prototypetouint32)\n  - [Int64.prototype.xor](#int64prototypexorb)\n- [Iterator](#class-iterator)\n  - [Iterator.indices](#iteratorindicesarr)\n  - [Iterator.range](#iteratorrangestart-stop-step)\n  - [Iterator.zip](#iteratorzipiterators)\n  - [Iterator.prototype.constructor](#iteratorprototypeconstructorbase)\n  - [Iterator.prototype.apply](#iteratorprototypeapplyfn)\n  - [Iterator.prototype.chain](#iteratorprototypechainiterators)\n  - [Iterator.prototype.chainApply](#iteratorprototypechainapplyfn)\n  - [Iterator.prototype.collectTo](#iteratorprototypecollecttocollectionclass)\n  - [Iterator.prototype.collectWith](#iteratorprototypecollectwithobj-collector)\n  - [Iterator.prototype.count](#iteratorprototypecount)\n  - [Iterator.prototype.each](#iteratorprototypeeachfn-thisarg)\n  - [Iterator.prototype.enumerate](#iteratorprototypeenumerate)\n  - [Iterator.prototype.every](#iteratorprototypeeverypredicate-thisarg)\n  - [Iterator.prototype.filter](#iteratorprototypefilterpredicate-thisarg)\n  - [Iterator.prototype.filterMap](#iteratorprototypefiltermapmapper-thisarg-filtervalue)\n  - [Iterator.prototype.find](#iteratorprototypefindpredicate-thisarg)\n  - [Iterator.prototype.findCompare](#iteratorprototypefindcomparecomparator-accessor-thisarg)\n  - [Iterator.prototype.firstNonNullable](#iteratorprototypefirstnonnullabledefaultvalue)\n  - [Iterator.prototype.flat](#iteratorprototypeflatdepth--1)\n  - [Iterator.prototype.flatMap](#iteratorprototypeflatmapmapper-thisarg)\n  - [Iterator.prototype.forEach](#iteratorprototypeforeachfn-thisarg)\n  - [Iterator.prototype.groupBy](#iteratorprototypegroupbyclassifier-thisarg)\n  - [Iterator.prototype.includes](#iteratorprototypeincludeselement)\n  - [Iterator.prototype.join](#iteratorprototypejoinsep----prefix---suffix--)\n  - [Iterator.prototype.last](#iteratorprototypelastdefaultvalue)\n  - [Iterator.prototype.map](#iteratorprototypemapmapper-thisarg)\n  - [Iterator.prototype.max](#iteratorprototypemaxaccessor-thisarg)\n  - [Iterator.prototype.min](#iteratorprototypeminaccessor-thisarg)\n  - [Iterator.prototype.next](#iteratorprototypenext)\n  - [Iterator.prototype.partition](#iteratorprototypepartitionpredicate-thisarg)\n  - [Iterator.prototype.reduce](#iteratorprototypereducereducer-initialvalue)\n  - [Iterator.prototype.skip](#iteratorprototypeskipamount)\n  - [Iterator.prototype.skipWhile](#iteratorprototypeskipwhilepredicate-thisarg)\n  - [Iterator.prototype.some](#iteratorprototypesomepredicate-thisarg)\n  - [Iterator.prototype.someCount](#iteratorprototypesomecountpredicate-count-thisarg)\n  - [Iterator.prototype.take](#iteratorprototypetakeamount)\n  - [Iterator.prototype.takeWhile](#iteratorprototypetakewhilepredicate-thisarg)\n  - [Iterator.prototype.toArray](#iteratorprototypetoarray)\n  - [Iterator.prototype.toObject](#iteratorprototypetoobject)\n  - [Iterator.prototype.zip](#iteratorprototypezipiterators)\n- [iter](#iterbase)\n- [iterEntries](#iterentriesobj)\n- [iterKeys](#iterkeysobj)\n- [iterValues](#itervaluesobj)\n- [cryptoPrefetcher](#cryptoprefetcherbufsize-valuesize)\n- [random](#randommin-max)\n- [cryptoRandom](#cryptorandom)\n- [methods](#methodsiface)\n- [properties](#propertiesiface)\n- [ipToInt](#iptointip)\n- [localIPs](#localips)\n- [parseHost](#parsehosthost)\n- [override](#overrideobj-fn)\n- [mixin](#mixintarget-source)\n- [Pool](#class-pool)\n  - [Pool.prototype.constructor](#poolprototypeconstructorfactory--null)\n  - [Pool.prototype.get](#poolprototypeget)\n  - [Pool.prototype.put](#poolprototypeputvalue)\n- [sortComparePriority](#sortcompareprioritypriority-s1-s2)\n- [sortCompareDirectories](#sortcomparedirectoriesa-b)\n- [sortCompareByName](#sortcomparebynamea-b)\n- [MemoryWritable](#class-memorywritable-extends-writable)\n  - [MemoryWritable.prototype.constructor](#memorywritableprototypeconstructorsizelimit)\n  - [MemoryWritable.prototype.getData](#async-memorywritableprototypegetdataencoding)\n- [subst](#substtpl-data-datapath-escapehtml)\n- [htmlEscape](#htmlescapecontent)\n- [fileExt](#fileextfilename)\n- [removeExt](#removeextfilename)\n- [spinalToCamel](#spinaltocamelname)\n- [escapeRegExp](#escaperegexps)\n- [newEscapedRegExp](#newescapedregexps)\n- [addTrailingSlash](#addtrailingslashs)\n- [stripTrailingSlash](#striptrailingslashs)\n- [dirname](#dirnamefilepath)\n- [capitalize](#capitalizes)\n- [between](#betweens-prefix-suffix)\n- [removeBOM](#removeboms)\n- [arrayRegExp](#arrayregexpitems)\n- [section](#sections-separator)\n- [rsection](#rsections-separator)\n- [split](#splits-separator-limit)\n- [rsplit](#rsplits-separator-limit)\n- [normalizeEmail](#normalizeemailemail)\n- [isTimeEqual](#istimeequaltime1-time2)\n- [nowDate](#nowdatedate)\n- [nowDateTime](#nowdatetimedate)\n- [Uint64](#class-uint64)\n  - [Uint64.add](#uint64adda-b)\n  - [Uint64.and](#uint64anda-b)\n  - [Uint64.cmp](#uint64cmpa-b)\n  - [Uint64.div](#uint64diva-b)\n  - [Uint64.mod](#uint64moda-b)\n  - [Uint64.mult](#uint64multa-b)\n  - [Uint64.not](#uint64nota)\n  - [Uint64.or](#uint64ora-b)\n  - [Uint64.shiftLeft](#uint64shiftlefta-b)\n  - [Uint64.shiftRight](#uint64shiftrighta-b)\n  - [Uint64.sub](#uint64suba-b)\n  - [Uint64.xor](#uint64xora-b)\n  - [Uint64.prototype.constructor](#uint64prototypeconstructorvalue)\n  - [Uint64.prototype.add](#uint64prototypeaddb)\n  - [Uint64.prototype.and](#uint64prototypeandb)\n  - [Uint64.prototype.dec](#uint64prototypedec)\n  - [Uint64.prototype.inc](#uint64prototypeinc)\n  - [Uint64.prototype.not](#uint64prototypenot)\n  - [Uint64.prototype.or](#uint64prototypeorb)\n  - [Uint64.prototype.shiftLeft](#uint64prototypeshiftleftb)\n  - [Uint64.prototype.shiftRight](#uint64prototypeshiftrightb)\n  - [Uint64.prototype.sub](#uint64prototypesubb)\n  - [Uint64.prototype.toJSON](#uint64prototypetojson)\n  - [Uint64.prototype.toPostgres](#uint64prototypetopostgres)\n  - [Uint64.prototype.toString](#uint64prototypetostringradix--10)\n  - [Uint64.prototype.toUint32](#uint64prototypetouint32)\n  - [Uint64.prototype.xor](#uint64prototypexorb)\n- [duration](#durations)\n- [durationToString](#durationtostringn)\n- [bytesToSize](#bytestosizebytes)\n- [sizeToBytes](#sizetobytessize)\n- [safe](#safefn)\n- [captureMaxStack](#capturemaxstack)\n- [callerFilename](#callerfilenamedepth--0-stack--null)\n- [callerFilepath](#callerfilepathdepth--0-stack--null)\n\n### splitAt(index, array)\n\n- `index`: [`\u003cnumber\u003e`][number] index defining end of first part and start of\n  second\n- `array`: [`\u003cArray\u003e`][array] to be split\n\n_Returns:_ [`\u003cArray\u003e`][array] tuple with two parts of the array\n\nSplit array into two parts\n\n### shuffle(arr)\n\n- `arr`: [`\u003cArray\u003e`][array]\n\n_Returns:_ [`\u003cArray\u003e`][array]\n\nShuffle an array\n\n### sample(arr)\n\n- `arr`: [`\u003cArray\u003e`][array]\n\n_Returns:_ `\u003cany\u003e`\n\nRandom element from array\n\n### range(from, to)\n\n- `from`: [`\u003cnumber\u003e`][number] range start\n- `to`: [`\u003cnumber\u003e`][number] range end\n\n_Returns:_ [`\u003cArray\u003e`][array]\n\nGenerate int array from given range\n\n_Example:_\n\n```js\nrange(1, 5);\n```\n\n_Result:_\n\n```js\n[1, 2, 3, 4, 5];\n```\n\n### sequence(seq\\[, max\\])\n\n- `seq`: [`\u003cArray\u003e`][array]\n- `max`: [`\u003cnumber\u003e`][number] (optional), max\n\n_Returns:_ [`\u003cArray\u003e`][array]\n\nGenerate int array from sequence syntax\n\n_Example:_\n\n```js\nlist: sequence([81, 82, 83]);\n```\n\n_Result:_\n\n```js\n[81, 82, 83];\n```\n\n_Example:_\n\n```js\nrange from..to: sequence([81,,83]) = [81, 82, 83];\n```\n\n_Result:_\n\n```js\n[81, 82, 83];\n```\n\n_Example:_\n\n```js\nrange from..count: sequence([81, [3]]) = [81, 82, 83];\n```\n\n_Result:_\n\n```js\n[81, 82, 83];\n```\n\n_Example:_\n\n```js\nrange from..max-to: sequence([81, [-2]], 5) = [81, 82, 83];\n```\n\n_Result:_\n\n```js\n[81, 82, 83];\n```\n\n### last(arr)\n\n- `arr`: [`\u003cArray\u003e`][array]\n\n_Returns:_ `\u003cany\u003e` element\n\nGet last element of array\n\n### pushSame(arr, n, value)\n\n- `arr`: [`\u003cArray\u003e`][array]\n- `n`: [`\u003cnumber\u003e`][number]\n- `value`: `\u003cany\u003e`\n\n_Returns:_ [`\u003cnumber\u003e`][number] new value of arr.length\n\nPush single value multiple times\n\n### checkLogin(login, required\\[, optional\\])\n\n- `login`: [`\u003cstring\u003e`][string] login to test\n- `required`: [`\u003cArray\u003e`][array] required tests configs\n- `optional`: [`\u003cArray\u003e`][array] optional tests configs, defalult: `[]`\n\n_Returns:_ `\u003cAuthenticationStrength\u003e`\n\nFunction that tests the login\n\n### checkPassword(password, required\\[, optional\\])\n\n- `password`: [`\u003cstring\u003e`][string] password to test\n- `required`: [`\u003cArray\u003e`][array] required tests configs\n- `optional`: [`\u003cArray\u003e`][array] optional tests configs, default: `[]`\n\n_Returns:_ `\u003cAuthenticationStrength\u003e`\n\nFunction that tests the password\n\n### checkLoginPassword(login, password, required\\[, optional\\])\n\n- `login`: [`\u003cstring\u003e`][string] login to test\n- `password`: [`\u003cstring\u003e`][string] password to test\n- `required`: [`\u003cArray\u003e`][array] required tests configs\n- `optional`: [`\u003cArray\u003e`][array] optional tests configs, default: `[]`\n\n_Returns:_ `\u003cAuthenticationStrength\u003e`\n\nFunction that tests the login with password\n\n### class BTree\n\n#### BTree.prototype.constructor(degree = DEFAULT\\_DEGREE)\n\n#### BTree.prototype.get(key)\n\n#### BTree.prototype.iterator(start, finish)\n\n#### BTree.prototype.remove(key)\n\n#### BTree.prototype.set(key, data)\n\n### cache()\n\n_Returns:_ `\u003cCache\u003e`\n\nCreate Cache, enhanced Map\n\n### class Cache extends [Map][map]\n\n#### Cache.prototype.constructor()\n\n#### Cache.prototype.add(key, val)\n\n- `key`: [`\u003cstring\u003e`][string] key\n- `val`: `\u003cany\u003e` associated value\n\nAdd key-value pair to cache\n\n#### Cache.prototype.clr(prefix\\[, fn\\])\n\n- `prefix`: [`\u003cstring\u003e`][string] to compare with beginning of the key\n- `fn`: [`\u003cFunction\u003e`][function] (optional)\n  - `key`: [`\u003cstring\u003e`][string] key\n  - `val`: `\u003cany\u003e` associative value to be called on each key\n\nClear cache elements that start with prefix\n\n#### Cache.prototype.del(key)\n\n- `key`: [`\u003cstring\u003e`][string] key\n\nDelete cache element\n\n### falseness()\n\n_Returns:_ [`\u003cboolean\u003e`][boolean] always `false`\n\nEmpty function\n\n### trueness()\n\n_Returns:_ [`\u003cboolean\u003e`][boolean] always `true`\n\nEmpty function\n\n### emptiness()\n\nEmpty function\n\n### nop(callback)\n\n- `callback`: [`\u003cFunction\u003e`][function] callback to be called with (null)\n\nEmpty asynchronous callback-last single-argument function\n\n### noop(empty, callback)\n\n- `empty`: `\u003cany\u003e` incoming value to be ignored\n- `callback`: [`\u003cFunction\u003e`][function] callback to be called with (null, null)\n\nEmpty asynchronous callback-last double-argument function\n\n### once(\\[fn\\])\n\n- `fn`: [`\u003cFunction\u003e`][function] (optional)\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...args) wrapped callback\n\n- `args`: [`\u003cArray\u003e`][array]\n\nWrap function: call once, not null\n\n### unsafeCallback(args)\n\n- `args`: [`\u003cArray\u003e`][array] arguments\n\n_Returns:_ [`\u003cFunction\u003e`][function]|[`\u003cnull\u003e`][null] callback if any\n\nExtract callback function\n\nIt's unsafe: may return null, allows multiple calls\n\n### safeCallback(args)\n\n- `args`: [`\u003cArray\u003e`][array] arguments\n\n_Returns:_ [`\u003cFunction\u003e`][function] callback or common.emptiness if there is no\ncallback\n\nExtract callback\n\n### requiredCallback(args)\n\n- `args`: [`\u003cArray\u003e`][array] arguments\n\n_Returns:_ [`\u003cFunction\u003e`][function] extracted callback\n\nExtract callback\n\n_Throws:_ [`\u003cTypeError\u003e`][typeerror] if there is no callback\n\n### onceCallback(args)\n\n- `args`: [`\u003cArray\u003e`][array] arguments\n\n_Returns:_ [`\u003cFunction\u003e`][function] callback or common.emptiness if there is no\ncallback\n\nExtract callback and make it safe\n\nWrap callback with once()\n\n### safeFunction(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function]\n\n_Returns:_ [`\u003cFunction\u003e`][function] function or `common.emptiness` if fn is not\na function\n\nCheck function and make it safe\n\n### unsafeFunction(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function]\n\n_Returns:_ [`\u003cFunction\u003e`][function]|[`\u003cnull\u003e`][null] function or null if fn is\nnot a function\n\nCheck function\n\n### id(x)\n\n- `x`: `\u003cany\u003e` incoming value which will be returned\n\n_Returns:_ `\u003cany\u003e` incoming value\n\nIdentity function\n\n### asyncId(x, callback)\n\n- `x`: `\u003cany\u003e` incoming value which will be returned into the callback\n- `callback`: [`\u003cFunction\u003e`][function] callback to be called with first argument\n  - `err`: [`\u003cnull\u003e`][null]\n  - `data`: `\u003cany\u003e`\n\nAsync identity function\n\n### isScalar(value)\n\n- `value`: `\u003cany\u003e`\n\n_Returns:_ [`\u003cboolean\u003e`][boolean]\n\nCheck if value is scalar\n\n### copy(ds)\n\n- `ds`: [`\u003cObject[]\u003e`][object] source dataset to be copied\n\n_Returns:_ [`\u003cObject[]\u003e`][object]\n\nCopy dataset (copy objects to new array)\n\n### clone(obj)\n\n- `obj`: [`\u003cObject\u003e`][object]|[`\u003cArray\u003e`][array]\n\n_Returns:_ [`\u003cObject\u003e`][object]|[`\u003cArray\u003e`][array]\n\nClone object or array\n\n### duplicate(obj)\n\n- `obj`: [`\u003cObject\u003e`][object]|[`\u003cArray\u003e`][array]\n\n_Returns:_ [`\u003cObject\u003e`][object]|[`\u003cArray\u003e`][array]\n\nDuplicate object or array (properly handles prototype and circular links)\n\n### getByPath(data, dataPath)\n\n- `data`: [`\u003cObject\u003e`][object]\n- `dataPath`: [`\u003cstring\u003e`][string] dot-separated path\n\n_Returns:_ `\u003cany\u003e` value\n\nRead property by dot-separated path\n\n### setByPath(data, dataPath, value)\n\n- `data`: [`\u003cObject\u003e`][object]\n- `dataPath`: [`\u003cstring\u003e`][string] dot-separated path\n- `value`: `\u003cany\u003e` new value\n\nSet property by dot-separated path\n\n### deleteByPath(data, dataPath)\n\n- `data`: [`\u003cObject\u003e`][object]\n- `dataPath`: [`\u003cstring\u003e`][string] dot-separated path\n\n_Returns:_ [`\u003cboolean\u003e`][boolean]\n\nDelete property by dot-separated path\n\n### merge(...args)\n\n- `args`: [`\u003cArray[]\u003e`][array] arrays with elements to be merged\n\n_Returns:_ [`\u003cArray\u003e`][array]\n\nDistinctly merge multiple arrays\n\n### mergeObjects(merger, ...objs)\n\n- `merger`: [`\u003cFunction\u003e`][function]\n  - `key`: [`\u003cstring\u003e`][string] current merging key\n  - `...values`: `\u003cany[]\u003e` values under key\n- `objs`: [`\u003cObject[]\u003e`][object] objects to be merged\n\n_Returns:_ [`\u003cObject\u003e`][object]\n\nMerge multiple objects with merger\n\n### class Enum\n\n#### Enum.NaE\n\n- `\u003cSymbol\u003e` Not an Enum\n\n#### Enum.from(...args)\n\n#### Enum.prototype.constructor()\n\n### forwardEvents(from, to\\[, events\\])\n\n- `from`: [`\u003cEventEmitter\u003e`][eventemitter] to listen for event\n- `to`: [`\u003cEventEmitter\u003e`][eventemitter] to emit event on\n- `events`: [`\u003cstring\u003e`][string]|[`\u003cObject\u003e`][object]|[`\u003cstring[]\u003e`][string]\n  (optional), events names\n\nForward events from one EventEmitter to another\n\n_Example:_\n\n```js\nforwardEvents(from, to);\n```\n\n_Example:_\n\n```js\nforwardEvents(from, to, 'eventName');\n```\n\n_Example:_\n\n```js\nforwardEvents(from, to, { eventName: 'newEventName' });\n```\n\n_Example:_\n\n```js\nforwardEvents(from, to, ['eventName1', 'eventName2']);\n```\n\n### emitter()\n\n_Returns:_ [`\u003cEventEmitter\u003e`][eventemitter]\n\nCreate EnhancedEmitter, enhanced EventEmitter\n\nwith wildcard and forward method\n\n### class EnhancedEmitter extends [EventEmitter][eventemitter]\n\n#### EnhancedEmitter.prototype.constructor()\n\n#### EnhancedEmitter.prototype.emit(...args)\n\n- `args`: [`\u003cArray\u003e`][array] arguments to be passed\n\nCall listener with provided arguments\n\n#### EnhancedEmitter.prototype.forward(to, events)\n\n- `to`: [`\u003cEventEmitter\u003e`][eventemitter] to emit event on\n- `events`: [`\u003cstring\u003e`][string]|[`\u003cObject\u003e`][object]|[`\u003cstring[]\u003e`][string]\n  events names\n\nForward events from one EventEmitter to another\n\n### class Flags\n\n#### Flags.from(...args)\n\n#### Flags.prototype.constructor(...args)\n\n### partial(fn, ...args)\n\n- `fn`: [`\u003cFunction\u003e`][function]\n- `args`: [`\u003cArray\u003e`][array] arguments to be applied\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...rest)\n\n- `rest`: [`\u003cArray\u003e`][array] arguments\n\nPartially apply arguments to function\n\n### omap(mapFn, obj)\n\n- `mapFn`: [`\u003cFunction\u003e`][function] to apply to every field value\n- `obj`: [`\u003cObject\u003e`][object] which fields used for mapping\n\n_Returns:_ [`\u003cObject\u003e`][object] with same reference but with transformed fields\n\nMap object fields with provided function\n\n### compose(...fns)\n\n- `fns`: [`\u003cArray\u003e`][array] functions to be composed\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...args), composed\n\n- `args`: [`\u003cArray\u003e`][array] arguments to be passed to the first function\n\nCompose multiple functions into one\n\n### maybe(fn, defVal\\[, value\\])\n\n- `fn`: [`\u003cFunction\u003e`][function]\n- `defVal`: `\u003cany\u003e` default value\n- `value`: `\u003cany\u003e` (optional), value\n\n_Returns:_ `\u003cany\u003e` result of `fn` or `defVal`\n\nApply given function to value or default value\n\n### zip(...arrays)\n\n- `arrays`: [`\u003cArray[]\u003e`][array] arrays to be zipped\n\n_Returns:_ [`\u003cArray\u003e`][array] length is minimal of input arrays length, element\nwith index i of resulting array is array with elements with index i from input\narray\n\nZip several arrays into one\n\n### replicate(count, elem)\n\n- `count`: [`\u003cnumber\u003e`][number] new array length\n- `elem`: `\u003cany\u003e` value to replicate\n\n_Returns:_ [`\u003cArray\u003e`][array] replicated\n\nCreate array of replicated values\n\n### zipWith(fn, ...arrays)\n\n- `fn`: [`\u003cFunction\u003e`][function] for zipping elements with index i\n- `arrays`: [`\u003cArray[]\u003e`][array] arrays to be zipped\n\n_Returns:_ [`\u003cArray\u003e`][array] zipped, element with index i of resulting array is\nresult of fn called with arguments from arrays\n\nZip arrays using specific function\n\n### curryUntil(condition, fn, ...args)\n\n- `condition`: [`\u003cFunction\u003e`][function] returns: [`\u003cboolean\u003e`][boolean]\n  - `argsI`: [`\u003cArray\u003e`][array] arguments for i-th currying\n  - `argsParts`: [`\u003cArray\u003e`][array] of args given for currying from first to\n    i-th currying\n- `fn`: [`\u003cFunction\u003e`][function] to be curried\n- `args`: [`\u003cArray\u003e`][array] arguments for fn\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...args), curried\n\n- `args`: [`\u003cArray\u003e`][array] arguments\n\nCurry function until the condition is met\n\n### curryN(fn, count, ...args)\n\n- `fn`: [`\u003cFunction\u003e`][function] to be curried\n- `count`: [`\u003cnumber\u003e`][number] of times function should be curried\n- `args`: [`\u003cArray\u003e`][array] arguments for first currying\n\n_Returns:_ [`\u003cFunction\u003e`][function] curried given times count\n\nCurry fn count times, first curry uses args for first currying\n\n### curryTwice(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function] to be curried\n\n_Returns:_ [`\u003cFunction\u003e`][function] to pass arguments that returns curried fn\n\nCurry function curry with fn\n\n### curry(fn, ...param)\n\n- `fn`: [`\u003cFunction\u003e`][function] to be curried\n- `param`: [`\u003cArray\u003e`][array] arguments to the function\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...args), curried\n\nCurry function with given arguments\n\n### applyArgs(...args)\n\n- `args`: [`\u003cArray\u003e`][array] arguments to save in closure\n\n_Returns:_ [`\u003cFunction\u003e`][function] returns: `\u003cany\u003e`, result of `fn(...args)`\n\n- `fn`: [`\u003cFunction\u003e`][function] to be applied saved arguments\n\nApply arguments\n\n### either(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function] to be called\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...args), returns: `\u003cany\u003e`, result\nof `fn(arg)`, where `arg` - first valid element of `args`\n\n- `args`: [`\u003cArray\u003e`][array] arguments to iterate\n\nGet first not errored result of fn\n\n_Throws:_ [`\u003cError\u003e`][error] if `fn` throws it\n\n### restLeft(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function] function(args, ...namedArgs, callback)\n  - `args`: [`\u003cArray\u003e`][array] rest of spreadArgs created by excluding namedArgs\n  - `namedArgs`: [`\u003cArray\u003e`][array] first values of spreadArgs, length is based\n    upon interface of fn\n  - `callback`: [`\u003cFunction\u003e`][function] callback, last argument of spreadArgs\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...spreadArgs)\n\n- `spreadArgs`: [`\u003cArray\u003e`][array] arguments to be added\n\nRest left, transform function\n\n### mkdirp(dir, mode, cb)\n\n### mkdirpPromise(dir, mode = MKDIRP\\_DEFAULT\\_MODE)\n\n### rmdirp(dir, cb)\n\n### rmRecursive(path, callback)\n\n- `path`: [`\u003cstring\u003e`][string] path to a file or directory to be removed\n- `callback`: [`\u003cFunction\u003e`][function] callback\n\nRecursively remove directory\n\n### async rmRecursivePromise(path)\n\n- `path`: [`\u003cstring\u003e`][string] path to a file or directory to be removed\n\n_Returns:_ [`\u003cPromise\u003e`][promise]\n\nRecursively remove directory\n\n### generateKey(length, possible)\n\n- `length`: [`\u003cnumber\u003e`][number] key length\n- `possible`: [`\u003cstring\u003e`][string] with possible characters\n\n_Returns:_ [`\u003cstring\u003e`][string] key\n\nGenerate random key\n\n### generateGUID()\n\n_Returns:_ [`\u003cstring\u003e`][string] GUID\n\nGenerate an RFC4122-compliant GUID (UUID v4)\n\n### generateToken(secret, characters, length)\n\n- `secret`: [`\u003cstring\u003e`][string]\n- `characters`: [`\u003cstring\u003e`][string]\n- `length`: [`\u003cnumber\u003e`][number]\n\n_Returns:_ [`\u003cstring\u003e`][string] token\n\nGenerate random Token\n\n### crcToken(secret, key)\n\n- `secret`: [`\u003cstring\u003e`][string]\n- `key`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string] crc\n\nCalculate Token crc\n\n### validateToken(secret, token)\n\n- `secret`: [`\u003cstring\u003e`][string]\n- `token`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cboolean\u003e`][boolean]\n\nValidate Token\n\n### hash(password, salt)\n\n- `password`: [`\u003cstring\u003e`][string]\n- `salt`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string] hash\n\nCalculate hash with salt\n\n### validateHash(hashValue, password, salt)\n\n- `hashValue`: [`\u003cstring\u003e`][string]\n- `password`: [`\u003cstring\u003e`][string]\n- `salt`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cboolean\u003e`][boolean]\n\nValidate hash\n\n### generateStorageKey()\n\n_Returns:_ [`\u003cstring[]\u003e`][string] [folder1, folder2, code]\n\nGenerate file storage key\n\n### idToChunks(id)\n\n- `id`: [`\u003cnumber\u003e`][number]\n\n_Returns:_ [`\u003cArray\u003e`][array] minimal length is 2 which contains hex strings\nwith length of 4\n\nConvert id to array of hex strings\n\n### idToPath(id)\n\n- `id`: [`\u003cnumber\u003e`][number]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nConvert id to file path\n\n### pathToId(path)\n\n- `path`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nConvert file path to id\n\n### class Int64\n\n#### Int64.add(a, b)\n\n#### Int64.and(a, b)\n\n#### Int64.cmp(a, b)\n\n#### Int64.div(a, b)\n\n#### Int64.mod(a, b)\n\n#### Int64.mult(a, b)\n\n#### Int64.not(a)\n\n#### Int64.one()\n\n#### Int64.or(a, b)\n\n#### Int64.shiftLeft(a, b)\n\n#### Int64.shiftRight(a, b)\n\n#### Int64.sub(a, b)\n\n#### Int64.xor(a, b)\n\n#### Int64.zero()\n\n#### Int64.prototype.constructor(value)\n\n#### Int64.prototype.add(b)\n\n#### Int64.prototype.and(b)\n\n#### Int64.prototype.dec()\n\n#### Int64.prototype.inc()\n\n#### Int64.prototype.not()\n\n#### Int64.prototype.or(b)\n\n#### Int64.prototype.shiftLeft(b)\n\n#### Int64.prototype.shiftRight(b)\n\n#### Int64.prototype.shiftRightArithmetic(b)\n\n#### Int64.prototype.shiftRightLogical(b)\n\n#### Int64.prototype.sub(b)\n\n#### Int64.prototype.toInt32()\n\n#### Int64.prototype.toJSON()\n\n#### Int64.prototype.toPostgres()\n\n#### Int64.prototype.toString(radix = 10)\n\n#### Int64.prototype.toUint32()\n\n#### Int64.prototype.xor(b)\n\n### class Iterator\n\n#### Iterator.indices(arr)\n\n- `arr`: [`\u003cArray\u003e`][array] array-like object to create indices from\n\n_Returns:_ `\u003cIterator\u003e`\n\nCreate iterator over indices of an array\n\n#### Iterator.range(start, stop\\[, step\\])\n\n- `start`: [`\u003cnumber\u003e`][number]\n- `stop`: [`\u003cnumber\u003e`][number]\n- `step`: [`\u003cnumber\u003e`][number] (optional), default: `1`\n\n_Returns:_ `\u003cIterator\u003e`\n\nCreate iterator iterating over the range\n\n#### Iterator.zip(...iterators)\n\n- `iterators`: [`\u003cArray\u003e`][array]\n\n_Returns:_ `\u003cIterator\u003e`\n\nCreate iterator by zipping multiple provided iterators into one\n\n#### Iterator.prototype.constructor(base)\n\n#### Iterator.prototype.apply(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function]\n  - `this`: `\u003cIterator\u003e`\n\n_Returns:_ the result of `fn(this)` call.\n\nCall a function with `this`. Will be equivalent to calling `fn(it)`.\n\n#### Iterator.prototype.chain(...iterators)\n\n#### Iterator.prototype.chainApply(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function]\n  - `this`: `\u003cIterator\u003e`\n\n_Returns:_ `\u003cIterator\u003e` result of `fn(this)` wrapped in an Iterator.\n\nCall a function with `this` and wrap the result in an Iterator.\n\n_Example:_\n\n```js\niter([1, 2])\n  .chainApply(([a, b]) =\u003e [a + b, a - b])\n  .join(', ');\n```\n\n_Result:_\n\n```js\n'3, -1';\n```\n\n#### Iterator.prototype.collectTo(CollectionClass)\n\n#### Iterator.prototype.collectWith(obj, collector)\n\n#### Iterator.prototype.count()\n\n#### Iterator.prototype.each(fn, thisArg)\n\n#### Iterator.prototype.enumerate()\n\n#### Iterator.prototype.every(predicate, thisArg)\n\n#### Iterator.prototype.filter(predicate, thisArg)\n\n#### Iterator.prototype.filterMap(mapper\\[, thisArg\\[, filterValue\\]\\])\n\n- `mapper`: [`\u003cFunction\u003e`][function] function that maps values and returns\n  either new value that will be the next value of the new iterator or\n  `filterValue` that will be ignored.\n  - `value`: `\u003cany\u003e` iterator element\n- `thisArg`: `\u003cany\u003e` value to be used as `this` when calling `mapper`\n- `filterValue`: `\u003cany\u003e` value to filter out `mapper` results.\n\nCreates an iterator that both filters and maps with the passed `mapper`.\n\nThis iterator will call `mapper` on each element and if mapper returns NOT\n`filterValue` it will be returned, otherwise it is ignored.\n\n#### Iterator.prototype.find(predicate, thisArg)\n\n#### Iterator.prototype.findCompare(comparator\\[, accessor\\[, thisArg\\]\\])\n\n- `comparator`: [`\u003cFunction\u003e`][function] returns `true` if new value should be\n  accepted\n  - `currValue`: `\u003cany\u003e` current value, starts with undefined\n  - `nextValue`: `\u003cany\u003e` next value\n  - _Returns:_ [`\u003cboolean\u003e`][boolean] `true` if next value should be accepted\n- `accessor`: [`\u003cFunction\u003e`][function] gets value to compare by, current\n  iterator value is used by default\n  - `value`: `\u003cany\u003e` current iterator value\n  - _Returns:_ `\u003cany\u003e` value to compare by\n- `thisArg`: `\u003cany\u003e` value to be used as `this` when calling `accessor` and\n  `comparator`\n\n_Returns:_ last iterator value where `comparator` returned `true`,\n[`\u003cundefined\u003e`][undefined] by default\n\nFind value in this iterator by comparing every value with\n\nthe found one using `comparator`\n\n#### Iterator.prototype.firstNonNullable(\\[defaultValue\\])\n\n- `defaultValue`: `\u003cany\u003e` value to return if this iterator doesn't have\n  non-nullable values\n- _Returns:_ first non-nullable value or `\u003cdefaultValue\u003e`\n\nFinds first non-nullable value in this iterator\n\n#### Iterator.prototype.flat(depth = 1)\n\n#### Iterator.prototype.flatMap(mapper, thisArg)\n\n#### Iterator.prototype.forEach(fn, thisArg)\n\n#### Iterator.prototype.groupBy(classifier\\[, thisArg\\])\n\n- `classifier`: [`\u003cFunction\u003e`][function] gets value to group by\n  - `value`: `\u003cany\u003e` current iterator value\n  - _Returns:_ `\u003cany\u003e` value to group by\n- `thisArg`: `\u003cany\u003e` value to be used as `this` when calling `classifier`\n- _Returns:_ [`\u003cMap\u003e`][map] map with arrays of iterator values grouped by keys\n  returned by `classifier`\n\nConsumes an iterator grouping values by keys\n\n#### Iterator.prototype.includes(element)\n\n#### Iterator.prototype.join(sep = ', ', prefix = '', suffix = '')\n\n#### Iterator.prototype.last(\\[defaultValue\\])\n\n- `defaultValue`: `\u003cany\u003e` value to be used if iterator is empty\n\n_Returns:_ `\u003cany\u003e`|[`\u003cundefined\u003e`][undefined] last value of this iterator or\n[`\u003cundefined\u003e`][undefined]\n\nConsumes an iterator returning last iterator value\n\n#### Iterator.prototype.map(mapper, thisArg)\n\n#### Iterator.prototype.max(\\[accessor\\[, thisArg\\]\\])\n\n- `accessor`: [`\u003cFunction\u003e`][function] gets value to compare by, current\n  iterator value is used by default\n  - `value`: `\u003cany\u003e` current iterator value\n  - _Returns:_ `\u003cany\u003e` value to compare by\n- `thisArg`: `\u003cany\u003e` value to be used as `this` when calling `accessor`\n\n_Returns:_ element with maximum value or [`\u003cundefined\u003e`][undefined] if iterator\nis empty\n\nFind the maximum value in this iterator\n\n#### Iterator.prototype.min(\\[accessor\\[, thisArg\\]\\])\n\n- `accessor`: [`\u003cFunction\u003e`][function] gets value to compare by, current\n  iterator value is used by default\n  - `value`: `\u003cany\u003e` current iterator value\n  - _Returns:_ `\u003cany\u003e` value to compare by\n- `thisArg`: `\u003cany\u003e` value to be used as `this` when calling `accessor`\n\n_Returns:_ element with minimum value or [`\u003cundefined\u003e`][undefined] if iterator\nis empty\n\nFind the minimum value in this iterator\n\n#### Iterator.prototype.next()\n\n#### Iterator.prototype.partition(predicate\\[, thisArg\\])\n\n- `predicate`: [`\u003cFunction\u003e`][function] function returns a value to partition\n  this iterator\n  - `value`: `\u003cany\u003e` current iterator element\n  - _Returns:_ [`\u003cboolean\u003e`][boolean]|[`\u003cnumber\u003e`][number] key denoting\n    resulting partition this value will be assigned to. Number denotes index in\n    the resulting array. Boolean will be cast to number\n- `thisArg`: `\u003cany\u003e` value to be used as `this` when calling `predicate`\n- _Returns:_ [`\u003cArray\u003e`][array] array of partitions (arrays), will always have\n  at least 2 arrays in it\n\nConsumes an iterator, partitioning it into Arrays\n\n#### Iterator.prototype.reduce(reducer, initialValue)\n\n#### Iterator.prototype.skip(amount)\n\n#### Iterator.prototype.skipWhile(predicate, thisArg)\n\n#### Iterator.prototype.some(predicate, thisArg)\n\n#### Iterator.prototype.someCount(predicate, count, thisArg)\n\n#### Iterator.prototype.take(amount)\n\n#### Iterator.prototype.takeWhile(predicate, thisArg)\n\n#### Iterator.prototype.toArray()\n\n#### Iterator.prototype.toObject()\n\nTransforms an iterator of key-value pairs into an object.\n\nThis is similar to what [`Object.fromEntries()`][object.fromentries()] would\noffer.\n\n#### Iterator.prototype.zip(...iterators)\n\n### iter(base)\n\n### iterEntries(obj)\n\n### iterKeys(obj)\n\n### iterValues(obj)\n\n### cryptoPrefetcher(bufSize, valueSize)\n\n- `bufSize`: [`\u003cnumber\u003e`][number] size in bytes of the buffer to preallocate\n- `valueSize`: [`\u003cnumber\u003e`][number] size in bytes of the produced chunks\n\nCreate prefetcher to use when crypto.randomBytes is required to generate\n\nmultiple same-size values. `bufSize` must be a multiple of `valueSize` for this\nto work.\n\n### random(min, max)\n\n- `min`: [`\u003cnumber\u003e`][number] range start\n- `max`: [`\u003cnumber\u003e`][number] range end\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nGenerate random integer value in given range\n\n### cryptoRandom()\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nGenerate random number in the range from 0 inclusive up to\n\nbut not including 1 (same as Math.random), using crypto-secure number generator.\n\n### methods(iface)\n\n- `iface`: [`\u003cObject\u003e`][object] to be introspected\n\n_Returns:_ [`\u003cstring[]\u003e`][string] method names\n\nList method names\n\n### properties(iface)\n\n- `iface`: [`\u003cObject\u003e`][object] to be introspected\n\n_Returns:_ [`\u003cstring[]\u003e`][string] property names\n\nList property names\n\n### ipToInt(\\[ip\\])\n\n- `ip`: [`\u003cstring\u003e`][string] (optional), default: '127.0.0.1', IP address\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nConvert IP string to number\n\n### localIPs()\n\n_Returns:_ [`\u003cstring[]\u003e`][string]\n\nGet local network interfaces\n\n### parseHost(host)\n\n- `host`: [`\u003cstring\u003e`][string] host or empty string, may contain `:port`\n\n_Returns:_ [`\u003cstring\u003e`][string] host without port but not empty\n\nParse host string\n\n### override(obj, fn)\n\n- `obj`: [`\u003cObject\u003e`][object] containing method to override\n- `fn`: [`\u003cFunction\u003e`][function] name will be used to find method\n\nOverride method: save old to `fn.inherited`\n\nPrevious function will be accessible by obj.fnName.inherited\n\n### mixin(target, source)\n\n- `target`: [`\u003cObject\u003e`][object] mixin to target\n- `source`: [`\u003cObject\u003e`][object] source methods\n\nMixin for ES6 classes without overriding existing methods\n\n### class Pool\n\n#### Pool.prototype.constructor(factory = null)\n\n#### Pool.prototype.get()\n\n#### Pool.prototype.put(value)\n\n### sortComparePriority(priority, s1, s2)\n\n- `priority`: [`\u003cstring[]\u003e`][string] with priority\n- `s1`: [`\u003cstring\u003e`][string] to compare\n- `s2`: [`\u003cstring\u003e`][string] to compare\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nCompare for array.sort with priority\n\n_Example:_\n\n```js\nfiles.sort(common.sortComparePriority);\n```\n\n### sortCompareDirectories(a, b)\n\n- `a`: [`\u003cstring\u003e`][string] to compare\n- `b`: [`\u003cstring\u003e`][string] to compare\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nCompare for array.sort, directories first\n\n_Example:_\n\n```js\nfiles.sort(sortCompareDirectories);\n```\n\n### sortCompareByName(a, b)\n\n- `a`: [`\u003cObject\u003e`][object] { name } to compare\n- `b`: [`\u003cObject\u003e`][object] { name } to compare\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nCompare for array.sort\n\n_Example:_\n\n```js\nfiles.sort(sortCompareByName);\n```\n\n### class MemoryWritable extends [Writable][writable]\n\n#### MemoryWritable.prototype.constructor(\\[sizeLimit\\])\n\n- `sizeLimit`: [`\u003cnumber\u003e`][number]|[`\u003cstring\u003e`][string] limit of the internal\n  buffer size specified as number in bytes or as string in format supported by\n  `common.bytesToSize()`. Defaults to 8 MB\n\n#### async MemoryWritable.prototype.getData(\\[encoding\\])\n\n- `encoding`: [`\u003cstring\u003e`][string] encoding to convert the resulting data to,\n  must be a valid [`\u003cBuffer\u003e`][buffer] encoding\n\n_Returns:_ [`\u003cPromise\u003e`][promise]\n\nReturn a Promise that will be resolved with all the written data once it\n\nbecomes available.\n\n### subst(tpl, data, dataPath, escapeHtml)\n\n- `tpl`: [`\u003cstring\u003e`][string] template body\n- `data`: [`\u003cObject\u003e`][object] hash, data structure to visualize\n- `dataPath`: [`\u003cstring\u003e`][string] current position in data structure\n- `escapeHtml`: [`\u003cboolean\u003e`][boolean] escape html special characters if true\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nSubstitute variables\n\n### htmlEscape(content)\n\n- `content`: [`\u003cstring\u003e`][string] to escape\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nEscape html characters\n\n_Example:_\n\n```js\nhtmlEscape('5\u003e=5') = '5\u0026lt;=5';\n```\n\n### fileExt(fileName)\n\n- `fileName`: [`\u003cstring\u003e`][string] file name\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nExtract file extension in lower case without dot\n\n_Example:_\n\n```js\nfileExt('/dir/file.txt');\n```\n\n_Result:_\n\n```js\n'txt';\n```\n\n### removeExt(fileName)\n\n- `fileName`: [`\u003cstring\u003e`][string] file name\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nRemove file extension from file name\n\n_Example:_\n\n```js\nfileExt('file.txt');\n```\n\n_Result:_\n\n```js\n'file';\n```\n\n### spinalToCamel(name)\n\n- `name`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nConvert spinal case to camel case\n\n### escapeRegExp(s)\n\n- `s`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nEscape regular expression control characters\n\n_Example:_\n\n```js\nescapeRegExp('/path/to/res?search=this.that');\n```\n\n### newEscapedRegExp(s)\n\n- `s`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cRegExp\u003e`][regexp]\n\nGenerate escaped regular expression\n\n### addTrailingSlash(s)\n\n- `s`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nAdd trailing slash at the end if there isn't one\n\n### stripTrailingSlash(s)\n\n- `s`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nRemove trailing slash from string\n\n### dirname(filePath)\n\n- `filePath`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nGet directory name with trailing slash from path\n\n### capitalize(s)\n\n- `s`: [`\u003cstring\u003e`][string]\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nCapitalize string\n\n### between(s, prefix, suffix)\n\n- `s`: [`\u003cstring\u003e`][string] source\n- `prefix`: [`\u003cstring\u003e`][string] before needed fragment\n- `suffix`: [`\u003cstring\u003e`][string] after needed fragment\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nExtract substring between prefix and suffix\n\n### removeBOM(s)\n\n- `s`: [`\u003cstring\u003e`][string] possibly starts with BOM\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nRemove UTF-8 BOM\n\n### arrayRegExp(items)\n\n- `items`: [`\u003cstring[]\u003e`][string]\n\n_Returns:_ [`\u003cRegExp\u003e`][regexp]\n\nGenerate RegExp from array with '*' wildcards\n\n_Example:_\n\n```js\n['/css/*', '/index.html'];\n```\n\n### section(s, separator)\n\n- `s`: [`\u003cstring\u003e`][string]\n- `separator`: [`\u003cstring\u003e`][string] or char\n\n_Returns:_ [`\u003cstring[]\u003e`][string]\n\nSplit string by the first occurrence of separator\n\n_Example:_\n\n```js\nrsection('All you need is JavaScript', 'is');\n```\n\n_Result:_\n\n```js\n['All you need ', ' JavaScript'];\n```\n\n### rsection(s, separator)\n\n- `s`: [`\u003cstring\u003e`][string]\n- `separator`: [`\u003cstring\u003e`][string] or char\n\n_Returns:_ [`\u003cstring[]\u003e`][string]\n\nSplit string by the last occurrence of separator\n\n_Example:_\n\n```js\nrsection('All you need is JavaScript', 'a');\n```\n\n_Result:_\n\n```js\n['All you need is Jav', 'Script'];\n```\n\n### split(s\\[, separator\\[, limit\\]\\])\n\n- `s`: [`\u003cstring\u003e`][string]\n- `separator`: [`\u003cstring\u003e`][string] (optional), default: ','\n- `limit`: [`\u003cnumber\u003e`][number] (optional), default: `-1`, max length of result\n  array\n\n_Returns:_ [`\u003cstring[]\u003e`][string]\n\nSplit string by multiple occurrence of separator\n\n_Example:_\n\n```js\nsplit('a,b,c,d');\n```\n\n_Result:_\n\n```js\n['a', 'b', 'c', 'd'];\n```\n\n_Example:_\n\n```js\nsplit('a,b,c,d', ',', 2);\n```\n\n_Result:_\n\n```js\n['a', 'b'];\n```\n\n### rsplit(s\\[, separator\\[, limit\\]\\])\n\n- `s`: [`\u003cstring\u003e`][string]\n- `separator`: [`\u003cstring\u003e`][string] (optional), default: ','\n- `limit`: [`\u003cnumber\u003e`][number] (optional), default: `-1`, max length of result\n  array\n\n_Returns:_ [`\u003cstring[]\u003e`][string]\n\nSplit string by multiple occurrences of separator\n\n_Example:_\n\n```js\nsplit('a,b,c,d', ',', 2);\n```\n\n_Result:_\n\n```js\n['c', 'd'];\n```\n\n### normalizeEmail(email)\n\n- `email`: [`\u003cstring\u003e`][string] email address to normalize\n\n_Returns:_ [`\u003cstring\u003e`][string] normalized email address\n\nNormalize email address according to OWASP recommendations\n\n### isTimeEqual(time1, time2)\n\n- `time1`: [`\u003cstring\u003e`][string] time or milliseconds\n- `time2`: [`\u003cstring\u003e`][string] time or milliseconds\n\n_Returns:_ [`\u003cboolean\u003e`][boolean]\n\nCompare time1 and time2\n\n_Example:_\n\n```js\nisTimeEqual(sinceTime, buffer.stats.mtime);\n```\n\n### nowDate(\\[date\\])\n\n- `date`: [`\u003cDate\u003e`][date] (optional), default: `new Date()`\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nGet current date in YYYY-MM-DD format\n\n### nowDateTime(\\[date\\])\n\n- `date`: [`\u003cDate\u003e`][date] (optional), default: `new Date()`\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nGet current date in YYYY-MM-DD hh:mm format\n\n### class Uint64\n\n#### Uint64.add(a, b)\n\n#### Uint64.and(a, b)\n\n#### Uint64.cmp(a, b)\n\n#### Uint64.div(a, b)\n\n#### Uint64.mod(a, b)\n\n#### Uint64.mult(a, b)\n\n#### Uint64.not(a)\n\n#### Uint64.or(a, b)\n\n#### Uint64.shiftLeft(a, b)\n\n#### Uint64.shiftRight(a, b)\n\n#### Uint64.sub(a, b)\n\n#### Uint64.xor(a, b)\n\n#### Uint64.prototype.constructor(value)\n\n#### Uint64.prototype.add(b)\n\n#### Uint64.prototype.and(b)\n\n#### Uint64.prototype.dec()\n\n#### Uint64.prototype.inc()\n\n#### Uint64.prototype.not()\n\n#### Uint64.prototype.or(b)\n\n#### Uint64.prototype.shiftLeft(b)\n\n#### Uint64.prototype.shiftRight(b)\n\n#### Uint64.prototype.sub(b)\n\n#### Uint64.prototype.toJSON()\n\n#### Uint64.prototype.toPostgres()\n\n#### Uint64.prototype.toString(radix = 10)\n\n#### Uint64.prototype.toUint32()\n\n#### Uint64.prototype.xor(b)\n\n### duration(s)\n\n- `s`: [`\u003cstring\u003e`][string] duration syntax\n\n_Returns:_ [`\u003cnumber\u003e`][number] milliseconds\n\nParse duration to seconds\n\n_Example:_\n\n```js\nduration('1d 10h 7m 13s');\n```\n\n### durationToString(n)\n\n- `n`: [`\u003cnumber\u003e`][number] duration\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nConvert integer duration to string\n\n### bytesToSize(bytes)\n\n- `bytes`: [`\u003cnumber\u003e`][number] size\n\n_Returns:_ [`\u003cstring\u003e`][string]\n\nConvert integer to string, representing data size in Kb, Mb, Gb, and Tb\n\n### sizeToBytes(size)\n\n- `size`: [`\u003cstring\u003e`][string] size\n\n_Returns:_ [`\u003cnumber\u003e`][number]\n\nConvert string with data size to integer\n\n### safe(fn)\n\n- `fn`: [`\u003cFunction\u003e`][function]\n\n_Returns:_ [`\u003cFunction\u003e`][function] function(...args), wrapped with try/catch\ninterception\n\n- `args`: [`\u003cArray\u003e`][array] arguments to be passed to wrapped function\n\nMake function raise-safe\n\n### captureMaxStack()\n\n### callerFilename(depth = 0, stack = null)\n\n### callerFilepath(depth = 0, stack = null)\n\n- `depth`: [`\u003cnumber\u003e`][number]|[`\u003cRegExp\u003e`][regexp] initial stack slice or\n  filter regular expression, 0 by default.\n- `stack`: [`\u003cstring\u003e`][string] stack string, optional\n\nTry to detect the filepath of a caller of this function.\n\n## Contributors\n\nSee github for full [contributors list](https://github.com/metarhia/common/graphs/contributors)\n\n[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\n[date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\n[regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\n[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\n[error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n[typeerror]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\n[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type\n[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Null_type\n[undefined]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type\n[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type\n[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type\n[object.fromentries()]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries\n[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer\n[eventemitter]: https://nodejs.org/api/events.html#events_class_eventemitter\n[writable]: https://nodejs.org/api/stream.html#stream_class_stream_writable\n","funding_links":["https://patreon.com/tshemsedinov"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetarhia%2Fcommon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetarhia%2Fcommon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetarhia%2Fcommon/lists"}