Merge branch 'getDays' into 'development'

* Updated packages

See merge request martind2000/utils!1
This commit is contained in:
Martin Donnelly 2021-05-16 21:21:30 +00:00
commit cc31e18f82
5 changed files with 189 additions and 120 deletions

266
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@rakh/utils", "name": "@rakh/utils",
"version": "2.0.0", "version": "2.0.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -954,20 +954,10 @@
"@sinonjs/commons": "^1.7.0" "@sinonjs/commons": "^1.7.0"
} }
}, },
"@sinonjs/formatio": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz",
"integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==",
"dev": true,
"requires": {
"@sinonjs/commons": "^1",
"@sinonjs/samsam": "^5.0.2"
}
},
"@sinonjs/samsam": { "@sinonjs/samsam": {
"version": "5.3.0", "version": "5.3.1",
"resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.0.tgz", "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz",
"integrity": "sha512-hXpcfx3aq+ETVBwPlRFICld5EnrkexXuXDwqUNhDdr5L8VjvMeSRwyOa0qL7XFmR+jVWR4rUZtnxlG7RX72sBg==", "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@sinonjs/commons": "^1.6.0", "@sinonjs/commons": "^1.6.0",
@ -1056,9 +1046,9 @@
} }
}, },
"@types/jest": { "@types/jest": {
"version": "26.0.15", "version": "26.0.23",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.15.tgz", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.23.tgz",
"integrity": "sha512-s2VMReFXRg9XXxV+CW9e5Nz8fH2K1aEhwgjUqPPbQd7g95T0laAcvLv032EhFHIa5GHsZ8W7iJEQVaJq6k3Gog==", "integrity": "sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA==",
"dev": true, "dev": true,
"requires": { "requires": {
"jest-diff": "^26.0.0", "jest-diff": "^26.0.0",
@ -1084,19 +1074,24 @@
"dev": true "dev": true
}, },
"@types/sinon": { "@types/sinon": {
"version": "9.0.8", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.8.tgz", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.0.tgz",
"integrity": "sha512-IVnI820FZFMGI+u1R+2VdRaD/82YIQTdqLYC9DLPszZuynAJDtCvCtCs3bmyL66s7FqRM3+LPX7DhHnVTaagDw==", "integrity": "sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/sinonjs__fake-timers": "*" "@sinonjs/fake-timers": "^7.0.4"
}
}, },
"@types/sinonjs__fake-timers": { "dependencies": {
"version": "6.0.2", "@sinonjs/fake-timers": {
"resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz", "version": "7.0.5",
"integrity": "sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg==", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz",
"dev": true "integrity": "sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw==",
"dev": true,
"requires": {
"@sinonjs/commons": "^1.7.0"
}
}
}
}, },
"@types/stack-utils": { "@types/stack-utils": {
"version": "2.0.0", "version": "2.0.0",
@ -1764,6 +1759,12 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true "dev": true
}, },
"create-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"dev": true
},
"cross-spawn": { "cross-spawn": {
"version": "6.0.5", "version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
@ -2436,14 +2437,14 @@
"integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4="
}, },
"fs-extra": { "fs-extra": {
"version": "9.0.1", "version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
"integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"requires": { "requires": {
"at-least-node": "^1.0.0", "at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0", "graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1", "jsonfile": "^6.0.1",
"universalify": "^1.0.0" "universalify": "^2.0.0"
} }
}, },
"fs.realpath": { "fs.realpath": {
@ -2726,9 +2727,9 @@
} }
}, },
"handlebars": { "handlebars": {
"version": "4.7.6", "version": "4.7.7",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
"integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
"requires": { "requires": {
"minimist": "^1.2.5", "minimist": "^1.2.5",
"neo-async": "^2.6.0", "neo-async": "^2.6.0",
@ -2820,11 +2821,6 @@
} }
} }
}, },
"highlight.js": {
"version": "10.3.2",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.3.2.tgz",
"integrity": "sha512-3jRT7OUYsVsKvukNKZCtnvRcFyCJqSEIuIMsEybAXRiFSwpt65qjPd/Pr+UOdYt7WJlt+lj3+ypUsHiySBp/Jw=="
},
"homedir-polyfill": { "homedir-polyfill": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@ -4614,13 +4610,6 @@
"requires": { "requires": {
"graceful-fs": "^4.1.6", "graceful-fs": "^4.1.6",
"universalify": "^2.0.0" "universalify": "^2.0.0"
},
"dependencies": {
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
}
} }
}, },
"jsprim": { "jsprim": {
@ -4636,9 +4625,9 @@
} }
}, },
"just-extend": { "just-extend": {
"version": "4.1.1", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz",
"integrity": "sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA==", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==",
"dev": true "dev": true
}, },
"kind-of": { "kind-of": {
@ -4833,18 +4822,20 @@
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
"dev": true "dev": true
}, },
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
"integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=",
"dev": true
},
"lodash.sortby": { "lodash.sortby": {
"version": "4.7.0", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
"integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=",
"dev": true "dev": true
}, },
"lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
"requires": {
"yallist": "^3.0.2"
}
},
"lunr": { "lunr": {
"version": "2.3.9", "version": "2.3.9",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
@ -4912,9 +4903,10 @@
} }
}, },
"marked": { "marked": {
"version": "1.2.4", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/marked/-/marked-1.2.4.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.3.tgz",
"integrity": "sha512-6x5TFGCTKSQBLTZtOburGxCxFEBJEGYVLwCMTBCxzvyuisGcC20UNzDSJhCr/cJ/Kmh6ulfJm10g6WWEAJ3kvg==" "integrity": "sha512-5otztIIcJfPc2qGTN8cVtOJEjNJZ0jwa46INMagrYfk0EvqtRuEHLsEe0LrFS0/q+ZRKT0+kXK7P2T1AN5lWRA==",
"dev": true
}, },
"memoizee": { "memoizee": {
"version": "0.2.6", "version": "0.2.6",
@ -5058,9 +5050,9 @@
"dev": true "dev": true
}, },
"nise": { "nise": {
"version": "4.0.4", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/nise/-/nise-4.0.4.tgz", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz",
"integrity": "sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A==", "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@sinonjs/commons": "^1.7.0", "@sinonjs/commons": "^1.7.0",
@ -5252,6 +5244,14 @@
"mimic-fn": "^2.1.0" "mimic-fn": "^2.1.0"
} }
}, },
"onigasm": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz",
"integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==",
"requires": {
"lru-cache": "^5.1.1"
}
},
"optionator": { "optionator": {
"version": "0.8.3", "version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
@ -5482,9 +5482,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "2.1.2", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz",
"integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==",
"dev": true "dev": true
}, },
"pretty-format": { "pretty-format": {
@ -6040,6 +6040,15 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"shiki": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.3.tgz",
"integrity": "sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==",
"requires": {
"onigasm": "^2.2.5",
"vscode-textmate": "^5.2.0"
}
},
"signal-exit": { "signal-exit": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@ -6047,17 +6056,16 @@
"dev": true "dev": true
}, },
"sinon": { "sinon": {
"version": "9.2.1", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.1.tgz", "resolved": "https://registry.npmjs.org/sinon/-/sinon-10.0.0.tgz",
"integrity": "sha512-naPfsamB5KEE1aiioaoqJ6MEhdUs/2vtI5w1hPAXX/UwvoPjXcwh1m5HiKx0HGgKR8lQSoFIgY5jM6KK8VrS9w==", "integrity": "sha512-XAn5DxtGVJBlBWYrcYKEhWCz7FLwZGdyvANRyK06419hyEpdT0dMc5A8Vcxg5SCGHc40CsqoKsc1bt1CbJPfNw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@sinonjs/commons": "^1.8.1", "@sinonjs/commons": "^1.8.1",
"@sinonjs/fake-timers": "^6.0.1", "@sinonjs/fake-timers": "^6.0.1",
"@sinonjs/formatio": "^5.0.1", "@sinonjs/samsam": "^5.3.1",
"@sinonjs/samsam": "^5.2.0",
"diff": "^4.0.2", "diff": "^4.0.2",
"nise": "^4.0.4", "nise": "^4.1.0",
"supports-color": "^7.1.0" "supports-color": "^7.1.0"
}, },
"dependencies": { "dependencies": {
@ -6573,45 +6581,63 @@
} }
}, },
"ts-jest": { "ts-jest": {
"version": "26.4.4", "version": "26.5.6",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.4.4.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.5.6.tgz",
"integrity": "sha512-3lFWKbLxJm34QxyVNNCgXX1u4o/RV0myvA2y2Bxm46iGIjKlaY0own9gIckbjZJPn+WaJEnfPPJ20HHGpoq4yg==", "integrity": "sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/jest": "26.x",
"bs-logger": "0.x", "bs-logger": "0.x",
"buffer-from": "1.x", "buffer-from": "1.x",
"fast-json-stable-stringify": "2.x", "fast-json-stable-stringify": "2.x",
"jest-util": "^26.1.0", "jest-util": "^26.1.0",
"json5": "2.x", "json5": "2.x",
"lodash.memoize": "4.x", "lodash": "4.x",
"make-error": "1.x", "make-error": "1.x",
"mkdirp": "1.x", "mkdirp": "1.x",
"semver": "7.x", "semver": "7.x",
"yargs-parser": "20.x" "yargs-parser": "20.x"
}, },
"dependencies": { "dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
},
"semver": { "semver": {
"version": "7.3.2", "version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true "dev": true
}, },
"yargs-parser": { "yargs-parser": {
"version": "20.2.4", "version": "20.2.7",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
"dev": true "dev": true
} }
} }
}, },
"ts-node": { "ts-node": {
"version": "9.0.0", "version": "9.1.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz",
"integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arg": "^4.1.0", "arg": "^4.1.0",
"create-require": "^1.1.0",
"diff": "^4.0.1", "diff": "^4.0.1",
"make-error": "^1.1.1", "make-error": "^1.1.1",
"source-map-support": "^0.5.17", "source-map-support": "^0.5.17",
@ -6664,45 +6690,55 @@
} }
}, },
"typedoc": { "typedoc": {
"version": "0.19.2", "version": "0.20.36",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.19.2.tgz", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.36.tgz",
"integrity": "sha512-oDEg1BLEzi1qvgdQXc658EYgJ5qJLVSeZ0hQ57Eq4JXy6Vj2VX4RVo18qYxRWz75ifAaYuYNBUCnbhjd37TfOg==", "integrity": "sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==",
"requires": { "requires": {
"fs-extra": "^9.0.1", "colors": "^1.4.0",
"handlebars": "^4.7.6", "fs-extra": "^9.1.0",
"highlight.js": "^10.2.0", "handlebars": "^4.7.7",
"lodash": "^4.17.20", "lodash": "^4.17.21",
"lunr": "^2.3.9", "lunr": "^2.3.9",
"marked": "^1.1.1", "marked": "^2.0.3",
"minimatch": "^3.0.0", "minimatch": "^3.0.0",
"progress": "^2.0.3", "progress": "^2.0.3",
"semver": "^7.3.2",
"shelljs": "^0.8.4", "shelljs": "^0.8.4",
"typedoc-default-themes": "^0.11.4" "shiki": "^0.9.3",
"typedoc-default-themes": "^0.12.10"
}, },
"dependencies": { "dependencies": {
"semver": { "colors": {
"version": "7.3.2", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"marked": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/marked/-/marked-2.0.3.tgz",
"integrity": "sha512-5otztIIcJfPc2qGTN8cVtOJEjNJZ0jwa46INMagrYfk0EvqtRuEHLsEe0LrFS0/q+ZRKT0+kXK7P2T1AN5lWRA=="
} }
} }
}, },
"typedoc-default-themes": { "typedoc-default-themes": {
"version": "0.11.4", "version": "0.12.10",
"resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.11.4.tgz", "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz",
"integrity": "sha512-Y4Lf+qIb9NTydrexlazAM46SSLrmrQRqWiD52593g53SsmUFioAsMWt8m834J6qsp+7wHRjxCXSZeiiW5cMUdw==" "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA=="
}, },
"typescript": { "typescript": {
"version": "4.0.5", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {
"version": "3.11.6", "version": "3.13.6",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.6.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.6.tgz",
"integrity": "sha512-oASI1FOJ7BBFkSCNDZ446EgkSuHkOZBuqRFrwXIKWCoXw8ZXQETooTQjkAcBS03Acab7ubCKsXnwuV2svy061g==", "integrity": "sha512-rRprLwl8RVaS+Qvx3Wh5hPfPBn9++G6xkGlUupya0s5aDmNjI7z3lnRLB3u7sN4OmbB0pWgzhM9BEJyiWAwtAA==",
"optional": true "optional": true
}, },
"unc-path-regex": { "unc-path-regex": {
@ -6734,9 +6770,9 @@
} }
}, },
"universalify": { "universalify": {
"version": "1.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
}, },
"unset-value": { "unset-value": {
"version": "1.0.0", "version": "1.0.0",
@ -6874,6 +6910,11 @@
"parentpath": "~0.2.0" "parentpath": "~0.2.0"
} }
}, },
"vscode-textmate": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.4.0.tgz",
"integrity": "sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w=="
},
"w3c-hr-time": { "w3c-hr-time": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
@ -7037,6 +7078,11 @@
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true "dev": true
}, },
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
},
"yargs": { "yargs": {
"version": "15.4.1", "version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "@rakh/utils", "name": "@rakh/utils",
"version": "2.0.3", "version": "2.0.4",
"main": "dist/commonjs/index.js", "main": "dist/commonjs/index.js",
"module": "dist/es/index.js", "module": "dist/es/index.js",
"jsnext:main": "dist/es/index.js", "jsnext:main": "dist/es/index.js",
@ -17,19 +17,19 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"save": "^2.4.0", "save": "^2.4.0",
"typedoc": "^0.19.2" "typedoc": "^0.20.36"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.15", "@types/jest": "^26.0.23",
"@types/sinon": "^9.0.8", "@types/sinon": "^10.0.0",
"grunt": "^1.3.0", "grunt": "^1.3.0",
"jest": "^26.6.3", "jest": "^26.6.3",
"marked": "^1.2.4", "marked": "^2.0.3",
"prettier": "^2.1.2", "prettier": "^2.3.0",
"sinon": "^9.2.1", "sinon": "^10.0.0",
"ts-jest": "^26.4.4", "ts-jest": "^26.5.6",
"ts-node": "^9.0.0", "ts-node": "^9.1.1",
"typescript": "^4.0.5", "typescript": "^4.2.4",
"vik": "^0.4.0" "vik": "^0.4.0"
}, },
"description": "", "description": "",

8
ts-src/getDays.test.ts Normal file
View File

@ -0,0 +1,8 @@
import { getDays} from "./getDays";
test('Should return the correct number of days', () => {
expect(getDays(new Date(2021,0,1), new Date(2021,0,11))).toEqual(10);
expect(getDays(new Date(2021,0,11), new Date(2021,0,1))).toEqual(-10);
});

14
ts-src/getDays.ts Normal file
View File

@ -0,0 +1,14 @@
/**
* Get number of days between two Date objects
* @param startdate
* @param enddate
*/
export function getDays(startdate: Date, enddate: Date): number {
let result, startMS, endMS;
startMS = startdate.getTime();
endMS = enddate.getTime();
result = Math.ceil((endMS - startMS) / (24 * 60 * 60 * 1000));
return result;
}

View File

@ -4,6 +4,7 @@ export * from './debounce';
export * from './distance'; export * from './distance';
export * from './extractFromObj'; export * from './extractFromObj';
export * from './get'; export * from './get';
export * from './getDays';
export * from './hasOwn'; export * from './hasOwn';
export * from './hourFloor'; export * from './hourFloor';
export * from './isEmpty'; export * from './isEmpty';