{"_id":"@adaskothebeast/http-params-processor-value-to-iso","_rev":"4-0db686579848855809955a6aa961ea38","name":"@adaskothebeast/http-params-processor-value-to-iso","dist-tags":{"latest":"12.0.0"},"versions":{"10.0.0":{"name":"@adaskothebeast/http-params-processor-value-to-iso","version":"10.0.0","_id":"@adaskothebeast/http-params-processor-value-to-iso@10.0.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"dist":{"shasum":"76accb8bc5955759a2aee37ff9d3b181325ee6cc","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-value-to-iso/-/http-params-processor-value-to-iso-10.0.0.tgz","fileCount":23,"integrity":"sha512-J5DrlTJ6B8VJX0OgswtO+fp+oRB0uVc2zCiz3Fb/A+TV/RjhSj27Ug5X2BXphnomGulNdEUA07lfD5tEfYFyhg==","signatures":[{"sig":"MEUCIQDKXayhqC/fgGn0X4403cQKuskNm/qVasuAnYcjFwpljAIgKPtdjve8XxO92JF99NvfDoy5Q6u7B/j4OFeQXmqk3lE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36295},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"1e61d6323f67038b9af916e4f3d263a73fe76497","_npmUser":{"name":"adasko","email":"adaskothebeast@gmail.com"},"_npmVersion":"11.6.2","description":"> Transform complex TypeScript objects into query parameters for Angular, Axios, Fetch, and more","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"peerDependencies":{"@adaskothebeast/http-params-processor-core":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/http-params-processor-value-to-iso_10.0.0_1768077287212_0.5255970744591378","host":"s3://npm-registry-packages-npm-production"}},"11.0.0":{"name":"@adaskothebeast/http-params-processor-value-to-iso","version":"11.0.0","author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/http-params-processor-value-to-iso@11.0.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"dist":{"shasum":"96f9f569113a7005033cda4639d9c3e84e00a74f","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-value-to-iso/-/http-params-processor-value-to-iso-11.0.0.tgz","fileCount":12,"integrity":"sha512-nf8cH4w7UXvX/JGbBymPqgo4oCrmMMKBrqoD+o2DwYJ+JKROcYtJSeQNnGXNE5kC5IILVkjfieFvAHZMYm10WA==","signatures":[{"sig":"MEQCIHJryzC/zBM+e8EVIV24YKa0KH75fOFGpHFy5r3LDYuaAiBfdX40rBSRk1BhzlVeiNo1v0jlJcgO6AUuID01jilI4w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2fhttp-params-processor-value-to-iso@11.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46150},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc61b3e4-e31d-4dcb-885b-86486ecded19"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git","type":"git"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http-params-processor-value-to-iso_11.0.0_1768758180132_0.8424274819400346","host":"s3://npm-registry-packages-npm-production"}},"11.1.0":{"name":"@adaskothebeast/http-params-processor-value-to-iso","version":"11.1.0","author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/http-params-processor-value-to-iso@11.1.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"dist":{"shasum":"8e07935ad33a82d9dd594f2de1a66554051e0959","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-value-to-iso/-/http-params-processor-value-to-iso-11.1.0.tgz","fileCount":12,"integrity":"sha512-3xnvoJCx4fXFztR8/83TaUauatWxBw+LhE/HlcFIFFEPrn4Z0lkl6oDI/Z7DiNW7S3XnM/I8YIYeO2vokKfFvw==","signatures":[{"sig":"MEUCIBRtJsnrUS+FFh66rz1ZEAaT6DnZeSJKZh2gdotCagL/AiEA45a6d0ZY26wNoGb0xE9ZMhsHp4Fetchp15oPSfhaOJA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2fhttp-params-processor-value-to-iso@11.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46150},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc61b3e4-e31d-4dcb-885b-86486ecded19"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git","type":"git"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http-params-processor-value-to-iso_11.1.0_1768758916680_0.1495986430937497","host":"s3://npm-registry-packages-npm-production"}},"12.0.0":{"name":"@adaskothebeast/http-params-processor-value-to-iso","version":"12.0.0","description":"ISO 8601 date, duration and period output strategies for HttpParamsProcessor.","keywords":["http","http-params","query-string","query-params","querystring","nested-objects","serializer","typescript","value-conversion","iso8601","date","duration","period"],"license":"MIT","author":{"name":"Adam Pluciński","email":"adaskothebeast@gmail.com","url":"https://github.com/adaskothebeast"},"repository":{"type":"git","url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git"},"bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","type":"module","sideEffects":false,"main":"./index.cjs","module":"./index.js","types":"./index.d.ts","peerDependencies":{"@adaskothebeast/http-params-processor-core":"^12.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"gitHead":"73d31a6c26a6f2819f6c98aabb36659532e4cdd0","_id":"@adaskothebeast/http-params-processor-value-to-iso@12.0.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-Q7QZIqNDuj9MODea/05IAEGLLLNZjfn16PmbTOAaTqhWA6EmPkh8w4/q3TIRpa3sw3mnLSVUl3QqqHjKBafcMw==","shasum":"3a1cfa8baaa941d9c8beccf4d64ff81c9a64423e","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-value-to-iso/-/http-params-processor-value-to-iso-12.0.0.tgz","fileCount":13,"unpackedSize":18082,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC77J/scf5TN0wk6Pq1fsSvwwVTj+jOch/4s8EW4XFgPAiBa/pOFQOroQXIB2yk73YGNghGUT5wFFgG/KTAxsNdrow=="}]},"_npmUser":{"name":"adasko","email":"adaskothebeast@gmail.com"},"directories":{},"maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http-params-processor-value-to-iso_12.0.0_1785236362428_0.7484017968340091"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-10T20:34:47.117Z","modified":"2026-07-28T10:59:22.748Z","10.0.0":"2026-01-10T20:34:47.370Z","11.0.0":"2026-01-18T17:43:00.260Z","11.1.0":"2026-01-18T17:55:16.835Z","12.0.0":"2026-07-28T10:59:22.565Z"},"bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"author":{"name":"Adam Pluciński","email":"adaskothebeast@gmail.com","url":"https://github.com/adaskothebeast"},"license":"MIT","homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","repository":{"type":"git","url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git"},"maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"readme":"# 🕰️ @adaskothebeast/http-params-processor-value-to-iso\n\n**ISO 8601 output strategies for [HttpParamsProcessor](https://github.com/AdaskoTheBeAsT/HttpParamsProcessor): dates, durations and periods as `2024-01-15T10:30:00.000Z`, `PT1H30M45S`, `P1Y6M15D`.**\n\n[![npm](https://img.shields.io/npm/v/%40adaskothebeast%2Fhttp-params-processor-value-to-iso?color=cb3837&logo=npm)](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-to-iso)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\nNo runtime dependency beyond `core`. ESM + CJS. `sideEffects: false`.\n\n---\n\n## 📦 Install\n\n```bash\nnpm i @adaskothebeast/http-params-processor-value-to-iso @adaskothebeast/http-params-processor-core\n```\n\n---\n\n## 🎯 What it does\n\nThese are **value-to** strategies: the second half of the conversion pipeline. Pair each of them with a **value-from** strategy (`-value-from-luxon`, `-value-from-dayjs`, `-value-from-moment`, `-value-from-js-joda`, or the `DefaultDateValueFromStrategy` from `core`) using `createValueConverter`.\n\n| Class                        | Serializes           | Example output             |\n| ---------------------------- | -------------------- | -------------------------- |\n| `IsoDateValueToStrategy`     | `Date`               | `2024-01-15T10:30:00.000Z` |\n| `IsoDurationValueToStrategy` | `DurationComponents` | `PT1H30M45S`, `P1Y2M3DT4H` |\n| `IsoPeriodValueToStrategy`   | `PeriodComponents`   | `P1Y6M15D`                 |\n\n---\n\n## ⚡ Usage\n\n```ts\nimport { DefaultDateValueFromStrategy, ParamsProcessor, createValueConverter } from '@adaskothebeast/http-params-processor-core';\nimport { LuxonDateTimeValueFromStrategy, LuxonDurationValueFromStrategy } from '@adaskothebeast/http-params-processor-value-from-luxon';\nimport { IsoDateValueToStrategy, IsoDurationValueToStrategy } from '@adaskothebeast/http-params-processor-value-to-iso';\nimport { DateTime, Duration } from 'luxon';\n\nconst processor = new ParamsProcessor({\n  valueConverters: [\n    createValueConverter(new LuxonDateTimeValueFromStrategy(), new IsoDateValueToStrategy()),\n    createValueConverter(new LuxonDurationValueFromStrategy(), new IsoDurationValueToStrategy()),\n    // keep native Dates working too\n    createValueConverter(new DefaultDateValueFromStrategy(), new IsoDateValueToStrategy()),\n  ],\n});\n\nprocessor.process('p', {\n  from: DateTime.fromISO('2024-01-15T10:30:00Z'),\n  window: Duration.fromObject({ hours: 1, minutes: 30, seconds: 45 }),\n});\n// [['p.from', '2024-01-15T10:30:00.000Z'], ['p.window', 'PT1H30M45S']]\n```\n\n---\n\n## 🎛️ Options and formats\n\nNo constructor options - the output format is fixed by ISO 8601.\n\n**Dates** use `Date.prototype.toISOString()`: always UTC (`Z`), always with milliseconds. There is no local-time or offset variant here; if you need a different shape use [`-value-to-date-fns`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-to-date-fns).\n\n**Durations** emit `P[n]Y[n]M[n]W[n]DT[n]H[n]M[n]S`:\n\n| `DurationComponents` input                   | Output       |\n| -------------------------------------------- | ------------ |\n| `{ hours: 1, minutes: 30, seconds: 45 }`     | `PT1H30M45S` |\n| `{ years: 1, months: 2, days: 3, hours: 4 }` | `P1Y2M3DT4H` |\n| `{ weeks: 2 }`                               | `P2W`        |\n| `{ seconds: 1, milliseconds: 500 }`          | `PT1.5S`     |\n| `{ milliseconds: 250 }`                      | `PT0.25S`    |\n| `{}` / all zeros                             | `PT0S`       |\n\n**Periods** emit `P[n]Y[n]M[n]W[n]D`, with `P0D` for an empty period. Periods are calendar-based, so nothing is normalized: `{ months: 18 }` stays `P18M`.\n\n---\n\n## ⚠️ Edge cases\n\n- `IsoDateValueToStrategy.canHandle` rejects **invalid dates** (`new Date('nope')`), so they fall through to the next converter instead of producing `Invalid Date`.\n- Zero and `undefined` components are omitted, which is why `{ hours: 0, minutes: 5 }` becomes `PT5M`.\n- `milliseconds` are folded into the seconds field as a decimal fraction (`PT1.5S`), never emitted as their own designator.\n- Fractional `weeks` are written verbatim (`{ weeks: 1.5 }` → `P1.5W`); convert to days first if your backend is strict.\n- Duration and period detection are **structural** (a plain object with at least one numeric duration/period key). `{ years: 1, months: 6 }` satisfies both strategies, so whichever converter you register first claims it - register the period converter first if such objects should be treated as calendar periods.\n- `PeriodComponents` cannot express time-of-day; hours/minutes/seconds are silently ignored by `IsoPeriodValueToStrategy.canHandle` (such objects are treated as durations instead).\n\n---\n\n## 🔗 Related packages\n\n- Inputs: [`-value-from-luxon`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-from-luxon), [`-value-from-dayjs`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-from-dayjs), [`-value-from-moment`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-from-moment), [`-value-from-js-joda`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-from-js-joda)\n- Other outputs: [`-value-to-nodatime`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-to-nodatime), [`-value-to-unix-timestamp`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-to-unix-timestamp), [`-value-to-ms-timestamp`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-to-ms-timestamp), [`-value-to-date-fns`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-value-to-date-fns)\n- Engine: [`-core`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-core)\n\nFull matrix and adapter recipes: [main README](https://github.com/AdaskoTheBeAsT/HttpParamsProcessor#readme).\n\n---\n\n## 📄 License\n\n[MIT](./LICENSE) © Adam Pluciński\n","readmeFilename":"README.md","description":"ISO 8601 date, duration and period output strategies for HttpParamsProcessor.","keywords":["http","http-params","query-string","query-params","querystring","nested-objects","serializer","typescript","value-conversion","iso8601","date","duration","period"]}