{"_id":"@0x26e/utils","_rev":"4-3a1de2db55d1d5da761d9af528a84c1e","name":"@0x26e/utils","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.1":{"name":"@0x26e/utils","version":"1.0.1","keywords":["utils","typescript","helpers"],"author":{"url":"https://github.com/Foysal50x","name":"Foysal Ahmed","email":"foysal20x@gmail.com"},"license":"MIT","_id":"@0x26e/utils@1.0.1","maintainers":[{"name":"0x26e","email":"foysal20x@gmail.com"}],"homepage":"https://github.com/Foysal50x/js-utils","bugs":{"url":"https://github.com/Foysal50x/js-utils/issues"},"dist":{"shasum":"52341abaf8f4a1b0fcd81a05eff7d7817bf19377","tarball":"https://registry.npmjs.org/@0x26e/utils/-/utils-1.0.1.tgz","fileCount":7,"integrity":"sha512-fXX6UapqOI7fm2lFN9qNsMoW2ivvjrX7ValogO74K0t/dDKU4K4gmsGWqq1unTXetbIngSK+3qmAU0qc/2wG9Q==","signatures":[{"sig":"MEQCIA7xcLL47TG64O3sHSoKK104UQM3i8GRKsuGXEI9CJ0vAiB2fCDX3QldeB30Mpf/SAuSu+wo1C8lkGiYExOi5FX49A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5939},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"f3783ad09fa18cec0dba18ee07db03aca5d6eb3f","scripts":{"ci":"npm run build && npm run check-format && npm run check-exports && npm run lint","lint":"tsc","test":"vitest run","build":"tsup","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack . --ignore-rules=cjs-resolves-to-esm","local-release":"changeset version && changeset publish","prepublishOnly":"npm run ci"},"_npmUser":{"name":"0x26e","email":"foysal20x@gmail.com"},"repository":{"url":"git+https://github.com/Foysal50x/js-utils.git","type":"git"},"_npmVersion":"10.5.0","description":"A TypeScript Utility Collection Similar to Laravel Helpers","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.2.4","vitest":"^2.0.5","prettier":"^3.3.3","typescript":"^5.5.4","@changesets/cli":"^2.27.7","@arethetypeswrong/cli":"^0.15.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.1_1725005296905_0.6961840195316249","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@0x26e/utils","version":"1.0.2","keywords":["utils","typescript","helpers"],"author":{"url":"https://github.com/Foysal50x","name":"Foysal Ahmed","email":"foysal20x@gmail.com"},"license":"MIT","_id":"@0x26e/utils@1.0.2","maintainers":[{"name":"0x26e","email":"foysal20x@gmail.com"}],"homepage":"https://github.com/Foysal50x/js-utils","bugs":{"url":"https://github.com/Foysal50x/js-utils/issues"},"dist":{"shasum":"b2493ad85c5e067ad6553993d70adad34dcd5053","tarball":"https://registry.npmjs.org/@0x26e/utils/-/utils-1.0.2.tgz","fileCount":7,"integrity":"sha512-1lH33wtMPXIQIyhemIJg4NOz8WOi1P+mhYm8536ezFFcZAbWak3Wl3OM+qJBb9nXmZvl0uygo8vrn0MxjoUd7A==","signatures":[{"sig":"MEUCIQDV6iKbuBf9kqXZk29qeJsLzna4lCFe9S3hlScshiyi9AIgUfhHG9fKe/dUs+/bUA9DSSvmPrxlMXME3FhblUITbJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5939},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"3d29c0029afe97b2c8b5fbbd3b3a7a5569eed9ff","scripts":{"ci":"npm run build && npm run check-format && npm run check-exports && npm run lint","lint":"tsc","test":"vitest run","build":"tsup","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack . --ignore-rules=cjs-resolves-to-esm","local-release":"changeset version && changeset publish","prepublishOnly":"npm run ci"},"_npmUser":{"name":"0x26e","email":"foysal20x@gmail.com"},"repository":{"url":"git+https://github.com/Foysal50x/js-utils.git","type":"git"},"_npmVersion":"10.5.0","description":"A TypeScript Utility Collection Similar to Laravel Helpers","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.2.4","vitest":"^2.0.5","prettier":"^3.3.3","typescript":"^5.5.4","@changesets/cli":"^2.27.7","@arethetypeswrong/cli":"^0.15.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.2_1725009782968_0.6506017473790979","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@0x26e/utils","version":"1.0.3","keywords":["utils","typescript","helpers"],"author":{"url":"https://github.com/Foysal50x","name":"Foysal Ahmed","email":"foysal20x@gmail.com"},"license":"MIT","_id":"@0x26e/utils@1.0.3","maintainers":[{"name":"0x26e","email":"foysal20x@gmail.com"}],"homepage":"https://github.com/Foysal50x/js-utils","bugs":{"url":"https://github.com/Foysal50x/js-utils/issues"},"dist":{"shasum":"776b7c49035631aaa8669e3c1d5c4ee0fa65dcc4","tarball":"https://registry.npmjs.org/@0x26e/utils/-/utils-1.0.3.tgz","fileCount":7,"integrity":"sha512-wQ5Y6Iz9emrb3ZLPGEjLxgbJAyFrjNQsLuM7BJTfPX3HmNYI3cwL+KU57ZoG+3to4vZt/QHjHo6AQKNyaajY2A==","signatures":[{"sig":"MEYCIQDZBLDQNApD2WHURYpnvsu+DLsxC8LW7L2z7hO9CNGSpQIhANeyrcwrzUBjXNpUteRdVN+BpZMjWqj1Eg6wWmFz3n6C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9077},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"6826a4283d93156d856ba0a144646f95ea321323","scripts":{"ci":"npm run build && npm run check-format && npm run check-exports && npm run lint","lint":"tsc","test":"vitest run","build":"tsup","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack . --ignore-rules=cjs-resolves-to-esm","local-release":"changeset version && changeset publish","prepublishOnly":"npm run ci"},"_npmUser":{"name":"0x26e","email":"foysal20x@gmail.com"},"repository":{"url":"git+https://github.com/Foysal50x/js-utils.git","type":"git"},"_npmVersion":"10.5.0","description":"A TypeScript Utility Collection Similar to Laravel Helpers","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.2.4","vitest":"^2.0.5","prettier":"^3.3.3","typescript":"^5.5.4","@changesets/cli":"^2.27.7","@arethetypeswrong/cli":"^0.15.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.3_1725010057847_0.9592319154427302","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@0x26e/utils","version":"1.0.4","keywords":["utils","typescript","helpers"],"author":{"url":"https://github.com/Foysal50x","name":"Foysal Ahmed","email":"foysal20x@gmail.com"},"license":"MIT","_id":"@0x26e/utils@1.0.4","maintainers":[{"name":"0x26e","email":"foysal20x@gmail.com"}],"homepage":"https://github.com/Foysal50x/js-utils","bugs":{"url":"https://github.com/Foysal50x/js-utils/issues"},"dist":{"shasum":"167b39fb09e83b6f7d63a026b61d52431c4686d0","tarball":"https://registry.npmjs.org/@0x26e/utils/-/utils-1.0.4.tgz","fileCount":7,"integrity":"sha512-5k+aCY6WyN5h9dblBdALKuljgTxRAz0l347iQJna/yKTuwkU1uZCJs/dkhn2Q2Sgvv+xIVWQMvnjDurLIYdJIg==","signatures":[{"sig":"MEUCIGFeqWN37rTpcls0eKyCLa8OzoChrtQADVVRVdG3L972AiEAo1/S1LccV2Up5irNtAcn5U0k0LR2q5Qg/8ijPTydtjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12799},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"946d1242b85722cba84b3a0e095fccae4d6188a8","scripts":{"ci":"npm run build && npm run check-format && npm run check-exports && npm run lint","lint":"tsc","test":"vitest run","build":"tsup","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack . --ignore-rules=cjs-resolves-to-esm","local-release":"changeset version && changeset publish","prepublishOnly":"npm run ci"},"_npmUser":{"name":"0x26e","email":"foysal20x@gmail.com"},"repository":{"url":"git+https://github.com/Foysal50x/js-utils.git","type":"git"},"_npmVersion":"10.5.0","description":"A TypeScript Utility Collection Similar to Laravel Helpers","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.2.4","vitest":"^2.0.5","prettier":"^3.3.3","typescript":"^5.5.4","@changesets/cli":"^2.27.7","@arethetypeswrong/cli":"^0.15.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.4_1725013933776_0.46487178106323745","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@0x26e/utils","version":"1.0.5","description":"A TypeScript Utility Collection Similar to Laravel Helpers","keywords":["utils","typescript","helpers"],"homepage":"https://github.com/Foysal50x/js-utils","bugs":{"url":"https://github.com/Foysal50x/js-utils/issues"},"author":{"name":"Foysal Ahmed","email":"foysal20x@gmail.com","url":"https://github.com/Foysal50x"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Foysal50x/js-utils.git"},"type":"module","main":"dist/index.js","scripts":{"ci":"npm run build && npm run check-format && npm run check-exports && npm run lint","build":"tsup","test":"vitest run","lint":"tsc","format":"prettier --write .","check-format":"prettier --check .","check-exports":"attw --pack . --ignore-rules=cjs-resolves-to-esm","prepublishOnly":"npm run ci","local-release":"changeset version && changeset publish"},"exports":{"./package.json":"./package.json",".":{"import":"./dist/index.js","default":"./dist/index.cjs"}},"devDependencies":{"@arethetypeswrong/cli":"^0.15.4","@changesets/cli":"^2.27.7","prettier":"^3.3.3","tsup":"^8.2.4","typescript":"^5.5.4","vitest":"^2.0.5"},"gitHead":"c6bdb42944ef4ae8edde635e0d201838ba25f826","types":"./dist/index.d.ts","_id":"@0x26e/utils@1.0.5","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-KmtUxhTqmPgLhgGc9Qxo940JF/Yr3tTeWYz0KaaEfujrJmle3VkoY3vJSQTWaOCS9qkWsXM0J/vlvwPghkfkrQ==","shasum":"f8da4f42eb1f2ce2cc7f7b0562bfb98e7d016628","tarball":"https://registry.npmjs.org/@0x26e/utils/-/utils-1.0.5.tgz","fileCount":7,"unpackedSize":43994,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClVtFbU14VKWqbV5mJHbHt9MhzVyLOgVEUNG0XsyMLQgIgKUzVwGE0atb2ZmfhVCULm8xX+ZQFGnwSH+eWjqngb4k="}]},"_npmUser":{"name":"0x26e","email":"foysal20x@gmail.com"},"directories":{},"maintainers":[{"name":"0x26e","email":"foysal20x@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/utils_1.0.5_1725865868021_0.35527248594029603"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-30T08:08:16.795Z","modified":"2024-09-09T07:11:08.327Z","1.0.1":"2024-08-30T08:08:17.110Z","1.0.2":"2024-08-30T09:23:03.138Z","1.0.3":"2024-08-30T09:27:38.072Z","1.0.4":"2024-08-30T10:32:13.903Z","1.0.5":"2024-09-09T07:11:08.165Z"},"bugs":{"url":"https://github.com/Foysal50x/js-utils/issues"},"author":{"name":"Foysal Ahmed","email":"foysal20x@gmail.com","url":"https://github.com/Foysal50x"},"license":"MIT","homepage":"https://github.com/Foysal50x/js-utils","keywords":["utils","typescript","helpers"],"repository":{"type":"git","url":"git+https://github.com/Foysal50x/js-utils.git"},"description":"A TypeScript Utility Collection Similar to Laravel Helpers","maintainers":[{"name":"0x26e","email":"foysal20x@gmail.com"}],"readme":"**@0x26e/utils**\n\nA TypeScript Utility Collection Similar to Laravel Helpers.\n\n## Instalation\n\n```bash\nnpm install @0x26e/utils\n```\n\n## Available Methods\n\n<a name=\"arrays-and-objects-method-list\"></a>\n\n### Arrays & Objects\n\n<div class=\"collection-method-list\" markdown=\"1\">\n\n[crossJoin](#method-array-crossJoin)\n\n<div class=\"collection-method-list\" markdown=\"1\">\n\n[toCssClasses](#method-object-toCssClasses)\n\n</div>\n\n<a name=\"miscellaneous-method-list\"></a>\n\n### Miscellaneous\n\n<div class=\"collection-method-list\" markdown=\"1\">\n\n[blank](#method-blank)\n[sleep](#method-sleep)\n[usleep](#method-usleep)\n[tap](#method-tap)\n[until](#method-until)\n[clamp](#method-clamp)\n\n</div>\n\n<a name=\"arrays\"></a>\n\n## Arrays & Objects\n\n<a name=\"method-array-crossJoin\"></a>\n\n#### `crossJoin()`\n\nReturns the Cartesian product of the given arrays.\nThe Cartesian product of multiple sets is a set of all possible combinations where each combination contains one element from each input array.\n\n```typescript\nconst result = crossJoin([1, 2], ['a', 'b']);\nconsole.log(result);\n// Output: [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]\n```\n\n<a name=\"method-object-toCssClasses\"></a>\n\n#### `toCssClasses()`\n\nThe toCssClasses function conditionally compiles a CSS class string. The method accepts an object of classes where the object key contains the class or classes you wish to add, while the value is a boolean expression. If the object key has a numeric key, it will always be included in the rendered class list:\n\n```typescript\nconst isActive = false;\nconst hasError = true;\nconst classes = toCssClasses([\n  'p-4',\n  { 'font-bold': isActive, 'bg-red': hasError },\n]);\nconsole.log(classes);\n// Output: 'p-4 bg-red'\n```\n\n<a name=\"miscellaneous\"></a>\n\n## Miscellaneous\n\n<a name=\"method-blank\"></a>\n\n#### `blank()`\n\nThe `blank` function determines whether the given value is \"blank\":\n\n    blank('');\n    blank('   ');\n    blank(null);\n    blank(collect());\n\n    // true\n\n    blank(0);\n    blank(true);\n    blank(false);\n\n    // false\n\n<a name=\"method-sleep\"></a>\n\n#### `sleep()`\n\nPauses the execution for a specified number of seconds\n\n```typescript\nawait sleep(2); // Pauses execution for 2 seconds.\n```\n\n<a name=\"method-usleep\"></a>\n\n#### `usleep()`\n\nPauses the execution for a specified number of milliseconds.\n\n```typescript\nawait usleep(500); // Pauses execution for 500 milliseconds.\n```\n\n<a name=\"method-tap\"></a>\n\n#### `tap()`\n\nInvokes an interceptor function with a provided value and returns the result.\n\n```typescript\nconst tappedValue = tap(5, (n) => n * 2); // tappedValue = 10\n```\n\n<a name=\"method-until\"></a>\n\n#### `until()`\n\nContinuously attempts a function until a condition is met.\n\n```typescript\nconst result = await until(\n  () => isConditionTrue(),\n  () => fetchData(),\n  2,\n);\n```\n\n<a name=\"method-clamp\"></a>\n\n#### `clamp()`\n\nReturns a value clamped to the inclusive range of min and max. This function ensures that the `value` falls within the specified range. If the `value`\nis less than `min`, it returns `min`. If the `value` is greater than `max`, it returns `max`.\nOtherwise, it returns the `value` itself.\n\n```typescript\nconst clamped1 = clamp(5, 1, 10);\nconsole.log(clamped1); // 5\n\nconst clamped2 = clamp(15, 1, 10);\nconsole.log(clamped2); // 10 (since 15 is greater than max 10)\nconst clamped3 = clamp(-5, 1, 10);\nconsole.log(clamped3); // 1 (since -5 is less than min 1)\n```\n","readmeFilename":"README.md"}