{"_id":"@cacheable/utils","_rev":"13-ed407510ab247b12ce6fccf52e4226c7","name":"@cacheable/utils","dist-tags":{"latest":"2.3.3"},"versions":{"1.0.0":{"name":"@cacheable/utils","version":"1.0.0","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@1.0.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"841debda3ed2d4ab8a56ce36874f3155c25edacb","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-1.0.0.tgz","fileCount":7,"integrity":"sha512-zhvGyJ1dKYhb72bPNrZyUcgRFAkhI5EhFyYFBBoszq327IYct/Np/8jh7zJBRdFrwF5HTiSVMacEKWg3Jbm5Yw==","signatures":[{"sig":"MEQCIDFDSCg841LRQNrfbFqtcQPHcP8WwJrJxUK5Fyanx11pAiAqdEeXWKoZ7Eb7eMnjdXdgKHT4fIXTiJ6Wcsy/Wesg3w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44785},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"test":"xo --fix && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"xo && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/10ce4ef5ffa8d433ec49a717dbbc1af0/cacheable-utils-1.0.0.tgz","_integrity":"sha512-zhvGyJ1dKYhb72bPNrZyUcgRFAkhI5EhFyYFBBoszq327IYct/Np/8jh7zJBRdFrwF5HTiSVMacEKWg3Jbm5Yw==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.2","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.1","tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.1.0","typescript":"^5.8.3","@keyv/redis":"^5.0.0","@types/node":"^24.1.0","@keyv/valkey":"^1.0.7","@types/eslint":"^9.6.1","@faker-js/faker":"^9.9.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.0_1753418756717_0.97514964993953","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@cacheable/utils","version":"1.1.0","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@1.1.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"074fa3d85f072be4e56187ae6383f21b147779e8","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-1.1.0.tgz","fileCount":7,"integrity":"sha512-5EYIHSQy8S02Z8tuvfNWGZcgnPrkMF++LjqyFGOG85CSrf/kEB6hCH3F2TVN1LrlkiUk+hviXunDwsCVmwZNxg==","signatures":[{"sig":"MEUCICVTcdt4nHPARUw19zjTKGUMA0wsqX32Qv3gqXTpN40/AiEA4/NC7DXA9lEXWpVsGlVpHIOCMtVl4QP5soSBGhDoa8Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45222},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-1.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"test":"xo --fix && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"xo && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/4926c8c7f2c20b5592207eb644ed6c8e/cacheable-utils-1.1.0.tgz","_integrity":"sha512-5EYIHSQy8S02Z8tuvfNWGZcgnPrkMF++LjqyFGOG85CSrf/kEB6hCH3F2TVN1LrlkiUk+hviXunDwsCVmwZNxg==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.2","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.1","tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.1.0","typescript":"^5.8.3","@keyv/redis":"^5.0.0","@types/node":"^24.1.0","@keyv/valkey":"^1.0.7","@types/eslint":"^9.6.1","@faker-js/faker":"^9.9.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.1.0_1753931672130_0.4074764019517554","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@cacheable/utils","version":"1.1.1","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@1.1.1","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"f77b0ac0ae1365aecf1175d3482a608272ae6809","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-1.1.1.tgz","fileCount":7,"integrity":"sha512-Mf738OOJY1oiVccaIsmAsQffNInAb2Oz7v1gjOSSkCZUrefyVTJRdiwBJ+uu8Q18JMrwwbdPA6XC2SeHLrhLvQ==","signatures":[{"sig":"MEYCIQDzY+q7aFFlt+iLNSmo+mnuOYw0k+DyCoPf9m3MU2uDzgIhAIi8x+IrhuIxJAnDtuf4xNWvdeuaqZImndGaaKIM+IUM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44823},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-1.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/a1ad0674a648adab0654e0c550491d61/cacheable-utils-1.1.1.tgz","_integrity":"sha512-Mf738OOJY1oiVccaIsmAsQffNInAb2Oz7v1gjOSSkCZUrefyVTJRdiwBJ+uu8Q18JMrwwbdPA6XC2SeHLrhLvQ==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.2","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.1.0","typescript":"^5.9.2","@keyv/redis":"^5.1.1","@types/node":"^24.3.0","@keyv/valkey":"^1.0.8","@biomejs/biome":"^2.2.2","@faker-js/faker":"^10.0.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.1.1_1756246776681_0.5049738467759095","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@cacheable/utils","version":"2.0.0","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.0.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"91d9d8f34e7ce4790d44a37b57f01d1ea5093d35","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.0.0.tgz","fileCount":7,"integrity":"sha512-Y+ZxdxSo2ErcROjNCdButjobQDuu4mpx875uhItK6ZqW3XmDikG+YIjh30ELfOZnVFjxfpvgjz57HbYJ0m1ApQ==","signatures":[{"sig":"MEYCIQDd6zyJFqS+xtLkRWP7n49KxmOuZgFHjqMyjn3ycPscnwIhAPzNDLZyPG3l7X4RZbeWZIkqqp6XiUmzIgURT/StUw1e","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40071},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean --minify","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/h1/n3vxgc0n1sn5_9pxftc4p6l80000gn/T/250fc3d4a38cb29b480582bcbdc810e9/cacheable-utils-2.0.0.tgz","_integrity":"sha512-Y+ZxdxSo2ErcROjNCdButjobQDuu4mpx875uhItK6ZqW3XmDikG+YIjh30ELfOZnVFjxfpvgjz57HbYJ0m1ApQ==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.1","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.1.0","typescript":"^5.9.2","@keyv/redis":"^5.1.1","@types/node":"^24.3.0","@keyv/valkey":"^1.0.8","@biomejs/biome":"^2.2.2","@faker-js/faker":"^10.0.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.0.0_1757440527465_0.27365247557878947","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@cacheable/utils","version":"2.0.1","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.0.1","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"f444dcacf8cf213a0c1b0493b0520c757698045f","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.0.1.tgz","fileCount":7,"integrity":"sha512-sxHjO6wKn4/0wHCFYbh6tljj+ciP9BKgyBi09NLsor3sN+nu/Rt3FwLw6bYp7bp8usHpmcwUozrB/u4RuSw/eg==","signatures":[{"sig":"MEUCIFMQBUZnS6LlVgzwYi3vuqeH7G5UJpPWwn2pZhs7sl/cAiEAp9tCPktiGihn2dBjbR0J8O/qk4WS3xbuQK8nwWXha9A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40071},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean --minify","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/ce7b5dba8ffa12bd58b630737f081079/cacheable-utils-2.0.1.tgz","_integrity":"sha512-sxHjO6wKn4/0wHCFYbh6tljj+ciP9BKgyBi09NLsor3sN+nu/Rt3FwLw6bYp7bp8usHpmcwUozrB/u4RuSw/eg==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.2","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.1.0","typescript":"^5.9.2","@keyv/redis":"^5.1.1","@types/node":"^24.3.0","@keyv/valkey":"^1.0.8","@biomejs/biome":"^2.2.2","@faker-js/faker":"^10.0.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.0.1_1758048816961_0.2854037705055812","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@cacheable/utils","version":"2.0.2","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.0.2","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"5b28f9c653ca25ad9ab638ed4a98103afd7d88cf","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.0.2.tgz","fileCount":7,"integrity":"sha512-JTFM3raFhVv8LH95T7YnZbf2YoE9wEtkPPStuRF9a6ExZ103hFvs+QyCuYJ6r0hA9wRtbzgZtwUCoDWxssZd4Q==","signatures":[{"sig":"MEUCIHTe0MLvGwpT8363UkiR2ySYcu9cnzUvYKXepslAgfvOAiEAuUjfu2rnsag0BErj6IRaMDs4bUeHMts+g3cOVuN41qU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40071},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean --minify","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/affac3fa1a8b6bf67ee5fcdd60051762/cacheable-utils-2.0.2.tgz","_integrity":"sha512-JTFM3raFhVv8LH95T7YnZbf2YoE9wEtkPPStuRF9a6ExZ103hFvs+QyCuYJ6r0hA9wRtbzgZtwUCoDWxssZd4Q==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.6.0","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.1.0","typescript":"^5.9.2","@keyv/redis":"^5.1.1","@types/node":"^24.3.0","@keyv/valkey":"^1.0.8","@biomejs/biome":"^2.2.2","@faker-js/faker":"^10.0.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.0.2_1758555852839_0.26843365552242826","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@cacheable/utils","version":"2.0.3","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.0.3","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"45d62f5dd3b481ef62677335bada2cbdb579148b","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.0.3.tgz","fileCount":7,"integrity":"sha512-m7Rce68cMHlAUjvWBy9Ru1Nmw5gU0SjGGtQDdhpe6E0xnbcvrIY0Epy//JU1VYYBUTzrG9jvgmTauULGKzOkWA==","signatures":[{"sig":"MEUCIGk2Cgml5xG1RbK7UazS1xSvMwNfPUggp8Syuh22gi7JAiEAnFsNcXRzkW+qTw60+PU9irjIYrODHImYaMpxdGX0tTw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40071},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.0.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean --minify","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/h1/n3vxgc0n1sn5_9pxftc4p6l80000gn/T/0a7911187ed6f78e615dc052d6a866be/cacheable-utils-2.0.3.tgz","_integrity":"sha512-m7Rce68cMHlAUjvWBy9Ru1Nmw5gU0SjGGtQDdhpe6E0xnbcvrIY0Epy//JU1VYYBUTzrG9jvgmTauULGKzOkWA==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.1","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.2.2","typescript":"^5.9.2","@keyv/redis":"^5.1.2","@types/node":"^24.5.2","@keyv/valkey":"^1.0.8","@biomejs/biome":"^2.2.4","@faker-js/faker":"^10.0.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.0.3_1759339679130_0.18045343214479814","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@cacheable/utils","version":"2.1.0","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.1.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"fbef92c5bfe720eadbdbf516c5fa64dee794d35d","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.1.0.tgz","fileCount":7,"integrity":"sha512-ZdxfOiaarMqMj+H7qwlt5EBKWaeGihSYVHdQv5lUsbn8MJJOTW82OIwirQ39U5tMZkNvy3bQE+ryzC+xTAb9/g==","signatures":[{"sig":"MEYCIQCx4ONzBn0uMoeSinPIzo5Ilpq0ZaYjevFetCDL6FWL2wIhAMq26UxHJnyexOiTCps+MS7xMCGBE5MfJ0k39VxlWzIN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40812},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean --minify","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/h1/n3vxgc0n1sn5_9pxftc4p6l80000gn/T/af5d021decab9188f10e8983e92b6d94/cacheable-utils-2.1.0.tgz","_integrity":"sha512-ZdxfOiaarMqMj+H7qwlt5EBKWaeGihSYVHdQv5lUsbn8MJJOTW82OIwirQ39U5tMZkNvy3bQE+ryzC+xTAb9/g==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.1","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"20.17.0","dependencies":{"keyv":"^5.5.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.4","lru-cache":"^11.2.2","typescript":"^5.9.2","@keyv/redis":"^5.1.2","@types/node":"^24.5.2","@keyv/valkey":"^1.0.8","@biomejs/biome":"^2.2.4","@faker-js/faker":"^10.0.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.1.0_1759769366314_0.19951216167320873","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@cacheable/utils","version":"2.2.0","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.2.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"00f454fc27f1376dc1c3c3d5b85f90ee36c9b5fb","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.2.0.tgz","fileCount":7,"integrity":"sha512-7xaQayO3msdVcxXLYcLU5wDqJBNdQcPPPHr6mdTEIQI7N7TbtSVVTpWOTfjyhg0L6AQwQdq7miKdWtTDBoBldQ==","signatures":[{"sig":"MEQCIA0hBJOEoNU0V+qKDnM5UYiboFDFFEe/y80bXbT+ALpUAiB/ez4ku0gBbn44QLqRLa3X0iuO177JIHETzvyF1V0RXA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69066},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/h1/n3vxgc0n1sn5_9pxftc4p6l80000gn/T/87f1e006b8242270303887270be55feb/cacheable-utils-2.2.0.tgz","_integrity":"sha512-7xaQayO3msdVcxXLYcLU5wDqJBNdQcPPPHr6mdTEIQI7N7TbtSVVTpWOTfjyhg0L6AQwQdq7miKdWtTDBoBldQ==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.1","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"20.17.0","dependencies":{"keyv":"^5.5.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^4.0.3","lru-cache":"^11.2.2","typescript":"^5.9.3","@types/node":"^24.9.1","@biomejs/biome":"^2.3.0","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.3"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.2.0_1761950107223_0.6909784421529277","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@cacheable/utils","version":"2.3.0","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.3.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"6da69bf12b90ff392d5badd3486b2a05d76fc5f7","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.3.0.tgz","fileCount":7,"integrity":"sha512-qznqu6bpEei96zojGW+/IX1VXTOihznnVOK/kzyQWcqgn7SqkC3216nsX7M4BQfGwQgnxUXZ1xX7xiUoedqLPA==","signatures":[{"sig":"MEUCIFblS+L5Xt/yuuuuwZ9KY/KyNeAqVoAH5zOrmNJSfobmAiEAxKVUXJAVafryWnBu58qlCDuGciKj1ge75+itLW/ZAXg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74850},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/h1/n3vxgc0n1sn5_9pxftc4p6l80000gn/T/240579635eca0be2fa643bfd7e53a060/cacheable-utils-2.3.0.tgz","_integrity":"sha512-qznqu6bpEei96zojGW+/IX1VXTOihznnVOK/kzyQWcqgn7SqkC3216nsX7M4BQfGwQgnxUXZ1xX7xiUoedqLPA==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.1","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"20.17.0","dependencies":{"hashery":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.0","vitest":"^4.0.9","lru-cache":"^11.2.2","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.5","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.9"},"peerDependencies":{"keyv":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.3.0_1763311255676_0.5827123301255757","host":"s3://npm-registry-packages-npm-production"}},"2.3.1":{"name":"@cacheable/utils","version":"2.3.1","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.3.1","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"28901ec521cb6336073147dfc2ef6c8081510ff5","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.3.1.tgz","fileCount":7,"integrity":"sha512-38NJXjIr4W1Sghun8ju+uYWD8h2c61B4dKwfnQHVDFpAJ9oS28RpfqZQJ6Dgd3RceGkILDY9YT+72HJR3LoeSQ==","signatures":[{"sig":"MEQCIDc1Ll9veZe9IY2yQ1vpVEdhtKKGk0kfWivNQRQAWnaAAiA3GUXzDvrgYxkUQ8TmbZ7ZFEEX5zBwmVNPdFzKbuOb+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74822},"main":"./dist/index.cjs","type":"module","_from":"file:cacheable-utils-2.3.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/h1/n3vxgc0n1sn5_9pxftc4p6l80000gn/T/caa0fdf6d5467c32988d6fcf15c2d77a/cacheable-utils-2.3.1.tgz","_integrity":"sha512-38NJXjIr4W1Sghun8ju+uYWD8h2c61B4dKwfnQHVDFpAJ9oS28RpfqZQJ6Dgd3RceGkILDY9YT+72HJR3LoeSQ==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.4.1","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"20.17.0","dependencies":{"keyv":"^5.5.4","hashery":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.0","vitest":"^4.0.9","lru-cache":"^11.2.2","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.5","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.3.1_1763411994598_0.9891916062527135","host":"s3://npm-registry-packages-npm-production"}},"2.3.2":{"name":"@cacheable/utils","version":"2.3.2","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"@cacheable/utils@2.3.2","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/cacheable#readme","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"dist":{"shasum":"8d76faef710840c391a1a35183967028c0c521f0","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.3.2.tgz","fileCount":7,"integrity":"sha512-8kGE2P+HjfY8FglaOiW+y8qxcaQAfAhVML+i66XJR3YX5FtyDqn6Txctr3K2FrbxLKixRRYYBWMbuGciOhYNDg==","signatures":[{"sig":"MEQCIApU+T2++bC4+Ppiqi6xG4UwWSGJ7/dt58fWtjjQ6YDXAiB2RBLqBcPiO9HCWkuV5AA+0lIPz2HRnvs6EWxMU4ocJQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74958},"main":"./dist/index.js","type":"module","_from":"file:cacheable-utils-2.3.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"private":false,"scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","clean":"rimraf ./dist ./coverage ./node_modules","test:ci":"biome check --error-on-warnings && vitest run --coverage","prepublish":"pnpm build"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/da5df0e0669bba444bc539164acd5d4a/cacheable-utils-2.3.2.tgz","_integrity":"sha512-8kGE2P+HjfY8FglaOiW+y8qxcaQAfAhVML+i66XJR3YX5FtyDqn6Txctr3K2FrbxLKixRRYYBWMbuGciOhYNDg==","repository":{"url":"git+https://github.com/jaredwray/cacheable.git","type":"git","directory":"packages/utils"},"_npmVersion":"11.6.0","description":"Cacheable Utilities for Caching Libraries","directories":{},"_nodeVersion":"22.12.0","dependencies":{"keyv":"^5.5.4","hashery":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.0.14","lru-cache":"^11.2.2","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.7","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.14"},"_npmOperationalInternal":{"tmp":"tmp/utils_2.3.2_1764200992355_0.12502737796094276","host":"s3://npm-registry-packages-npm-production"}},"2.3.3":{"name":"@cacheable/utils","version":"2.3.3","description":"Cacheable Utilities for Caching Libraries","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"repository":{"type":"git","url":"git+https://github.com/jaredwray/cacheable.git","directory":"packages/utils"},"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","private":false,"dependencies":{"hashery":"^1.3.0","keyv":"^5.5.5"},"devDependencies":{"@biomejs/biome":"^2.3.10","@faker-js/faker":"^10.1.0","@types/node":"^25.0.3","@vitest/coverage-v8":"^4.0.16","lru-cache":"^11.2.4","rimraf":"^6.1.2","tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.0.16"},"keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"scripts":{"build":"rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean","prepublish":"pnpm build","lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","test:ci":"biome check --error-on-warnings && vitest run --coverage","clean":"rimraf ./dist ./coverage ./node_modules"},"_id":"@cacheable/utils@2.3.3","bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"homepage":"https://github.com/jaredwray/cacheable#readme","_integrity":"sha512-JsXDL70gQ+1Vc2W/KUFfkAJzgb4puKwwKehNLuB+HrNKWf91O736kGfxn4KujXCCSuh6mRRL4XEB0PkAFjWS0A==","_resolved":"/private/var/folders/q4/x95kq1ln6cd7rrnct9cby32r0000gn/T/5de9096c07a35f241edbfe3635b5b4b6/cacheable-utils-2.3.3.tgz","_from":"file:cacheable-utils-2.3.3.tgz","_nodeVersion":"22.12.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-JsXDL70gQ+1Vc2W/KUFfkAJzgb4puKwwKehNLuB+HrNKWf91O736kGfxn4KujXCCSuh6mRRL4XEB0PkAFjWS0A==","shasum":"56f0c0a3b2cad85f32ee2de3c73ff05d455e2c6c","tarball":"https://registry.npmjs.org/@cacheable/utils/-/utils-2.3.3.tgz","fileCount":7,"unpackedSize":74958,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDyInHCQxjDFfRZwnYRxc40VVGmH35+naLmKVXIj9UGCAiEA+HddiPLcJwGBP62rvMT220ImPgsMjfj0PWVG0o3qy08="}]},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"directories":{},"maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utils_2.3.3_1766793519156_0.35279268711464185"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-25T04:45:56.505Z","modified":"2025-12-26T23:58:39.580Z","1.0.0":"2025-07-25T04:45:56.960Z","1.1.0":"2025-07-31T03:14:32.407Z","1.1.1":"2025-08-26T22:19:36.875Z","2.0.0":"2025-09-09T17:55:27.648Z","2.0.1":"2025-09-16T18:53:37.148Z","2.0.2":"2025-09-22T15:44:13.043Z","2.0.3":"2025-10-01T17:27:59.354Z","2.1.0":"2025-10-06T16:49:26.511Z","2.2.0":"2025-10-31T22:35:07.448Z","2.3.0":"2025-11-16T16:40:55.871Z","2.3.1":"2025-11-17T20:39:54.776Z","2.3.2":"2025-11-26T23:49:52.537Z","2.3.3":"2025-12-26T23:58:39.315Z"},"bugs":{"url":"https://github.com/jaredwray/cacheable/issues"},"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","homepage":"https://github.com/jaredwray/cacheable#readme","keywords":["cacheable","caching","utilities","hashing","keyv","cache utils"],"repository":{"type":"git","url":"git+https://github.com/jaredwray/cacheable.git","directory":"packages/utils"},"description":"Cacheable Utilities for Caching Libraries","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"readme":"[\"Cacheable\"](https://github.com/jaredwray/cacheable)\n\n> Cacheble Utils\n\n[![codecov](https://codecov.io/gh/jaredwray/cacheable/graph/badge.svg?token=lWZ9OBQ7GM)](https://codecov.io/gh/jaredwray/cacheable)\n[![tests](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml/badge.svg)](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml)\n[![npm](https://img.shields.io/npm/dm/@cacheable/utils.svg)](https://www.npmjs.com/package/@cacheable/utils)\n[![npm](https://img.shields.io/npm/v/@cacheable/utils)](https://www.npmjs.com/package/@cacheable/utils)\n[![license](https://img.shields.io/github/license/jaredwray/cacheable)](https://github.com/jaredwray/cacheable/blob/main/LICENSE)\n\n`@cacheable/utils` is a collecton of utility functions, helpers, and types for `cacheable` and other caching libraries. It provides a robust set of features to enhance caching capabilities, including:\n\n* Data Types for Caching Items\n* Hash Functions for Key Generation\n* Coalesce Async for Handling Multiple Promises\n* Stats Helpers for Caching Statistics\n* Sleep / Delay for Testing and Timing\n* Memoization for wraping or get / set options\n* Time to Live (TTL) Helpers\n\n# Table of Contents\n* [Getting Started](#getting-started)\n* [Cacheable Types](#cacheable-types)\n* [Coalesce Async](#coalesce-async)\n* [Hash Functions](#hash-functions)\n* [Shorthand Time Helpers](#shorthand-time-helpers)\n* [Sleep Helper](#sleep-helper)\n* [Stats Helpers](#stats-helpers)\n* [Time to Live (TTL) Helpers](#time-to-live-ttl-helpers)\n* [Run if Function Helper](#run-if-function-helper)\n* [Less Than Helper](#less-than-helper)\n* [Is Object Helper](#is-object-helper)\n* [Wrap / Memoization for Sync and Async Functions](#wrap--memoization-for-sync-and-async-functions)\n* [Get Or Set Memoization Function](#get-or-set-memoization-function)\n* [How to Contribute](#how-to-contribute)\n* [License and Copyright](#license-and-copyright)\n\n# Getting Started\n\n```bash\nnpm install @cacheable/utils --save\n```\n\n# Cacheable Types\n\nThe `@cacheable/utils` package provides various types that are used throughout the caching library. These types help in defining the structure of cached items, ensuring type safety and consistency across your caching operations.\n\n```typescript\n\n/**\n * CacheableItem\n * @typedef {Object} CacheableItem\n * @property {string} key - The key of the cacheable item\n * @property {any} value - The value of the cacheable item\n * @property {number|string} [ttl] - Time to Live - If you set a number it is miliseconds, if you set a string it is a human-readable\n * format such as `1s` for 1 second or `1h` for 1 hour. Setting undefined means that it will use the default time-to-live. If both are\n * undefined then it will not have a time-to-live.\n */\nexport type CacheableItem = {\n\tkey: string;\n\tvalue: any;\n\tttl?: number | string;\n};\n\n/**\n * CacheableStoreItem\n * @typedef {Object} CacheableStoreItem\n * @property {string} key - The key of the cacheable store item\n * @property {any} value - The value of the cacheable store item\n * @property {number} [expires] - The expiration time in milliseconds since epoch. If not set, the item does not expire.\n */\nexport type CacheableStoreItem = {\n\tkey: string;\n\tvalue: any;\n\texpires?: number;\n};\n```\n\n# Coalesce Async\n\nThe `coalesceAsync` function is a utility that allows you to handle multiple asynchronous operations efficiently. It was designed by `Douglas Cayers` https://github.com/douglascayers/promise-coalesce. It helps in coalescing multiple promises into a single promise, ensuring that only one operation is executed at a time for the same key.\n\n```typescript\nimport { coalesceAsync } from '@cacheable/utils';\n\nconst fetchData = async (key: string) => {\n // Simulate an asynchronous operation\n return new Promise((resolve) => setTimeout(() => resolve(`Data for ${key}`), 1000));\n};\n\nconst result = await Promise.all([\n\tcoalesceAsync('my-key', fetchData),\n\tcoalesceAsync('my-key', fetchData),\n\tcoalesceAsync('my-key', fetchData),\n]);\nconsole.log(result); // Data for my-key only executed once\n```\n\n# Hash Functions\n\nThe `@cacheable/utils` package provides hash functions that can be used to generate unique keys for caching operations. These functions are useful for creating consistent and unique identifiers for cached items.\n\nThe hashing API provides both **async** (for cryptographic algorithms) and **sync** (for non-cryptographic algorithms) methods.\n\n## Async Hashing (Cryptographic Algorithms)\n\nUse `hash()` and `hashToNumber()` for cryptographic algorithms like SHA-256, SHA-384, and SHA-512:\n\n```typescript\nimport { hash, hashToNumber, HashAlgorithm } from '@cacheable/utils';\n\n// Hash using SHA-256 (default)\nconst key = await hash('my-cache-key');\nconsole.log(key); // Unique hash for 'my-cache-key'\n\n// Hash with specific algorithm\nconst sha512Hash = await hash('my-data', { algorithm: HashAlgorithm.SHA512 });\n\n// Convert hash to number within range\nconst min = 0;\nconst max = 10;\nconst result = await hashToNumber({foo: 'bar'}, { min, max, algorithm: HashAlgorithm.SHA256 });\nconsole.log(result); // A number between 0 and 10 based on the hash value\n```\n\n## Sync Hashing (Non-Cryptographic Algorithms)\n\nUse `hashSync()` and `hashToNumberSync()` for faster, non-cryptographic algorithms like DJB2, FNV1, MURMER, and CRC32:\n\n```typescript\nimport { hashSync, hashToNumberSync, HashAlgorithm } from '@cacheable/utils';\n\n// Hash using DJB2 (default for sync)\nconst key = hashSync('my-cache-key');\nconsole.log(key); // Unique hash for 'my-cache-key'\n\n// Hash with specific algorithm\nconst fnv1Hash = hashSync('my-data', { algorithm: HashAlgorithm.FNV1 });\n\n// Convert hash to number within range\nconst min = 0;\nconst max = 10;\nconst result = hashToNumberSync({foo: 'bar'}, { min, max, algorithm: HashAlgorithm.DJB2 });\nconsole.log(result); // A number between 0 and 10 based on the hash value\n```\n\n## Available Hash Algorithms\n\n**Cryptographic (Async):**\n- `HashAlgorithm.SHA256` - SHA-256 (default for async methods)\n- `HashAlgorithm.SHA384` - SHA-384\n- `HashAlgorithm.SHA512` - SHA-512\n\n**Non-Cryptographic (Sync):**\n- `HashAlgorithm.DJB2` - DJB2 (default for sync methods)\n- `HashAlgorithm.FNV1` - FNV-1\n- `HashAlgorithm.MURMER` - Murmur hash\n- `HashAlgorithm.CRC32` - CRC32\n\n# Shorthand Time Helpers\n\nThe `@cacheable/utils` package provides a shorthand function to convert human-readable time strings into milliseconds. This is useful for setting time-to-live (TTL) values in caching operations.\n\nYou can also use the `shorthandToMilliseconds` function:\n\n```typescript\nimport { shorthandToMilliseconds } from '@cacheable/utils';\n\nconst milliseconds = shorthandToMilliseconds('1h');\nconsole.log(milliseconds); // 3600000\n```\n\nYou can also use the `shorthandToTime` function to get the current date plus the shorthand time:\n\n```typescript\nimport { shorthandToTime } from '@cacheable/utils';\n\nconst currentDate = new Date();\nconst timeInMs = shorthandToTime('1h', currentDate);\nconsole.log(timeInMs); // Current date + 1 hour in milliseconds since epoch\n```\n\n# Sleep Helper\n\nThe `sleep` function is a utility that allows you to pause execution for a specified duration. This can be useful in testing scenarios or when you need to introduce delays in your code.\n\n```typescript\nimport { sleep } from '@cacheable/utils';\n\nawait sleep(1000); // Pause for 1 second\nconsole.log('Execution resumed after 1 second');\n```\n\n# Stats Helpers\n\nThe `@cacheable/utils` package provides statistics helpers that can be used to track and analyze caching operations. These helpers can be used to gather metrics such as hit rates, miss rates, and other performance-related statistics.\n\n```typescript\nimport { stats } from '@cacheable/utils';\n\nconst cacheStats = stats();\ncacheStats.incrementHits();\nconsole.log(cacheStats.hits); // Get the hit rate of the cache\n```\n\n# Time to Live (TTL) Helpers\n\nThe `@cacheable/utils` package provides helpers for managing time-to-live (TTL) values for cached items. \n\nYou can use the `calculateTtlFromExpiration` function to calculate the TTL based on an expiration date:\n\n```typescript\nimport { calculateTtlFromExpiration } from '@cacheable/utils';\n\nconst expirationDate = new Date(Date.now() + 1000 * 60 * 5); // 5 minutes from now\nconst ttl = calculateTtlFromExpiration(Date.now(), expirationDate);\nconsole.log(ttl); // 300000\n```\n\nYou can also use `getTtlFromExpires` to get the TTL from an expiration date:\n\n```typescript\nimport { getTtlFromExpires } from '@cacheable/utils';\n\nconst expirationDate = new Date(Date.now() + 1000 * 60 * 5); // 5 minutes from now\nconst ttl = getTtlFromExpires(expirationDate);\nconsole.log(ttl); // 300000\n```\n\nYou can use `getCascadingTtl` to get the TTL for cascading cache operations:\n\n```typescript\nimport { getCascadingTtl } from '@cacheable/utils';\nconst cacheableTtl = 1000 * 60 * 5; // 5 minutes\nconst primaryTtl = 1000 * 60 * 2; // 2 minutes\nconst secondaryTtl = 1000 * 60; // 1 minute\nconst ttl = getCascadingTtl(cacheableTtl, primaryTtl, secondaryTtl);\n```\n\n# Run if Function Helper\n\nThe `runIfFn` utility function provides a convenient way to conditionally execute functions or return values based on whether the input is a function or not. This pattern is commonly used in UI libraries and configuration systems where values can be either static or computed.\n\n```typescript\nimport { runIfFn } from '@cacheable/utils';\n\n// Static value - returns the value as-is\nconst staticValue = runIfFn('hello world');\nconsole.log(staticValue); // 'hello world'\n\n// Function with no arguments - executes the function\nconst dynamicValue = runIfFn(() => new Date().toISOString());\nconsole.log(dynamicValue); // Current timestamp\n\n// Function with arguments - executes with provided arguments\nconst sum = runIfFn((a: number, b: number) => a + b, 5, 10);\nconsole.log(sum); // 15\n\n// Complex example with conditional logic\nconst getConfig = (isDevelopment: boolean) => ({\n apiUrl: isDevelopment ? 'http://localhost:3000' : 'https://api.example.com',\n timeout: isDevelopment ? 5000 : 30000\n});\n\nconst config = runIfFn(getConfig, true);\nconsole.log(config); // { apiUrl: 'http://localhost:3000', timeout: 5000 }\n```\n\n# Less Than Helper\n\nThe `lessThan` utility function provides a safe way to compare two values and determine if the first value is less than the second. It only performs the comparison if both values are valid numbers, returning `false` for any non-number inputs.\n\n```typescript\nimport { lessThan } from '@cacheable/utils';\n\n// Basic number comparisons\nconsole.log(lessThan(1, 2)); // true\nconsole.log(lessThan(2, 1)); // false\nconsole.log(lessThan(1, 1)); // false\n\n// Works with negative numbers\nconsole.log(lessThan(-1, 0)); // true\nconsole.log(lessThan(-2, -1)); // true\n\n// Works with decimal numbers\nconsole.log(lessThan(1.5, 2.5)); // true\nconsole.log(lessThan(2.7, 2.7)); // false\n\n// Safe handling of non-number values\nconsole.log(lessThan(\"1\", 2)); // false\nconsole.log(lessThan(1, \"2\")); // false\nconsole.log(lessThan(null, 1)); // false\nconsole.log(lessThan(undefined, 1)); // false\nconsole.log(lessThan(NaN, 1)); // false\n\n// Useful in filtering and sorting operations\nconst numbers = [5, 2, 8, 1, 9];\nconst lessThanFive = numbers.filter(n => lessThan(n, 5));\nconsole.log(lessThanFive); // [2, 1]\n\n// Safe comparison in conditional logic\nfunction processValue(a?: number, b?: number) {\n if (lessThan(a, b)) {\n return `${a} is less than ${b}`;\n }\n return 'Invalid comparison or a >= b';\n}\n```\n\nThis utility is particularly useful when dealing with potentially undefined or invalid numeric values, ensuring type safety in comparison operations.\n\n# Is Object Helper\n\nThe `isObject` utility function provides a type-safe way to determine if a value is a plain object. It returns `true` for objects but `false` for arrays, `null`, functions, and primitive types. This function also serves as a TypeScript type guard.\n\n```typescript\nimport { isObject } from '@cacheable/utils';\n\n// Basic object detection\nconsole.log(isObject({})); // true\nconsole.log(isObject({ name: 'John', age: 30 })); // true\nconsole.log(isObject(Object.create(null))); // true\n\n// Arrays are not considered objects\nconsole.log(isObject([])); // false\nconsole.log(isObject([1, 2, 3])); // false\n\n// null is not considered an object (despite typeof null === 'object')\nconsole.log(isObject(null)); // false\n\n// Primitive types return false\nconsole.log(isObject('string')); // false\nconsole.log(isObject(123)); // false\nconsole.log(isObject(true)); // false\nconsole.log(isObject(undefined)); // false\n\n// Functions return false\nconsole.log(isObject(() => {})); // false\nconsole.log(isObject(Date)); // false\n\n// Built-in object types return true\nconsole.log(isObject(new Date())); // true\nconsole.log(isObject(/regex/)); // true\nconsole.log(isObject(new Error('test'))); // true\nconsole.log(isObject(new Map())); // true\n\n// TypeScript type guard usage\nfunction processValue(value: unknown) {\n if (isObject<{ name: string; age: number }>(value)) {\n // TypeScript now knows value is an object with name and age properties\n console.log(`Name: ${value.name}, Age: ${value.age}`);\n }\n}\n\n// Useful for configuration validation\nfunction validateConfig(config: unknown) {\n if (!isObject(config)) {\n throw new Error('Configuration must be an object');\n }\n \n // Safe to access object properties\n return config;\n}\n\n// Filtering arrays for objects only\nconst mixedArray = [1, 'string', {}, [], null, { valid: true }];\nconst objectsOnly = mixedArray.filter(isObject);\nconsole.log(objectsOnly); // [{}', { valid: true }]\n```\n\nThis utility is particularly useful for:\n- **Type validation** - Ensuring values are objects before accessing properties\n- **TypeScript type guarding** - Narrowing types in conditional blocks\n- **Configuration parsing** - Validating that configuration values are objects\n- **Data filtering** - Separating objects from other data types\n\n# Wrap / Memoization for Sync and Async Functions\n\nThe `@cacheable/utils` package provides two main functions: `wrap` and `wrapSync`. These functions are used to memoize asynchronous and synchronous functions, respectively.\n\n```javascript\nimport { Cacheable } from 'cacheable';\nconst asyncFunction = async (value: number) => {\n return Math.random() * value;\n};\n\nconst cache = new Cacheable();\nconst options = {\n ttl: '1h', // 1 hour\n keyPrefix: 'p1', // key prefix. This is used if you have multiple functions and need to set a unique prefix.\n cache,\n}\nconst wrappedFunction = wrap(asyncFunction, options);\nconsole.log(await wrappedFunction(2)); // 4\nconsole.log(await wrappedFunction(2)); // 4 from cache\n```\nWith `wrap` we have also included stampede protection so that a `Promise` based call will only be called once if multiple requests of the same are executed at the same time. Here is an example of how to test for stampede protection:\n \n```javascript\nimport { Cacheable } from 'cacheable';\nconst asyncFunction = async (value: number) => {\n return value;\n};\n\nconst cache = new Cacheable();\nconst options = {\n ttl: '1h', // 1 hour\n keyPrefix: 'p1', // key prefix. This is used if you have multiple functions and need to set a unique prefix.\n cache,\n}\n\nconst wrappedFunction = wrap(asyncFunction, options);\nconst promises = [];\nfor (let i = 0; i < 10; i++) {\n promises.push(wrappedFunction(i));\n}\n\nconst results = await Promise.all(promises); // all results should be the same\n\nconsole.log(results); // [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n```\n\nIn this example we are wrapping an `async` function in a cache with a `ttl` of `1 hour`. This will cache the result of the function for `1 hour` and then expire the value. You can also wrap a `sync` function in a cache:\n\n```javascript\nimport { CacheableMemory } from 'cacheable';\nconst syncFunction = (value: number) => {\n return value * 2;\n};\n\nconst cache = new CacheableMemory();\nconst wrappedFunction = wrap(syncFunction, { ttl: '1h', key: 'syncFunction', cache });\nconsole.log(wrappedFunction(2)); // 4\nconsole.log(wrappedFunction(2)); // 4 from cache\n```\n\nIn this example we are wrapping a `sync` function in a cache with a `ttl` of `1 hour`. This will cache the result of the function for `1 hour` and then expire the value. You can also set the `key` property in the `wrap()` options to set a custom key for the cache.\n\nWhen an error occurs in the function it will not cache the value and will return the error. This is useful if you want to cache the results of a function but not cache the error. If you want it to cache the error you can set the `cacheError` property to `true` in the `wrap()` options. This is disabled by default.\n\n```javascript\nimport { CacheableMemory } from 'cacheable';\nconst syncFunction = (value: number) => {\n throw new Error('error');\n};\n\nconst cache = new CacheableMemory();\nconst wrappedFunction = wrap(syncFunction, { ttl: '1h', key: 'syncFunction', cacheError: true, cache });\nconsole.log(wrappedFunction()); // error\nconsole.log(wrappedFunction()); // error from cache\n```\n\nIf you would like to generate your own key for the wrapped function you can set the `createKey` property in the `wrap()` options. This is useful if you want to generate a key based on the arguments of the function or any other criteria.\n\n```javascript\n const cache = new Cacheable();\n const options: WrapOptions = {\n cache,\n keyPrefix: 'test',\n createKey: (function_, arguments_, options: WrapOptions) => `customKey:${options?.keyPrefix}:${arguments_[0]}`,\n };\n\n const wrapped = wrap((argument: string) => `Result for ${argument}`, options);\n\n const result1 = await wrapped('arg1');\n const result2 = await wrapped('arg1'); // Should hit the cache\n\n console.log(result1); // Result for arg1\n console.log(result2); // Result for arg1 (from cache)\n```\n\nWe will pass in the `function` that is being wrapped, the `arguments` passed to the function, and the `options` used to wrap the function. You can then use these to generate a custom key for the cache.\n\n# Get Or Set Memoization Function\n\nThe `getOrSet` method provides a convenient way to implement the cache-aside pattern. It attempts to retrieve a value from cache, and if not found, calls the provided function to compute the value and store it in cache before returning it. Here are the options:\n\n```typescript\nexport type GetOrSetFunctionOptions = {\n\tttl?: number | string;\n\tcacheErrors?: boolean;\n\tthrowErrors?: boolean;\n};\n```\n\nHere is an example of how to use the `getOrSet` method:\n\n```javascript\nimport { Cacheable } from 'cacheable';\nconst cache = new Cacheable();\n// Use getOrSet to fetch user data\nconst function_ = async () => Math.random() * 100;\nconst value = await getOrSet('randomValue', function_, { ttl: '1h', cache });\nconsole.log(value); // e.g. 42.123456789\n```\n\nYou can also use a function to compute the key for the function:\n\n```javascript\nimport { Cacheable, GetOrSetOptions } from 'cacheable';\nconst cache = new Cacheable();\n\n// Function to generate a key based on options\nconst generateKey = (options?: GetOrSetOptions) => {\n return `custom_key_:${options?.cacheId || 'default'}`;\n};\n\nconst function_ = async () => Math.random() * 100;\nconst value = await getOrSet(generateKey(), function_, { ttl: '1h', cache });\n```\n\n# How to Contribute\n\nYou can contribute by forking the repo and submitting a pull request. Please make sure to add tests and update the documentation. To learn more about how to contribute go to our main README [https://github.com/jaredwray/cacheable](https://github.com/jaredwray/cacheable). This will talk about how to `Open a Pull Request`, `Ask a Question`, or `Post an Issue`.\n\n# License and Copyright\n[MIT © Jared Wray](./LICENSE)\n","readmeFilename":"README.md"}