{"_id":"@pivanov/utils","_rev":"46-b5f63b23a72c54a8f191df41ddb80dff","name":"@pivanov/utils","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@pivanov/utils","version":"0.0.1","keywords":["utils","typescript","react","web-components","dom","cache","event-bus","string","object","promise","r2wc","react-to-web-component"],"author":{"url":"https://github.com/pivanov","name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com"},"license":"MIT","_id":"@pivanov/utils@0.0.1","maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"homepage":"https://github.com/pivanov/utils#readme","bugs":{"url":"https://github.com/pivanov/utils/issues"},"dist":{"shasum":"bd9f36849e42ae307e053d30168f4a1cd9b3892a","tarball":"https://registry.npmjs.org/@pivanov/utils/-/utils-0.0.1.tgz","fileCount":6,"integrity":"sha512-JQ/pXeG9/Yq3UuwH2Xp4F6bSAIDGzbxT0Vrg/82tMi3Yp+Ps9AYzjSDE+zfvBRqc7J11V6MMonUrWj4+2dYgrg==","signatures":[{"sig":"MEQCIB31K+qjRljzQ0jxkvla2zVWPuMblonaGq3gQAm0zhj6AiAhkFulBwYs0cYbVS1RsMo3LGjXiSdxTXN5Z2s42PA3FQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63865},"main":"dist/cjs/index.js","type":"module","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"cbc575d4da80269acb05a2a1fd03e0a69526f0e4","scripts":{"lint":"biome lint .","test":"pnpm vitest","build":"rm -rf dist && pnpm rollup -c","check":"biome check . --write","format":"biome format . --write","test:ui":"pnpm vitest --ui","test:coverage":"pnpm vitest --coverage","prepublishOnly":"pnpm build"},"_npmUser":{"name":"pivanov","email":"pafelka@gmail.com"},"repository":{"url":"git://github.com/pivanov/utils.git","type":"git"},"_npmVersion":"9.8.1","description":"A collection of personal utilities to live a happier life","directories":{},"_nodeVersion":"18.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.0.0","devDependencies":{"evt":"^2.4.18","glob":"^11.0.0","husky":"^4.3.0","jsdom":"^25.0.1","react":"^18.3.1","tslib":"^2.7.0","rollup":"^4.23.0","vitest":"^2.1.4","react-dom":"^18.3.1","typescript":"5.7.2","@types/node":"^22.9.0","@vercel/ncc":"0.38.2","@types/react":"^18.3.12","@biomejs/biome":"^1.9.4","@types/react-dom":"^18.3.1","rollup-plugin-dts":"^6.1.1","@vitest/coverage-v8":"^2.1.4","@testing-library/dom":"^10.4.0","rollup-plugin-terser":"^7.0.2","@testing-library/react":"^16.0.1","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^12.1.1","@rollup/plugin-node-resolve":"^15.3.0","@testing-library/react-hooks":"^8.0.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.0.1_1736299784044_0.061382709907555455","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@pivanov/utils","version":"0.0.2","keywords":["utils","typescript","react","web-components","dom","cache","event-bus","string","object","promise","r2wc","react-to-web-component"],"author":{"url":"https://github.com/pivanov","name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com"},"license":"MIT","_id":"@pivanov/utils@0.0.2","maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"homepage":"https://github.com/pivanov/pivanov-utils#readme","bugs":{"url":"https://github.com/pivanov/pivanov-utils/issues"},"dist":{"shasum":"32d7a381d6a837615d4ce6cd92878d4b050953b4","tarball":"https://registry.npmjs.org/@pivanov/utils/-/utils-0.0.2.tgz","fileCount":6,"integrity":"sha512-q9CN0bFWxWgMY5hVVYyBgez1jGiLBa6I+LkG37ycylPhFvEGOOeaADGtUSu46CaZasPnlY8fCdVJZmrgKb1EPA==","signatures":[{"sig":"MEYCIQCIbnnwHrvngUESoNBc9Og8YzlMx9L3UxkDqFmw+6GPewIhAPw5id2mGZafH2NHSv8d33hxP//DVQsRtzw0Y+wisRNi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64419},"main":"dist/cjs/index.js","type":"module","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"70eb8d9a98d9a6386e9c5268b3f9f3a75c47a576","scripts":{"lint":"biome lint .","test":"pnpm vitest","build":"rm -rf dist && pnpm rollup -c","check":"biome check . --write","format":"biome format . --write","test:ui":"pnpm vitest --ui","test:coverage":"pnpm vitest --coverage","prepublishOnly":"pnpm build"},"_npmUser":{"name":"pivanov","email":"pafelka@gmail.com"},"repository":{"url":"git://github.com/pivanov/pivanov-utils.git","type":"git"},"_npmVersion":"9.8.1","description":"A collection of personal utilities to live a happier life","directories":{},"_nodeVersion":"18.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.0.0","devDependencies":{"evt":"^2.4.18","glob":"^11.0.0","husky":"^4.3.0","jsdom":"^25.0.1","react":"^18.3.1","tslib":"^2.7.0","rollup":"^4.23.0","vitest":"^2.1.4","react-dom":"^18.3.1","typescript":"5.7.2","@types/node":"^22.9.0","@vercel/ncc":"0.38.2","@types/react":"^18.3.12","@biomejs/biome":"^1.9.4","@types/react-dom":"^18.3.1","rollup-plugin-dts":"^6.1.1","@vitest/coverage-v8":"^2.1.4","@testing-library/dom":"^10.4.0","rollup-plugin-terser":"^7.0.2","@testing-library/react":"^16.0.1","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^12.1.1","@rollup/plugin-node-resolve":"^15.3.0","@testing-library/react-hooks":"^8.0.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.0.2_1740783612488_0.112764635374351","host":"s3://npm-registry-packages-npm-production"}},"0.0.3-rc.1":{"name":"@pivanov/utils","version":"0.0.3-rc.1","keywords":["utils","typescript","react","web-components","dom","cache","event-bus","string","object","promise","r2wc","react-to-web-component"],"author":{"url":"https://github.com/pivanov","name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com"},"license":"MIT","_id":"@pivanov/utils@0.0.3-rc.1","maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"homepage":"https://github.com/pivanov/pivanov-utils#readme","bugs":{"url":"https://github.com/pivanov/pivanov-utils/issues"},"dist":{"shasum":"48636130ab6c2981a2e81df8533ff1ddef52d32e","tarball":"https://registry.npmjs.org/@pivanov/utils/-/utils-0.0.3-rc.1.tgz","fileCount":6,"integrity":"sha512-wUF/tGskvZuKveMkWJdrGk/K6xH5wPgkUWv8aHnyPH3YoO+qvUdQLbM5qKz0/ASyR33HCKQK3KFIC3Hx/YrFbg==","signatures":[{"sig":"MEUCIGOqjhwUpoeRSiUzA4Jorsivw2KZprXFQkyycGMx06o6AiEA7Fa+/aP+ORy2enXnW7DADXEIyiKdnX7YLOgurSrxJUI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66240},"main":"dist/cjs/index.js","type":"module","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"70eb8d9a98d9a6386e9c5268b3f9f3a75c47a576","scripts":{"lint":"biome lint .","test":"pnpm vitest","build":"rm -rf dist && pnpm rollup -c","check":"biome check . --write","format":"biome format . --write","test:ui":"pnpm vitest --ui","test:coverage":"pnpm vitest --coverage","prepublishOnly":"pnpm build"},"_npmUser":{"name":"pivanov","email":"pafelka@gmail.com"},"deprecated":"This version has been deprecated and will be replaced with a new version. Please update to the latest version.","repository":{"url":"git://github.com/pivanov/pivanov-utils.git","type":"git"},"_npmVersion":"9.8.1","description":"A collection of personal utilities to live a happier life","directories":{},"_nodeVersion":"18.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.0.0","devDependencies":{"evt":"^2.4.18","glob":"^11.0.0","husky":"^4.3.0","jsdom":"^25.0.1","react":"^18.3.1","tslib":"^2.7.0","rollup":"^4.23.0","vitest":"^2.1.4","react-dom":"^18.3.1","typescript":"5.7.2","@types/node":"^22.9.0","@vercel/ncc":"0.38.2","@types/react":"^18.3.12","@biomejs/biome":"^1.9.4","@types/react-dom":"^18.3.1","rollup-plugin-dts":"^6.1.1","@vitest/coverage-v8":"^2.1.4","@testing-library/dom":"^10.4.0","rollup-plugin-terser":"^7.0.2","@testing-library/react":"^16.0.1","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^12.1.1","@rollup/plugin-node-resolve":"^15.3.0","@testing-library/react-hooks":"^8.0.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.0.3-rc.1_1740863036001_0.8706552677499289","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@pivanov/utils","version":"0.0.3","keywords":["utils","typescript","react","dom","cache","browser cache api","event-bus","string","object","promise"],"author":{"url":"https://github.com/pivanov","name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com"},"license":"MIT","_id":"@pivanov/utils@0.0.3","maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"homepage":"https://github.com/pivanov/pivanov-utils#readme","bugs":{"url":"https://github.com/pivanov/pivanov-utils/issues"},"dist":{"shasum":"26199501b4b638cc5340e7608eff60623e009ec5","tarball":"https://registry.npmjs.org/@pivanov/utils/-/utils-0.0.3.tgz","fileCount":6,"integrity":"sha512-3Tm+9/vLTg0rSGfGjmduoeR5JKUk+iWB0vhSDMaadrcbo6+hHxCVZwvvzr7Yq1V9SEwsAQj+D6ffeQXsNWYwyw==","signatures":[{"sig":"MEYCIQD1QX62GGktx/qDeU5yVQkcskFzxmdic0HIu0x40NsPrQIhAOVtYoRdBId7ZRXc7PYtT6p1AT0k9mT84TUpfmIR2naT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53989},"main":"dist/cjs/index.js","type":"module","_from":"file:pivanov-utils-0.0.3.tgz","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"scripts":{"lint":"biome lint .","test":"pnpm vitest","build":"rm -rf dist && pnpm rollup -c","check":"biome check . --write","format":"biome format . --write","test:ui":"pnpm vitest --ui","test:coverage":"pnpm vitest --coverage"},"_npmUser":{"name":"pivanov","email":"pafelka@gmail.com"},"_resolved":"/private/var/folders/33/yx94zk4x45gf12snsr9qq4zw0000gn/T/d29a117b4e79b2845669d733fa4ee269/pivanov-utils-0.0.3.tgz","_integrity":"sha512-3Tm+9/vLTg0rSGfGjmduoeR5JKUk+iWB0vhSDMaadrcbo6+hHxCVZwvvzr7Yq1V9SEwsAQj+D6ffeQXsNWYwyw==","repository":{"url":"git://github.com/pivanov/pivanov-utils.git","type":"git"},"_npmVersion":"10.8.2","description":"A collection of personal utilities to live a happier life","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"evt":"^2.4.18","glob":"^11.0.0","husky":"^4.3.0","jsdom":"^25.0.1","react":"^18.3.1","tslib":"^2.7.0","rollup":"^4.23.0","vitest":"^2.1.4","react-dom":"^18.3.1","typescript":"5.7.2","@types/node":"^22.9.0","@vercel/ncc":"0.38.2","@types/react":"^18.3.12","@biomejs/biome":"^1.9.4","@types/react-dom":"^18.3.1","rollup-plugin-dts":"^6.1.1","@vitest/coverage-v8":"^2.1.4","@testing-library/dom":"^10.4.0","rollup-plugin-terser":"^7.0.2","@testing-library/react":"^16.0.1","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^12.1.1","@rollup/plugin-node-resolve":"^15.3.0","@testing-library/react-hooks":"^8.0.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/utils_0.0.3_1766053326344_0.28572497795313767","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@pivanov/utils","version":"1.0.0","keywords":["utils","typescript","react","dom","cache","browser cache api","event-bus","string","object","promise"],"author":{"url":"https://github.com/pivanov","name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com"},"license":"MIT","_id":"@pivanov/utils@1.0.0","maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"homepage":"https://github.com/pivanov/pivanov-utils#readme","bugs":{"url":"https://github.com/pivanov/pivanov-utils/issues"},"dist":{"shasum":"c2a8f1bf49e557ae456b8fec988867bcd34de5ef","tarball":"https://registry.npmjs.org/@pivanov/utils/-/utils-1.0.0.tgz","fileCount":40,"integrity":"sha512-6+8cC0wRocNVLj3WVfzIewbkGv8sqqfsEdYNz6mFHlQsZODdMHwPyR+QSmcfhyCJrpZ/Fw0cK+svevMAbHxlDQ==","signatures":[{"sig":"MEQCIDDCguw/bXaQoB/ccI14qC5NeGVlTH5TeSHf4q5+a6sAAiAaGxWeZCIHO8h4WO02K1OmR9iJm+tbhkTm8CaEkgvF1Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92249},"main":"./dist/cjs/index.js","type":"module","types":"./dist/types/index.d.ts","module":"./dist/esm/index.js","shasum":"c2a8f1bf49e557ae456b8fec988867bcd34de5ef","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./tools":{"types":"./dist/types/tools/index.d.ts","import":"./dist/esm/tools/index.js","require":"./dist/cjs/tools/index.js"},"./types":{"types":"./dist/types/types/index.d.ts","import":"./dist/esm/types/index.js","require":"./dist/cjs/types/index.js"},"./object":{"types":"./dist/types/object/index.d.ts","import":"./dist/esm/object/index.js","require":"./dist/cjs/object/index.js"},"./string":{"types":"./dist/types/string/index.d.ts","import":"./dist/esm/string/index.js","require":"./dist/cjs/string/index.js"},"./promise":{"types":"./dist/types/promise/index.d.ts","import":"./dist/esm/promise/index.js","require":"./dist/cjs/promise/index.js"},"./assertion":{"types":"./dist/types/assertion/index.d.ts","import":"./dist/esm/assertion/index.js","require":"./dist/cjs/assertion/index.js"}},"scripts":{"lint":"biome lint .","test":"bun test","build":"rm -rf dist && bun run scripts/build.ts && bun x tsc --emitDeclarationOnly","check":"biome check . --write","format":"biome format . --write","publish":"npm publish --access public","docs:dev":"bun x vitepress dev docs","typecheck":"bun x tsc --noEmit","docs:build":"bun x vitepress build docs","docs:preview":"bun x vitepress preview docs","test:coverage":"bun test --coverage","prepublishOnly":"bun run build"},"_npmUser":{"name":"pivanov","email":"pafelka@gmail.com"},"_integrity":"sha512-6+8cC0wRocNVLj3WVfzIewbkGv8sqqfsEdYNz6mFHlQsZODdMHwPyR+QSmcfhyCJrpZ/Fw0cK+svevMAbHxlDQ==","repository":{"url":"git://github.com/pivanov/pivanov-utils.git","type":"git"},"_npmVersion":"10.8.3","description":"A focused collection of TypeScript utilities for modern web development","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.3.1","react-dom":"^18.3.1","vitepress":"~1.5.0","@types/bun":"^1.1.14","typescript":"^5.7.2","@types/react":"^18.3.12","@biomejs/biome":"^2.4.11","@types/react-dom":"^18.3.1","@testing-library/react":"^16.0.1","@happy-dom/global-registrator":"^15.11.7"},"peerDependencies":{"react":">=18","react-dom":">=18"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.0_1776548193415_0.47424619749811603","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@pivanov/utils","version":"1.0.1","description":"A focused collection of TypeScript utilities for modern web development","type":"module","repository":{"type":"git","url":"git://github.com/pivanov/pivanov-utils.git"},"homepage":"https://github.com/pivanov/pivanov-utils#readme","bugs":{"url":"https://github.com/pivanov/pivanov-utils/issues"},"scripts":{"build":"rm -rf dist && bun run scripts/build.ts && bun x tsc --emitDeclarationOnly","test":"bun test","test:coverage":"bun test --coverage","lint":"biome lint .","format":"biome format . --write","check":"biome check . --write","typecheck":"bun x tsc --noEmit","docs:dev":"bun x vitepress dev docs","docs:build":"bun x vitepress build docs","docs:preview":"bun x vitepress preview docs","bench":"bun run bench/index.ts","prepublishOnly":"bun run build && bun run verify:dist","publish":"npm publish --access public","verify:dist":"bun run scripts/verify-dist.ts","verify":"bun run lint && bun run typecheck && bun test && bun run build && bun run verify:dist"},"author":{"name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com","url":"https://github.com/pivanov"},"keywords":["utils","typescript","react","dom","cache","browser cache api","event-bus","string","object","promise"],"license":"MIT","sideEffects":false,"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./assertion":{"types":"./dist/types/assertion/index.d.ts","import":"./dist/esm/assertion/index.js","require":"./dist/cjs/assertion/index.js"},"./cache":{"types":"./dist/types/cache/index.d.ts","import":"./dist/esm/cache/index.js","require":"./dist/cjs/cache/index.js"},"./object":{"types":"./dist/types/object/index.d.ts","import":"./dist/esm/object/index.js","require":"./dist/cjs/object/index.js"},"./promise":{"types":"./dist/types/promise/index.d.ts","import":"./dist/esm/promise/index.js","require":"./dist/cjs/promise/index.js"},"./string":{"types":"./dist/types/string/index.d.ts","import":"./dist/esm/string/index.js","require":"./dist/cjs/string/index.js"},"./tools":{"types":"./dist/types/tools/index.d.ts","import":"./dist/esm/tools/index.js","require":"./dist/cjs/tools/index.js"},"./types":{"types":"./dist/types/types/index.d.ts","import":"./dist/esm/types/index.js","require":"./dist/cjs/types/index.js"}},"peerDependencies":{"react":">=18","react-dom":">=18"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"devDependencies":{"@biomejs/biome":"^2.4.11","@happy-dom/global-registrator":"^15.11.7","@testing-library/react":"^16.0.1","@types/bun":"^1.1.14","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","mitata":"^1.0.34","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.7.2","vitepress":"~1.5.0"},"publishConfig":{"access":"public"},"_id":"@pivanov/utils@1.0.1","gitHead":"7182cdfdf6315421afff8e0a5f1b311ce9fccb0b","_nodeVersion":"22.22.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-bqpJ3goylnwqZIsY9zVKe27EiBUEB4zASP+TQc3ALVWZ+FeMOZtDHoFrMnDdDgL5F6tZD4kTAsPvLGwW705qBQ==","shasum":"d4472324ceb04e174bd7de3cb68d08eb86138d97","tarball":"https://registry.npmjs.org/@pivanov/utils/-/utils-1.0.1.tgz","fileCount":46,"unpackedSize":109676,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHa/DRlXODaCM0KlqKzXgK2i5XLNm0lpZV2EdEccYSe/AiEA2FdJwu1kjbpoDRUkTtGBJM1Om+Tty87ckv8ETIW6m7k="}]},"_npmUser":{"name":"pivanov","email":"pafelka@gmail.com"},"directories":{},"maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utils_1.0.1_1788026677665_0.3985801515415561"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-08T17:34:49.766Z","modified":"2026-08-29T18:04:37.988Z","0.0.1-rc-001":"2024-11-08T17:04:07.041Z","0.0.1-rc-002":"2024-11-08T17:26:28.470Z","0.0.1-rc-003":"2024-11-08T17:34:50.094Z","0.0.1-rc-004":"2024-11-08T17:37:28.236Z","0.0.1-rc-005":"2024-11-08T17:46:00.485Z","0.0.1-rc-006":"2024-11-08T17:49:33.264Z","0.0.1-rc-007":"2024-11-08T21:11:12.158Z","0.0.1-rc-008":"2024-11-08T21:24:49.767Z","0.0.1-rc-009":"2024-11-08T21:41:27.800Z","0.0.1-rc-0010":"2024-11-08T22:23:40.560Z","0.0.1-rc-0011":"2024-11-08T22:46:24.679Z","0.0.1-rc-0012":"2024-11-08T23:13:33.437Z","0.0.1-rc-0013":"2024-11-08T23:27:29.460Z","0.0.1-rc-0014":"2024-11-09T00:06:21.050Z","0.0.1-rc-0015":"2024-11-09T00:09:48.114Z","0.0.1-rc-0016":"2024-11-09T00:11:51.307Z","0.0.1-rc-0017":"2024-11-09T00:54:07.158Z","0.0.1-rc-0018":"2024-11-09T00:58:07.748Z","0.0.1-rc-0019":"2025-01-08T00:57:18.168Z","0.0.1":"2025-01-08T01:29:44.218Z","0.0.2":"2025-02-28T23:00:12.695Z","0.0.3-rc.1":"2025-03-01T21:03:56.244Z","0.0.3":"2025-12-18T10:22:06.503Z","1.0.0":"2026-04-18T21:36:33.553Z","1.0.1":"2026-08-29T18:04:37.829Z"},"bugs":{"url":"https://github.com/pivanov/pivanov-utils/issues"},"author":{"name":"Pavel Ivanov","email":"iweb.ivanov@gmail.com","url":"https://github.com/pivanov"},"license":"MIT","homepage":"https://github.com/pivanov/pivanov-utils#readme","keywords":["utils","typescript","react","dom","cache","browser cache api","event-bus","string","object","promise"],"repository":{"type":"git","url":"git://github.com/pivanov/pivanov-utils.git"},"description":"A focused collection of TypeScript utilities for modern web development","maintainers":[{"name":"pivanov","email":"pafelka@gmail.com"}],"readme":"# @pivanov/utils\n\n<p align=\"center\">\n  <i>A focused collection of TypeScript utilities for modern web development.</i>\n  <br /><br />\n  <img src=\"https://img.shields.io/npm/v/@pivanov/utils?logo=npm\" alt=\"NPM Version\" />\n  &nbsp;\n  <img src=\"https://img.shields.io/npm/dw/@pivanov/utils\" alt=\"Weekly Downloads\" />\n  &nbsp;\n  <img src=\"https://github.com/pivanov/pivanov-utils/actions/workflows/ci.yml/badge.svg?branch=main\" alt=\"CI Status\" />\n  &nbsp;\n  <img src=\"https://codecov.io/github/pivanov/pivanov-utils/graph/badge.svg?token=EPRKTP7D79\" alt=\"Coverage Status\" />\n</p>\n\n## Features\n\n- **Fully typed** - strict TypeScript across every module, literal-type preserving where it matters\n- **Tree-shakeable** - ESM + CJS + per-module subpath exports, `\"sideEffects\": false`\n- **Zero dependencies** - React is an optional peer dep only for the `useEventBus` hook\n- **Well tested** - 200+ tests, real edge cases (circular refs, typed arrays, Buffers, symbols)\n\n## Installation\n\n```bash\nbun add @pivanov/utils\n```\n\n```bash\nnpm install @pivanov/utils\n```\n\n```bash\nyarn add @pivanov/utils\n```\n\n```bash\npnpm add @pivanov/utils\n```\n\n## Quick start\n\n```ts\nimport { camelCase, snakeCase, slugify } from '@pivanov/utils/string';\nimport { pick, groupBy, deepMerge } from '@pivanov/utils/object';\nimport { isString, isNil, isDefined } from '@pivanov/utils/assertion';\nimport { sleep, timeout, retry, parallelLimit } from '@pivanov/utils/promise';\nimport { deepClone, isEqual, busDispatch, useEventBus } from '@pivanov/utils/tools';\n```\n\n## What's inside\n\n| Module | Surface |\n|---|---|\n| `assertion` | `isString`, `isNumber`, `isBoolean`, `isFunction`, `isObject`, `isRecord`, `isNull`, `isUndefined`, `isNil`, `isDefined`, `isArray`, `isDate`, `isRegExp`, `isError`, `isPromise`, `isMap`, `isSet`, `isPrimitive`, `isEmpty` |\n| `object` | `pick`, `omit`, `pickBy`, `omitBy`, `merge`, `deepMerge`, `mapValues`, `mapKeys`, `groupBy`, `invert`, `hasOwn`, `keysOf`, `entriesOf`, `fromEntries` |\n| `promise` | `sleep`, `timeout`, `retry`, `defer`, `parallelLimit` - all AbortSignal-aware where relevant |\n| `string` | `camelCase`, `pascalCase`, `kebabCase`, `snakeCase`, `titleCase`, `slugify`, `capitalize`, `uncapitalize`, `capitalizeFirstLetter`, `truncate`, `escapeHtml`, `escapeRegExp`, `words`, `lines` |\n| `tools/deepClone` | Rich deep clone (prototypes, getters/setters, symbols, Buffers, TypedArrays, circular refs) |\n| `tools/isEqual` | Deep equality with cycle detection; compares RegExp, Error, TypedArrays, ArrayBuffer |\n| `tools/dom` | `isBrowser`, `checkVisibility`, `isInViewport`, `setStyleProperties`, `calculateRenderedTextWidth` |\n| `cache` | Cache Storage helpers: JSON metadata with optional TTL, plus raw `Request`/`Response` caching. Shipped as a standalone `@pivanov/utils/cache` entry point |\n| `tools/eventBus` | `busDispatch`, `busSubscribe`, `busOnce`, `useEventBus` - typed topics, optional error handler |\n| `types` | `TDict`, `TObjType`, `DeepPartial`, `DeepReadonly`, `Mutable`, `Prettify` |\n\nSee the full **[API documentation](https://pivanov.github.io/pivanov-utils/)**.\n\n## Tree shaking\n\nSubpath imports give the smallest bundles:\n\n```ts\nimport { camelCase } from '@pivanov/utils/string';\nimport { deepClone } from '@pivanov/utils/tools';\n```\n\nTop-level imports tree-shake fine in modern bundlers:\n\n```ts\nimport { camelCase, deepClone } from '@pivanov/utils';\n```\n\n## A few highlights\n\n### Async that cancels\n\n```ts\nimport { sleep, timeout, retry } from '@pivanov/utils/promise';\n\nconst ctrl = new AbortController();\nawait sleep(1000, ctrl.signal);                          // cancellable\nawait timeout(fetch('/slow'), 3000);                     // race with timer\nawait retry(() => fetch('/api'), { attempts: 5, backoff: (n) => 100 * 2 ** n });\n```\n\n### Typed event bus\n\n```ts\nimport { busDispatch, useEventBus, type IEventBus } from '@pivanov/utils/tools';\n\ninterface UserLoggedIn extends IEventBus<{ id: number; name: string }> {\n  topic: 'user:logged-in';\n}\n\nuseEventBus<UserLoggedIn>('user:logged-in', (user) => console.log(user.name));\nbusDispatch<UserLoggedIn>('user:logged-in', { id: 1, name: 'Ada' });\n```\n\nSee the [Typed Events guide](https://pivanov.github.io/pivanov-utils/guides/typed-events) for an event-map pattern at scale.\n\n### Cache with TTL\n\n```ts\nimport {\n  storageSetItemWithTTL,\n  storageGetItemWithTTL,\n} from '@pivanov/utils/cache';\n\nawait storageSetItemWithTTL('app', 'token', 'abc123', 10 * 60 * 1000);\n\nconst token = await storageGetItemWithTTL<string>('app', 'token');\n// null if missing or expired; expired entries are deleted on read\n```\n\n### Raw response caching in a service worker\n\n`@pivanov/utils/cache` is built as its own bundle with no React, no event bus and\nno DOM helpers, so a service worker can import it without dragging the rest of\nthe package in. Alongside the JSON helpers it exposes a raw layer that stores a\n`Response` byte for byte, preserving body, status and headers.\n\n```ts\nimport {\n  cacheDelete,\n  cacheMatchResponse,\n  cacheNames,\n  cachePutResponse,\n} from '@pivanov/utils/cache';\n\nconst CACHE = 'assets-v3';\n\nself.addEventListener('fetch', (event: FetchEvent) => {\n  event.respondWith((async () => {\n    const hit = await cacheMatchResponse(CACHE, event.request);\n    if (hit) {\n      return hit;\n    }\n\n    const response = await fetch(event.request);\n    await cachePutResponse(CACHE, event.request, response); // caches a clone\n    return response;                                        // still readable\n  })());\n});\n\n// Revision cleanup\nconst outdated = (await cacheNames()).filter((name) => name !== CACHE);\nawait Promise.all(outdated.map(cacheDelete));\n```\n\n### Deep clone that actually preserves shape\n\n```ts\nimport { deepClone } from '@pivanov/utils/tools';\n\nclass User {\n  constructor(public name: string) {}\n  greet() { return `hi ${this.name}`; }\n}\n\nconst clone = deepClone(new User('Ada'));\nclone instanceof User; // true\nclone.greet();         // 'hi Ada'\n```\n\n## Compatibility\n\n- Modern browsers (ES2022)\n- Bun, Node 18+ (ESM or CJS)\n- Cache API requires browser support (Chrome 40+, Firefox 41+, Safari 11.1+)\n- React hook requires React 18+\n\n## Development\n\n```bash\nbun install\nbun test                # run tests\nbun run test:coverage   # with coverage (lcov)\nbun run typecheck\nbun run lint\nbun run build           # ESM + CJS + .d.ts\nbun run docs:dev        # run VitePress docs site locally\n```\n\n## Sponsors\n\nSupported by [LogicStar AI](https://logicstar.ai/)\n\n## License\n\nMIT © [Pavel Ivanov](https://github.com/pivanov)\n","readmeFilename":"README.md"}