{"_id":"@37bytes/smart-url-search-params","_rev":"8-cba9d9c89b216b90b917f61056de6d99","name":"@37bytes/smart-url-search-params","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.5":{"name":"@37bytes/smart-url-search-params","version":"1.0.5","keywords":["urlsearchparams","query-string","url-parameters"],"author":{"name":"37bytes"},"license":"MIT","_id":"@37bytes/smart-url-search-params@1.0.5","maintainers":[{"name":"arhonist-37b","email":"naushev@37bytes.com"},{"name":"rispaev","email":"rispaev@37bytes.com"},{"name":"yar_vav","email":"yavavilin@37bytes.com"},{"name":"rteslenko","email":"rteslenko@37bytes.com"},{"name":"tnikolaeva","email":"tnikolaeva@37bytes.com"},{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},{"name":"mgarmash","email":"ops@37bytes.com"}],"homepage":"https://github.com/37bytes/public-packages/tree/master#readme","bugs":{"url":"https://github.com/37bytes/public-packages/issues"},"dist":{"shasum":"0e3100f930affabe7be1abb74344b80e8168a8a5","tarball":"https://registry.npmjs.org/@37bytes/smart-url-search-params/-/smart-url-search-params-1.0.5.tgz","fileCount":9,"integrity":"sha512-0LGn57hyjLo7UccxwsF2qdIDUV8d9yHC2JSYM7CiiHB3skohj0ROfW/xKl1y8NGZVulHd+84ESXXgZlFclC4Lg==","signatures":[{"sig":"MEYCIQCjZpk6GYbmxIrZRlnzBDxsZMjyjSH5Fqjtjv6m4KHQ6QIhAO07m/knasyBCpd42xiLhXAvjh9gzOULxgW4RZsCNb+R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37855},"main":"./build/index.js","types":"./build/index.d.ts","module":"./build/index.mjs","gitHead":"eaa78404b01f51e929dfd0368d5ae0207dbb03b8","scripts":{"test":"jest","build":"rimraf build && tsup","npm-packlist":"npm run build && npx -y npm-packlist@6.0.1"},"_npmUser":{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},"repository":{"url":"git+https://github.com/37bytes/public-packages.git#master","type":"git"},"_npmVersion":"10.2.3","description":"Advanced URLSearchParams with array support, null/undefined handling, and custom query string formatting.","directories":{},"_nodeVersion":"20.8.0","dependencies":{"tsup":"^8.0.1","rimraf":"5.0.5","typescript":"^5.3.3","@jest/globals":"29.7.0"},"typesVersions":{"*":{"./build/index.mjs":["./build/index.d.mts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/smart-url-search-params_1.0.5_1703504193456_0.659462145427198","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@37bytes/smart-url-search-params","version":"1.0.6","keywords":["urlsearchparams","query-string","url-parameters"],"author":{"name":"37bytes"},"license":"MIT","_id":"@37bytes/smart-url-search-params@1.0.6","maintainers":[{"name":"arhonist-37b","email":"naushev@37bytes.com"},{"name":"rispaev","email":"rispaev@37bytes.com"},{"name":"yar_vav","email":"yavavilin@37bytes.com"},{"name":"rteslenko","email":"rteslenko@37bytes.com"},{"name":"tnikolaeva","email":"tnikolaeva@37bytes.com"},{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},{"name":"mgarmash","email":"ops@37bytes.com"}],"homepage":"https://github.com/37bytes/public-packages/tree/master#readme","bugs":{"url":"https://github.com/37bytes/public-packages/issues"},"dist":{"shasum":"195bb760089f05df0816aff78712851c29321468","tarball":"https://registry.npmjs.org/@37bytes/smart-url-search-params/-/smart-url-search-params-1.0.6.tgz","fileCount":9,"integrity":"sha512-YuBLPIz9xFhugdx8tWUSUU+qwzaQK+K6T4/MZXoVayu2IgsPsXBxyrNuuCjssx4sUh9HnSWYhGOel55Wb6T9Hg==","signatures":[{"sig":"MEUCIQCgdVuTJoUTdvBDKEobyAmjFTxGWJW8yfPJSTqKUF1cUQIgF20gtqx8OrMF5NfALryQPAPpauGPJrICXqXm6aWlcXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37563},"main":"./build/index.js","types":"./build/index.d.ts","module":"./build/index.mjs","gitHead":"3b37498b444d69f8c74ea9527b4d71d6fc8ca5b6","scripts":{"test":"jest","build":"rimraf build && tsup","npm-packlist":"npm run build && npx -y npm-packlist@6.0.1"},"_npmUser":{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},"repository":{"url":"git+https://github.com/37bytes/public-packages.git#master","type":"git"},"_npmVersion":"10.2.3","description":"Advanced URLSearchParams with array support, null/undefined handling, and custom query string formatting.","directories":{},"_nodeVersion":"20.8.0","dependencies":{"tsup":"^8.0.1","rimraf":"5.0.5","typescript":"^5.3.3","@jest/globals":"29.7.0"},"typesVersions":{"*":{"./build/index.mjs":["./build/index.d.mts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/smart-url-search-params_1.0.6_1705495642928_0.1077926161095919","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@37bytes/smart-url-search-params","version":"2.0.0","description":"Advanced URLSearchParams with array support, null/undefined handling, and custom query string formatting.","repository":{"type":"git","url":"git+https://github.com/37bytes/public-packages.git","directory":"packages/smart-url-search-params"},"license":"MIT","author":{"name":"37bytes"},"type":"module","sideEffects":false,"exports":{".":{"import":{"types":"./build/index.d.mts","default":"./build/index.mjs"},"require":{"types":"./build/index.d.cts","default":"./build/index.cjs"}}},"main":"./build/index.cjs","module":"./build/index.mjs","types":"./build/index.d.mts","keywords":["urlsearchparams","query-string","url-parameters"],"devDependencies":{"eslint":"9.39.2","tsdown":"0.20.3","typescript":"5.8.3","vitest":"3.2.3","@37bytes/bundler":"0.0.0","@37bytes/code-style":"0.0.1"},"scripts":{"build":"tsdown","test":"vitest run","lint:typescript":"tsc --noEmit","lint:eslint":"eslint --fix --max-warnings 0 .","lint":"pnpm lint:typescript && pnpm lint:eslint","npm-packlist":"pnpm run build && npx -y npm-packlist@6.0.1"},"_id":"@37bytes/smart-url-search-params@2.0.0","bugs":{"url":"https://github.com/37bytes/public-packages/issues"},"homepage":"https://github.com/37bytes/public-packages#readme","_integrity":"sha512-XqQl47nebRqAZ7cRpRqdTQKXRtN/LVfUkm12t6FZUYaGfJBWyDSnjeAxeRwMbqcJzKj+CHQ28uEX9BziAV6jeg==","_resolved":"/private/var/folders/5t/b72kl4gn5fs7rnfrhvh9l6sc0000gn/T/2fcba9c510fd80fcbe9af7a308eb7b42/37bytes-smart-url-search-params-2.0.0.tgz","_from":"file:37bytes-smart-url-search-params-2.0.0.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-XqQl47nebRqAZ7cRpRqdTQKXRtN/LVfUkm12t6FZUYaGfJBWyDSnjeAxeRwMbqcJzKj+CHQ28uEX9BziAV6jeg==","shasum":"551823535deec8dbfc8d34dc4d4a87a775061fc2","tarball":"https://registry.npmjs.org/@37bytes/smart-url-search-params/-/smart-url-search-params-2.0.0.tgz","fileCount":10,"unpackedSize":36834,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD45eoZ0m4DCRVw3V1EbQqkbwrpPGFwLUuHCr+B+XFOggIhANRZ1L1nf1StDgp3m4ba0MUtkrteeMj0ajZJFhntbQ+5"}]},"_npmUser":{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},"directories":{},"maintainers":[{"name":"rteslenko","email":"rteslenko@37bytes.com"},{"name":"mgarmash","email":"ops@37bytes.com"},{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},{"name":"tnikolaeva","email":"tnikolaeva@37bytes.com"},{"name":"arhonist-37b","email":"naushev@37bytes.com"},{"name":"yar_vav","email":"yavavilin@37bytes.com"},{"name":"rispaev","email":"rispaev@37bytes.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/smart-url-search-params_2.0.0_1773171450679_0.4554859589503608"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-25T11:36:33.363Z","modified":"2026-03-10T19:37:31.072Z","1.0.0":"2023-12-25T11:05:59.094Z","1.0.1":"2023-12-25T11:29:44.514Z","1.0.2":"2023-12-25T11:31:31.768Z","1.0.5":"2023-12-25T11:36:33.670Z","1.0.6":"2024-01-17T12:47:23.099Z","2.0.0":"2026-03-10T19:37:30.839Z"},"bugs":{"url":"https://github.com/37bytes/public-packages/issues"},"author":{"name":"37bytes"},"license":"MIT","homepage":"https://github.com/37bytes/public-packages#readme","keywords":["urlsearchparams","query-string","url-parameters"],"repository":{"type":"git","url":"git+https://github.com/37bytes/public-packages.git","directory":"packages/smart-url-search-params"},"description":"Advanced URLSearchParams with array support, null/undefined handling, and custom query string formatting.","maintainers":[{"name":"rteslenko","email":"rteslenko@37bytes.com"},{"name":"mgarmash","email":"ops@37bytes.com"},{"name":"dc.nikolaev","email":"dnikolaev@37bytes.com"},{"name":"tnikolaeva","email":"tnikolaeva@37bytes.com"},{"name":"arhonist-37b","email":"naushev@37bytes.com"},{"name":"yar_vav","email":"yavavilin@37bytes.com"},{"name":"rispaev","email":"rispaev@37bytes.com"}],"readme":"[[English](./README.md)] | [Русский](./README_RU.md)\n\n# @37bytes/smart-url-search-params\n\nA powerful and enhanced version of the standard URLSearchParams, `@37bytes/smart-url-search-params` offers extended capabilities for handling URL query strings. It supports arrays, numbers, and allows for handling null and undefined values, providing a more flexible way to work with URL parameters.\n\n## Features\n\n- **Extended Data Types**: Supports strings, arrays, numbers, null, and undefined values.\n- **Advanced Array Formatting**: Customize how array parameters are represented in the query string.\n- **Compatible with URLSearchParams**: Fully compatible with standard URLSearchParams API.\n\n## Installation\n\n```bash\nnpm install @37bytes/smart-url-search-params\n```\n\n```bash\nyarn add @37bytes/smart-url-search-params\n```\n\n## Usage\n\nImport `SmartURLSearchParams` in your JavaScript or TypeScript file:\n\n```typescript\nimport SmartURLSearchParams from '@37bytes/smart-url-search-params';\n\n// Initializing with various types of values\nconst params = new SmartURLSearchParams({\n    stringParam: 'value',\n    numberParam: 123,\n    arrayParam: ['arrayValue1', 'arrayValue2'],\n    nullParam: null,\n    undefinedParam: undefined\n});\n\n// Example of using toFormattedString for custom array formatting\nconst formattedString = params.toFormattedString({ arrayFormat: 'bracket' });\nconsole.log(formattedString); // Outputs: 'stringParam=value&numberParam=123&arrayParam[]=arrayValue1&arrayParam[]=arrayValue2'\n```\n## Advanced Usage of `toFormattedString`\n\nThe `toFormattedString` method in `SmartURLSearchParams` allows for customized formatting of query strings, especially for array parameters. Here are some examples demonstrating its capabilities:\n\n### Default Array Formatting (No Formatting)\n\n```javascript\nconst params = new SmartURLSearchParams({ items: ['apple', 'banana', 'cherry'] });\nconsole.log(params.toFormattedString({ arrayFormat: 'none' }));\n// Outputs: 'items=apple&items=banana&items=cherry'\n```\n\n### Bracket Array Formatting\n\n```javascript\nconst params = new SmartURLSearchParams({ items: ['apple', 'banana', 'cherry'] });\nconsole.log(params.toFormattedString({ arrayFormat: 'bracket' }));\n// Outputs: 'items[]=apple&items[]=banana&items[]=cherry'\n```\n\n### Index Array Formatting\n\n```javascript\nconst params = new SmartURLSearchParams({ items: ['apple', 'banana', 'cherry'] });\nconsole.log(params.toFormattedString({ arrayFormat: 'index' }));\n// Outputs: 'items[0]=apple&items[1]=banana&items[2]=cherry'\n```\n\n### Comma-Separated Array Formatting\n\n```javascript\nconst params = new SmartURLSearchParams({ items: ['apple', 'banana', 'cherry'] });\nconsole.log(params.toFormattedString({ arrayFormat: 'comma' }));\n// Outputs: 'items=apple,banana,cherry'\n```\n\n### Custom Separator Array Formatting\n\n```javascript\nconst params = new SmartURLSearchParams({ items: ['apple', 'banana', 'cherry'] });\nconsole.log(params.toFormattedString({ arrayFormat: 'separator', arrayFormatSeparator: '|' }));\n// Outputs: 'items=apple|banana|cherry'\n```\n\n### Bracket with Custom Separator Array Formatting\n\n```javascript\nconst params = new SmartURLSearchParams({ items: ['apple', 'banana', 'cherry'] });\nconsole.log(params.toFormattedString({ arrayFormat: 'bracket-separator', arrayFormatSeparator: '|' }));\n// Outputs: 'items[]=apple|banana|cherry'\n```\n","readmeFilename":"README.md"}