{"_id":"@auth70/bodyguard","_rev":"24-78b7bc0badd643d29147d5ef7616ed6f","name":"@auth70/bodyguard","dist-tags":{"latest":"1.8.1"},"versions":{"1.0.0":{"name":"@auth70/bodyguard","version":"1.0.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.0.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"82ba7ca0002d01417a9bec29cfbe5174e591b8c9","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.0.0.tgz","fileCount":9,"integrity":"sha512-Qc5Di1Xgp3KEn/zPO51mRXK3NHPuWmgvGpvKOZNMm+V9dhcP9HmxGevLmeuBEunl/8YD4yJKNUkbHJcCkHLpMA==","signatures":[{"sig":"MEYCIQDIgbk7PyDRnMApzzfP+3uSULiJVVEpPHOqc3u8Mid2+QIhAKQ0kyDxY5gv1hgylCvLRxoFCDnGJK3HI921zboJLo5w","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33911},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"dc6cda90ca60bd2b454c68589870328f3c688261","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"A simple ESM-only streaming parser for Request objects that denies requests with a body too large, too many keys or with excessive nesting","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.0.0_1692244296795_0.7060160466955197","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@auth70/bodyguard","version":"1.1.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"8ddcf61d56f6840897f62c01e4f0ee12ac2584a1","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.0.tgz","fileCount":9,"integrity":"sha512-68+suibkvOMYLjDf1fwYijE+wLoQgjRu2XuqlaxHICY/vOww1ztsnNnkqMfhB38y228F19RO6mvAYmMbE3ARXg==","signatures":[{"sig":"MEUCIQDzZbk1GpIaiBXPqTzQ6r1EAgI6smLDqo/hXBCq3B8SHgIgWYjr4GrOkvLlV4svhDv8Ke3V07q31bD3A7+Hc+6NQkE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39004},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4d994c194e1f7bf3a5140f6858f46167cff9e2f0","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.0_1692296801804_0.7448305394892669","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@auth70/bodyguard","version":"1.1.1","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.1","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"bfa8dba77db04056dc095c9843746b96f370b903","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.1.tgz","fileCount":9,"integrity":"sha512-OksQ7nVKnzhiljENghuP3HiEIUhxOK4HDcmK7OVVM+RoHrRgVwjMkBiR02bkrRQFAawMpgR4QyLPIAJFoLPGbw==","signatures":[{"sig":"MEUCIQCzNAIYunTi3MayQ8BFgKkEPznmpgkuXMV3aHI6TxQzsAIgB0tKe08OZY8FcXiMDWqBM3xxBk9RPT4l9p7r5SPH43Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40910},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"42e48a1cadf861b2ad9f90b25b901cfbc74e8b74","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.1_1692319346262_0.7278488725274328","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@auth70/bodyguard","version":"1.1.2","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.2","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"aa5f9c26e6b8f21bb53e49575d685e57fd0e115c","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.2.tgz","fileCount":9,"integrity":"sha512-eM4RG+JZNzYKZKhIk8jPQzxvu6YGkVrMfoXpnVKAV72VHAVjuBQ5lupwS2p9qc+oWMu+2WNjLZKXI5Pqnl9wNg==","signatures":[{"sig":"MEUCIAtG8PLZymP7F3EJ20M5HvA+EwHtpvy4InFrk4JgZKD0AiEAykU7L5OTUxJS96Dvo/I/Iy1XPpubswpwGx0ZaLEXfw4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40910},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"42e48a1cadf861b2ad9f90b25b901cfbc74e8b74","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.2_1692319445224_0.4060052017772897","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"@auth70/bodyguard","version":"1.1.3","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.3","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"776d9d1316a21ecb85d965ad2e972df001204585","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.3.tgz","fileCount":9,"integrity":"sha512-MhoyOhLLP2KHIogR8K4kSRIJr6kpwGr1UdX0m/maZYLjKw7eMIGkyJTRQmOmaUMsRLUr6e6f0NWxGM9U8xQTfw==","signatures":[{"sig":"MEYCIQCO96pzDwHYwLfgy6zbThRAo/k7sCdsfKuW1zFG47bTkQIhAObSBMBdNt9+rAG6DpsdvhwUqJvX/kU+58k+EjQkp2VW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40878},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"9ba677a0e5ce2d6dda0f309837704dff4c5370e5","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.3_1692323184509_0.8035512110638869","host":"s3://npm-registry-packages"}},"1.1.4":{"name":"@auth70/bodyguard","version":"1.1.4","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.4","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"8ca16bea865f5a2235e015ee79202992f988f402","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.4.tgz","fileCount":9,"integrity":"sha512-VSp+FAPEYCrkV6WYFERSozlr/9q4vzfk3jLAnnTdbMmvANPm/63FJIwlZwgktgrIqLcNp8U7v3dJ3WEEbdQ4Ig==","signatures":[{"sig":"MEQCIAlUCP29tr3GGSOiVavbEBOupH916xyi0yZaYHl+13BZAiAMSJQmxIl+pgJBCWf4Sp+VQ2/rsToKQBAHy0w2Ug+ivQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41060},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"25ffff8dfb9daf22690f92c858b741df9681a6fa","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.4_1692323266035_0.19969670190559996","host":"s3://npm-registry-packages"}},"1.1.5":{"name":"@auth70/bodyguard","version":"1.1.5","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.5","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"1d615a9e5a4c946e65ec5b27fdb5871dcf68de63","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.5.tgz","fileCount":9,"integrity":"sha512-gvVsPwtCWEU8uq6Vutk7txHY08LP2BwJmUsS9/Ko8osiD61Ok/NENcNioLtnv4cNWBzwBz+6alNwoFSr2+7SJw==","signatures":[{"sig":"MEQCIEN1oN6qpFaGZy27bMQytv9l7GFEpS36go2th533G9jHAiByQpYFInTyhri709mSrDM3P58vsCHYiRNfHzcNPk7yrg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41855},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"25ffff8dfb9daf22690f92c858b741df9681a6fa","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.5_1692417291177_0.3736516169025108","host":"s3://npm-registry-packages"}},"1.1.6":{"name":"@auth70/bodyguard","version":"1.1.6","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.1.6","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"989fff8375f26cf32a389bd88499d7d7290e4df8","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.1.6.tgz","fileCount":9,"integrity":"sha512-hVmJeOOpbAnLr+bXcUkM9N+tLw2GZmviT2hRab8L3PkZgX1SMBgFCzyIHKcBlYjutZ6xlsjYC0fj3cgfnO8mng==","signatures":[{"sig":"MEYCIQCscBXV59ErrCzRifBNWPbCYa08Ab8lJqi7v1lsVLkAbgIhAPyMomHmqdUvb2RLFSbETdA8DhAWkdUJNeiwfyCaYTFg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41060},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"af6c122972725da8601e82cff574e1a609293e4d","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"9.6.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"19.9.0","dependencies":{"@streamparser/json":"^0.0.16","@exact-realty/multipart-parser":"^1.0.8"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.1.6_1692488354852_0.24985852498008332","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@auth70/bodyguard","version":"1.2.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.2.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"98344174a668f8a4011bbcd47f4651bbf45d7fb3","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.2.0.tgz","fileCount":9,"integrity":"sha512-73foCxBrMoELMNTU6z3JkA0NR3ihP0NcA+ru/baRcfaEnlBIHpW95TqhCXZT6qLjAjyzmKiiSSOqGvHtQ1QCGA==","signatures":[{"sig":"MEUCIBqvXXhIjhUGaTpi64mRzJGm4d8oIjXUMuSLyPUJHl2XAiEAwP+5WemQ2FTMpIsXouGZRYhgr05D6tb6SqqNi/3wlms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41245},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"628fd83485687cee40ec9771b878c982e8c49fd0","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"20.10.0","dependencies":{"@streamparser/json":"^0.0.18","@exact-realty/multipart-parser":"^1.0.10"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.2.0_1702484235537_0.5522929330843054","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"@auth70/bodyguard","version":"1.3.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.3.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"2191ff60ea68a244c702fefd021ef4bb4dc254f7","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.3.0.tgz","fileCount":9,"integrity":"sha512-yFBS6pxCONOyLibrdtUIa1aTCOI4iUmgiafR9BVv5qnzDwNeLIPXf7XU7DVdHvrEhg6XtMf1HnFYhhl6KxZQPw==","signatures":[{"sig":"MEUCIQDprWJw+btfcGukLGkgS275lmPfSYmc9YCap47AYYTznwIgAxke6tN6wfk8lUJbHAZuleWSDXI/bowjk7Y7udxdeMs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":54760},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0dc333b4503fa43d4004972d12cea75692f60e94","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"20.10.0","dependencies":{"@streamparser/json":"^0.0.18","@exact-realty/multipart-parser":"^1.0.10"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.3.0_1702668712011_0.8163317732879183","host":"s3://npm-registry-packages"}},"1.3.1":{"name":"@auth70/bodyguard","version":"1.3.1","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.3.1","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"071f18ac0625c3be2320e062a887a66d2ebd342c","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.3.1.tgz","fileCount":9,"integrity":"sha512-nof4HCmA+/Nbb4+5/BVCHXt5d3NloVxx7wVDLJ0RoGmTFGEJRzehpzUJaevthXFJKEtVGqJbkDcfAoW7WxHVNQ==","signatures":[{"sig":"MEUCIQCjHPOnqHOWaYa/n8KQp/jsUYa6ItbWy/KSXQlhfkyn4AIgDHv9TCmGEOtr5/StreeDF58GjS5/FUgVdc0GId2BFDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55064},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"bc88a654cc806625a8e03c66a7757d67f7c51be5","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"20.10.0","dependencies":{"@streamparser/json":"^0.0.18","@exact-realty/multipart-parser":"^1.0.10"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.3.1_1703630309565_0.36759678988581124","host":"s3://npm-registry-packages"}},"1.3.2":{"name":"@auth70/bodyguard","version":"1.3.2","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.3.2","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"cbd4e40876fc55187a6d289b2cbb32c0f11ad497","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.3.2.tgz","fileCount":9,"integrity":"sha512-SNzWjPxDUacK4A0cjaobGUQkgm87hVYmB0gzx7oAgeUR6TItlBIFxkW+7Xgco5uWmNIjauLhLaP1TgPEE+rvWw==","signatures":[{"sig":"MEYCIQChiRva10RDVZoqfp9n0wZuWR7ES02la3hNPykWfbP0hwIhAJ15BIIjkBiKGwtErOUgDNL4/bZqw598wH8Man20IOGy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55024},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"47742c9608496ad5fced0e25162069a483e8ce27","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"rm -rf dist && tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.3","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"20.10.0","dependencies":{"@streamparser/json":"^0.0.18","@exact-realty/multipart-parser":"^1.0.10"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.3.2_1703631989388_0.5164034835619751","host":"s3://npm-registry-packages"}},"1.4.0":{"name":"@auth70/bodyguard","version":"1.4.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.4.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"d8ead991a2a930c9fc304e9809d1a86dd9250266","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.4.0.tgz","fileCount":9,"integrity":"sha512-fC+NDB5SyvkdQf4kzB1SULfhctVQRvwgPqnqhbdKja40tAMf6ZcCUuIhM45DNFqV6cuiuFMcK/G1MGAJzE4gYg==","signatures":[{"sig":"MEUCIC29QununKxPXDMwlIK6kuGKPsghsYCwZYnjgqCI53FCAiEA4SoSi1klP2aoaqmERzdwF2GyrcJJBFwKrf8IhgOJZJE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":58602},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7a0841d33f4147158772ba8ca0b4239e1a52a177","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.4.0_1708378201516_0.41089751820767706","host":"s3://npm-registry-packages"}},"1.5.0":{"name":"@auth70/bodyguard","version":"1.5.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.5.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"454b0bf3ad850764594c050fc7705fc062034b6e","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.5.0.tgz","fileCount":9,"integrity":"sha512-p113/drNjcJdgBYFACp8w+6OHyL5yn8kALFi2D+dR7L6cGtrZfEWNbueSLMjWI8whn5pPTH7E11aI5oE7jNVgw==","signatures":[{"sig":"MEQCIE+jM+nNu5YcHBvWWqZNLsmIFX3CuFEdEwrMRTf5K0cUAiAx56uebdFZh9T7KY39/SWh54tNVuP4lwFMQuetc0bvNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61921},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1867b09f1a825a33f7425260e5434afa99641336","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.5.0_1708388097743_0.6367153231326541","host":"s3://npm-registry-packages"}},"1.5.1":{"name":"@auth70/bodyguard","version":"1.5.1","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.5.1","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"5d148aa7afaa6637dd7b3e746ea6ae3a66a8311a","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.5.1.tgz","fileCount":9,"integrity":"sha512-P8kA+9VnJpga5gk1t339J8HogFsiWgWHgwGcWHXvoaHJR7X6GHflzsdOTSvltKxiwgY4cRHHq9QdHDQsURAFJg==","signatures":[{"sig":"MEQCIHu+JdA55knLxILactjMdDbZJqnPPmxP//8slwh6eU30AiBlt28cCJ9OYoG4rjTpZU6BvEZZhGDiNaOniCyvGkcE8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61942},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"dd57258497ac8f7096e5dd759d50ea2d7edd5eec","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.5.1_1712121395690_0.13785179657309743","host":"s3://npm-registry-packages"}},"1.5.2":{"name":"@auth70/bodyguard","version":"1.5.2","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.5.2","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"2bb5e318eee34c49f385de00975dd312eb650e39","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.5.2.tgz","fileCount":9,"integrity":"sha512-p4GLLZwhhNMHKP6vmZsyICkz7U28FhfZpAwMeT5gfkDM/tiZXqCwutv30mjHgRTWGmvcxq+dsrTSZ91f9qEGUQ==","signatures":[{"sig":"MEUCICifavPqGk/A4Lk71vUmAIf8iAGTJzS3XwzhBSjJxkJWAiEA9pwYcgNvwC0bRL05tmDKiDu0jmeEPPErrnNfT1ON5mw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64095},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2362e602a05332f0f0a5054a72c1464efb52bbdb","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.5.2_1712123255001_0.19534098894681562","host":"s3://npm-registry-packages"}},"1.6.0":{"name":"@auth70/bodyguard","version":"1.6.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.6.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"c6b2b190f17b4abd1834b03e80681e751d3f22ce","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.6.0.tgz","fileCount":9,"integrity":"sha512-oKullsLChCufxQ0jLg/6fdO4ir6nDdaR4/Uu/Rm1uW/j2JIntEjcYeAsqQpzVxBnqJk5EFLIWMEK3nbAU4XgSg==","signatures":[{"sig":"MEQCIEMRrWagWls4NdCf1iJb1/QznG3WFrO6BigMhU8tjS85AiA51nG1oAauQNFMwXNIkvcT3+QNd4n6uotiPE7a1uhinQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65103},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2362e602a05332f0f0a5054a72c1464efb52bbdb","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","zod":"^3.22.4","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.6.0_1712314601038_0.17085546401101226","host":"s3://npm-registry-packages"}},"1.6.1":{"name":"@auth70/bodyguard","version":"1.6.1","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.6.1","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"b6be1e1e765cd5ab7223575aec07fac0ea224dad","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.6.1.tgz","fileCount":9,"integrity":"sha512-dVloZK7SXqON1yZYzO8Hl1phYki2Hn9tC02AbaCl50pYeUxx0m7iFayi87U3sxHKgk1PiioBgwvoj/0iT+fD3Q==","signatures":[{"sig":"MEUCIQCbQIRoGjLluGNFwgLZ3CMa6POQKz/3bwVlHjCt2JK6XQIgXGHH6Gmu5XQ/41FHhTb+xkSJix4ezxMid096xr0/81s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65103},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4cf151a4aa281bf454a03b3222dedba4702b16fc","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.13"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","zod":"^3.22.4","typescript":"^5.4.4"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.6.1_1712314924496_0.6129620544604191","host":"s3://npm-registry-packages"}},"1.6.2":{"name":"@auth70/bodyguard","version":"1.6.2","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.6.2","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"5914ba0bd1c7180904b02d3e517338b57618b888","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.6.2.tgz","fileCount":9,"integrity":"sha512-xvzHT1SagqiXMiFG7/sS+w3JRqXJuCO+J11yF3VoiN3bCvS41Qfhazpn07fieW98cPLHXhu+4eP+CILWhH76ug==","signatures":[{"sig":"MEUCIQD28k0VhE6Zq+WpcRB4F4N2QTB68oLJOZSbihQCKJdi/gIgYcDQ7C8h3gnk3wc2Wp9FFCcBcOFi7GOvVCLLOMelAD0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65118},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"44b63ec78fb7b09cd5e3b4082c6b4fea3c44d05f","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.2.4","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"21.6.1","dependencies":{"@streamparser/json":"^0.0.20","@exact-realty/multipart-parser":"^1.0.13"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","tsm":"^2.3.0","uvu":"^0.5.6","zod":"^3.22.4","typescript":"^5.4.4"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.6.2_1712316430664_0.7650683844146124","host":"s3://npm-registry-packages"}},"1.7.0":{"name":"@auth70/bodyguard","version":"1.7.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.7.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"6c68ec755612606ba301d191db4f943f092fbcd6","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.7.0.tgz","fileCount":9,"integrity":"sha512-bfeLI8dvB7/tvhAfOb2/mQQr1Djs79wWEi27gXvXFUNIyMF2R7aEZ7+73gDzTiN2XOwq/jJSPD2kZ0SGeGArsg==","signatures":[{"sig":"MEUCIQD6rDIfCaPRCTbcpeAbrG6mghM87XGFCxJZS5G+2P6ChwIgHmuIqqok9WnbF1RLvi5J2MDF5MX3M8Bna2ZwGTvXWKc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65090},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"16dcfb7d0fc2561dcb36392c33e0f4a4227d70b5","scripts":{"test":"tsm node_modules/uvu/bin.js tests","build":"tsc","watch":"tsc -w","test:report":"c8 report --reporter=text-lcov > coverage.lcov","test:coverage":"c8 --include=src npm test"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.9.2","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"22.13.1","dependencies":{"@streamparser/json":"^0.0.22","@apeleghq/multipart-parser":"^1.0.14"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","tsm":"^2.3.0","uvu":"^0.5.6","zod":"^3.24.2","typescript":"^5.8.2"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.7.0_1742927524723_0.029032729456798023","host":"s3://npm-registry-packages-npm-production"}},"1.7.1":{"name":"@auth70/bodyguard","version":"1.7.1","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.7.1","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"072e00399211b4754689b3e63f181b35161ad7d7","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.7.1.tgz","fileCount":11,"integrity":"sha512-iRM3dXNhUnSKKIVf6NGt6yCaaaaKl7IpGDhwS/Vp9m5z5mkyOBgiWNqxsm0YmuEo2xvTGJPhCcHC8eZBiDToCA==","signatures":[{"sig":"MEUCIQC5ixMotUMr6lHPChfRagOG2xo9C5JwcGVIX/M5yQbTnAIgbkRPnj3CRQIh9piFOuMsedW6Y5qzL7srlmzTQ/htpXs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69146},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fba03124109a701c32e837cc0d7ed900c112223f","scripts":{"test":"vitest run","build":"tsc","watch":"tsc -w","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.9.2","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"22.13.1","dependencies":{"@streamparser/json":"^0.0.22","@apeleghq/multipart-parser":"^1.0.14"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.24.2","vitest":"^3.0.9","typescript":"^5.8.2","@types/node":"^22.13.10","@vitest/coverage-v8":"^3.0.9"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.7.1_1742948086209_0.7835536612199225","host":"s3://npm-registry-packages-npm-production"}},"1.7.3":{"name":"@auth70/bodyguard","version":"1.7.3","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.7.3","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"f66984e9b9b5fe2a6369b301289c1a28eae20c51","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.7.3.tgz","fileCount":11,"integrity":"sha512-f1rdxVSUJ29sNxwcB1XwR3pbAqL8ZILJLYZPJOuTsauUmK05ZKJbyJhRxGtpHQijGOgMMgddRG7KaOwvTqKzKg==","signatures":[{"sig":"MEUCID5rTPEgbbUEy6yUHxuR2xq2CiyUgbEXp9hf3M8dOuxfAiEA0OAFW7A+FPDe8LsEk2MvQ7O1p57NBk0/+7yw9HLhmFA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69163},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8167bc2b1470be3f00a6d817793ee5ba5fb37ee6","scripts":{"test":"vitest run","build":"tsc","watch":"tsc -w","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.9.2","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"22.13.1","dependencies":{"@streamparser/json":"^0.0.22","@apeleghq/multipart-parser":"^1.0.21"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.4.3","vitest":"^4.1.9","typescript":"^6.0.3","@types/node":"^26.1.0","@vitest/coverage-v8":"^4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.7.3_1783026872870_0.9351997726222199","host":"s3://npm-registry-packages-npm-production"}},"1.8.0":{"name":"@auth70/bodyguard","version":"1.8.0","keywords":["request","fetch","body-parsing"],"license":"MIT","_id":"@auth70/bodyguard@1.8.0","maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"homepage":"https://github.com/auth70/bodyguard","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"3b62f89686a418f14312726258cb3f16730fe626","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.8.0.tgz","fileCount":11,"integrity":"sha512-78ooxQd3WcqZFwTjzsgshsP+RL/VZqPW2Za4d6KwHLg71PT6OFLGiJa9/pDp0XTH7LE2R3PRZeNBwPyN6P/8ww==","signatures":[{"sig":"MEYCIQCh/h4sS7D12Jw7DikXeRFyUhCEyQ2LMuKcdtcWK4TGQQIhAIcy2e694uSrl9Jmqz0M/Kn+YVvZyVf8h0ntB28CjE4D","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDOstwSbC7U05yKGCQ2wjJS7fpopztTMhP/cyvg5d30pAIgWRFzAaJxJB2x09n8oO9RuztsuLJ3M9suyxxzTlgv4yc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77515},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5987039444dd28f3e9123f130362e671f1573779","scripts":{"test":"vitest run","build":"tsc","watch":"tsc -w","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.9.2","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"_nodeVersion":"22.13.1","dependencies":{"@streamparser/json":"^0.0.26","@apeleghq/multipart-parser":"^1.0.21"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.5.4","vitest":"^4.1.11","typescript":"^7.0.2","@types/node":"^26.4.1","@vitest/coverage-v8":"^4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/bodyguard_1.8.0_1788323741425_0.5792376236512673","host":"s3://npm-registry-packages-npm-production"}},"1.8.1":{"_id":"@auth70/bodyguard@1.8.1","bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"dist":{"shasum":"8371cf8d34816fbf054feac310ac8296f50a7ff5","tarball":"https://registry.npmjs.org/@auth70/bodyguard/-/bodyguard-1.8.1.tgz","fileCount":11,"integrity":"sha512-pfkDhUo62eindiSiB85rGF/ldOUOQ0P6aYOzU+4sgb3nIG9OBdXConQPYPMKqaB4YoQSB0gB0bSSryrQkHZXVw==","signatures":[{"sig":"MEUCIQCRZLQzElG5IXwS0nPSnkp0TuVFHbrV616XZ+8+gy6qhwIgJzpWV6LOIqF0OO1k6EY2+guYkgj5CdzML5JFZ4+R4e8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDf37hG+aiSB3pUCfhZbmbZpBEVl+Ne1aEh18YkSDQolAIgHCXHLEnsxacIkk7iYS0GL0Kd3LQYKsFfx9oivP2IhCI="}],"unpackedSize":79058},"name":"@auth70/bodyguard","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0fcc5c54deff9315b2c691d0ab228dc13a705905","license":"MIT","scripts":{"test":"vitest run","build":"tsc","watch":"tsc -w","test:watch":"vitest","test:coverage":"vitest run --coverage"},"version":"1.8.1","_npmUser":{"name":"miunau","email":"miunau+npm@miunau.com"},"homepage":"https://github.com/auth70/bodyguard","keywords":["request","fetch","body-parsing"],"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"_npmVersion":"10.9.2","description":"Fetch API compatible streaming JSON and form data body parser and guard","directories":{},"maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"_nodeVersion":"22.13.1","contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"dependencies":{"@streamparser/json":"^0.0.26","@apeleghq/multipart-parser":"^1.0.21"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.5.4","vitest":"^4.1.11","typescript":"^7.0.2","@types/node":"^26.4.1","@vitest/coverage-v8":"^4.1.11"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bodyguard_1.8.1_1788324048896_0.027690549202736836"}}},"time":{"created":"2023-08-17T03:51:36.643Z","modified":"2026-09-02T04:40:49.198Z","1.0.0":"2023-08-17T03:51:36.980Z","1.1.0":"2023-08-17T18:26:42.033Z","1.1.1":"2023-08-18T00:42:26.412Z","1.1.2":"2023-08-18T00:44:05.470Z","1.1.3":"2023-08-18T01:46:24.705Z","1.1.4":"2023-08-18T01:47:46.231Z","1.1.5":"2023-08-19T03:54:51.349Z","1.1.6":"2023-08-19T23:39:15.039Z","1.2.0":"2023-12-13T16:17:15.772Z","1.3.0":"2023-12-15T19:31:52.255Z","1.3.1":"2023-12-26T22:38:29.795Z","1.3.2":"2023-12-26T23:06:29.538Z","1.4.0":"2024-02-19T21:30:01.825Z","1.5.0":"2024-02-20T00:14:57.904Z","1.5.1":"2024-04-03T05:16:35.866Z","1.5.2":"2024-04-03T05:47:35.247Z","1.6.0":"2024-04-05T10:56:41.288Z","1.6.1":"2024-04-05T11:02:04.649Z","1.6.2":"2024-04-05T11:27:10.822Z","1.7.0":"2025-03-25T18:32:04.892Z","1.7.1":"2025-03-26T00:14:46.456Z","1.7.3":"2026-07-02T21:14:33.006Z","1.8.0":"2026-09-02T04:35:41.504Z","1.8.1":"2026-09-02T04:40:48.981Z"},"bugs":{"url":"https://github.com/auth70/bodyguard/issues"},"license":"MIT","homepage":"https://github.com/auth70/bodyguard","keywords":["request","fetch","body-parsing"],"repository":{"url":"git+https://github.com/auth70/bodyguard.git","type":"git"},"description":"Fetch API compatible streaming JSON and form data body parser and guard","contributors":[{"url":"https://miunau.com","name":"miunau","email":"miunau+npm@miunau.com"}],"maintainers":[{"name":"miunau","email":"miunau+npm@miunau.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://github.com/auth70/bodyguard/actions\"><img src=\"https://img.shields.io/github/actions/workflow/status/auth70/bodyguard/ci.yml?logo=github\" alt=\"build\"></a>\n  <a href=\"https://www.npmjs.com/package/@auth70/bodyguard\"><img src=\"https://img.shields.io/npm/v/@auth70/bodyguard\" alt=\"npm\"></a>\n  <a href=\"https://www.npmjs.com/package/@auth70/bodyguard\"><img src=\"https://img.shields.io/npm/types/@auth70/bodyguard\" alt=\"npm type definitions\"></a>\n</p>\n\n# Bodyguard\n\nSimple [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)-compatible, **streaming** body parser. Aims for ease of use with secure defaults.\n\nTakes in a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) or [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) object and parses its body into a JavaScript object. If you pass a typed schema validator using [Zod](https://zod.dev/) or similar library, the resulting object will also be typed.\n\nWorks in:\n\n- Node.js\n- Browser\n- Bun\n- Deno\n- Cloudflare Workers and other serverless environments\n\n## Quickstart\n\n```bash\nnpm install --save @auth70/bodyguard\n```\n\n## Features\n\n- **Parse (nested!) object *and* array form data with dot (`foo.bar`) and square bracket `(baz[0])` syntax** in both multipart and URL-encoded forms.\n- **Parse file uploads in multipart form data** and return them as `File` objects.\n- **Prevents resource exhaustion** by bailing early on streams that are too large, have too many (or too large) keys, or have too much nesting.\n- **Guards against [prototype pollution](https://cheatsheetseries.owasp.org/cheatsheets/Prototype_Pollution_Prevention_Cheat_Sheet.html)** in JSON and form data.\n- **Enforce parsed data to pass a validator** using a [Standard Schema](https://standardschema.dev/) object (Zod 4, Valibot, ArkType, …) or a throwing function *(optional)*.\n- **Cast numbers and booleans from strings in form data** *(optional)*.\n- **Transform parsed data before validation** so callers can coerce by schema shape without turning on global `castNumbers`/`castBooleans`.\n\n### Supported content types\n\n- ✅ JSON (`application/json`)\n- ✅ Multi-boundary multipart form data (`multipart/form-data`)\n- ✅ URL-encoded form data (`application/x-www-form-urlencoded`)\n- ✅ Raw UTF-8 text (`text/plain`)\n\n## Usage\n\n**Each method in Bodyguard has two versions.** One that throws an error if the body is invalid (e.g. `form()`), and one that returns an error instead (e.g. `softForm()`). You may pick whichever suits your workflow.\n\n**If you pass in a validator**, it may be either:\n\n- a [Standard Schema v1](https://standardschema.dev/) object (for example a Zod 4 schema). Bodyguard calls `schema[\"~standard\"].validate()` and, on failure, exposes `error.issues` as `{ code: \"custom\", path, message }[]`.\n- a function that **throws** if the data is invalid and **returns** the parsed data if it is valid (for example `schema.parse` on Zod 3).\n\nIf you don't pass in a validator, the parsed data is returned as-is.\n\n### Getting started\n\nInitialise a Bodyguard instance with your preferred options. You can use it as a singleton or create multiple instances.\n\n```ts\nimport { Bodyguard } from '@auth70/bodyguard';\n\n// All arguments are optional with their defaults shown below\nconst bodyguard = new Bodyguard({\n    maxSize: 1024 * 1024 * 1, // Default: 1MB\n    maxKeys: 100, // Default: Allows up to 100 total keys\n    maxDepth: 10, // Default: Allows up to 10 levels of nesting\n    maxKeyLength: 100, // Default: Allows up to 100 characters per key\n    castNumbers: false, // Default: Does NOT automatically cast numbers in form data\n    castBooleans: false, // Default: Does NOT automatically cast \"true\" and \"false\" as boolean in form data\n});\n```\n\n### Parsing\n\nTo parse a request body, you can either use the `pat()` / `softPat()` methods to have Bodyguard use the appropriate parser depending on the content type, or you can directly use the `json()` / `softJson()` or `form()` / `softForm()` methods to parse JSON and form data respectively.\n\nFor example, in a SvelteKit action:\n\n```ts\n// src/routes/+page.server.tsts\nimport { fail, type Actions } from '@sveltejs/kit';\nimport { Bodyguard } from '@auth70/bodyguard';\nimport { z } from 'zod';\n\n// Define a validator, using Zod in this example\nconst RouteSchema = z.object({ name: z.string() }); \n\nconst bodyguard = new Bodyguard(); // Or use a singleton, or put it in locals\n\nexport const actions = {\n    default: async ({ request, locals }) => {\n        // Use softForm() to parse the form into an object.\n        // It does not throw an error if the body is invalid (compared to form() which does).\n        const result = await bodyguard.softForm(\n            request, // Pass in the request\n            RouteSchema // Pass in a Standard Schema object (Zod 4) or a throwing parser (RouteSchema.parse)\n        );\n\n        if(!result.success) {\n            // Narrow the type of result to BodyguardError\n            return fail(400, { error: result.error });\n        }\n        // Narrow the type of result to BodyguardSuccess\n        return { name: result.value.name };\n    },\n} satisfies Actions;\n```\n\n`options` are the same options you can pass to the instance constructor. Any options provided to a function will override the constructor options.\n\nSee [the API section](#api) for more information.\n\n#### Response parsing\n\nEven though these examples focus on Request bodies, there is nothing stopping you from using Bodyguard to parse and guard Response bodies as well, e.g. from user-supplied, untrusted APIs or webhooks.\n\n## Parsing rules\n\n### JSON\n\nJSON data is returned like `JSON.parse()` would return it.\n\n### Multipart form data\n\nTrailing newlines are stripped from the end of values.\n\n### URL-encoded form data\n\nValues are decoded using `decodeURIComponent()`.\n\n#### Handling plus (+) signs URL-encoded forms\n\nIf you are submitting a javascript-free form, you may want to convert `+` to spaces in the form data, as browsers regularly transform spaces into pluses when submitting urlencoded forms. Javascript submitted forms don't have this problem.\n\nYou can do this automatically by passing `convertPluses: true` as an option to `form()` or `softForm()`. It won't affect multipart form data, so consider using `enctype=\"application/x-www-form-urlencoded\"` in your form tag if you need proper spaces and plus signs. Note that this is disabled by default, and if you enable it, you won't be able to distinguish between spaces and pluses in the form data.\n\n### Common form data parsing\n\n#### Numbers\n\n*Auto-cast numbers by passing `castNumbers: true` as an option.*\n\nIf the value passes `!isNaN()` it's cast as a number. For example, `\"3\"` is returned as `3`, `\"3.14\"` is returned as `3.14`, etc. *This is disabled by default*. Leave it off when a value like a zip code (`\"00123\"`) must stay a string; coerce selected fields with `transform` instead.\n\n#### Booleans\n\n*Auto-cast booleans by passing `castBooleans: true` as an option.*\n\nIf the value is `\"true\"` or `\"false\"`, it's cast as a boolean. For example, `\"true\"` is returned as `true`, `\"false\"` is returned as `false`. *This is disabled by default*.\n\n#### Empty strings\n\nEmpty strings are returned as empty strings (`\"\"`), not `null` or `undefined`.\n\n#### Form field name grammar\n\nBodyguard uses the same key grammar for `application/x-www-form-urlencoded` and `multipart/form-data`. The parsers are `extractNestedKey` (split on `.`) and `assignNestedValue` (optional `[index]` / `[]` suffix). Both are exported from the package, along with `possibleCast`, so other code can pin parity against them.\n\n- `a.b` nests: `a.b=1` → `{ a: { b: \"1\" } }`\n- `tags[]` appends: `tags[]=a&tags[]=b` → `{ tags: [\"a\", \"b\"] }`\n- `items[0].name` indexes: `items[0].name=Ada` → `{ items: [{ name: \"Ada\" }] }`. Sparse holes are allowed (`items[2]=x` leaves index 0 and 1 empty).\n- A repeated **plain** name keeps the last value: `a=1&a=2` → `{ a: \"2\" }`. Use `[]` when you want an array.\n- `__proto__`, `constructor`, and `prototype` segments are refused.\n- File parts stay [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.\n\n```html\n<form>\n    <input type=\"text\" name=\"a_string\" value=\"bar\" />\n    <input type=\"text\" name=\"a_number\" value=\"3\" />\n    <!-- array accessors -->\n    <input type=\"text\" name=\"an_array[]\" value=\"foo\" /> <!-- auto-incrementing index -->\n    <input type=\"text\" name=\"an_array[1]\" value=\"bar\" /> <!-- numeric index -->\n    <!-- object accessors -->\n    <input type=\"text\" name=\"an_object.fox\" value=\"fox\" />\n    <!-- nested object accessor -->\n    <input type=\"text\" name=\"an_object.dog.bark\" value=\"bark\" />\n    <!-- nested object and array accessor -->\n    <input type=\"text\" name=\"an_object.cat[].meow\" value=\"meow?\" />\n    <input type=\"text\" name=\"an_object.cat[2].meow\" value=\"meow!\" /> <!-- leaves index 1 undefined -->\n</form>\n```\n\nThe above comes out as:\n\n```ts\n{\n    a_string: 'bar',\n    a_number: '3', // strings unless you opt into castNumbers or transform\n    an_array: ['foo', 'bar'],\n    an_object: {\n        fox: 'fox',\n        dog: {\n            bark: 'bark',\n        },\n        cat: [\n            { meow: 'meow?' },\n            undefined,\n            { meow: 'meow!' },\n        ],\n    },\n}\n```\n\n---\n\n## Examples\n\n### Standard Schema example\n\n<details>\n<summary><strong>Expand example</strong></summary>\n\nPass a [Standard Schema](https://standardschema.dev/) object (Zod 4, Valibot, ArkType, …) instead of a throwing `.parse` function. On failure, `error.issues` is `{ code: \"custom\", path, message }[]`. Form values stay strings unless you coerce them with `transform` — leave `castNumbers` off so a zip code like `\"00123\"` is not turned into a number.\n\n```ts\nimport { Bodyguard } from '@auth70/bodyguard';\nimport { z } from 'zod';\n\nconst bodyguard = new Bodyguard();\n\nconst StaySchema = z.object({\n    \"first-name\": z.string(),\n    \"stay-start\": z.string(),\n    guests: z.number().int().positive(),\n    zip: z.string(),\n});\n\nconst result = await bodyguard.softForm(request, StaySchema, {\n    transform: (value) => {\n        const v = value as { guests?: string; zip?: string };\n        return {\n            ...v,\n            guests: v.guests !== undefined ? Number(v.guests) : v.guests,\n            zip: v.zip, // keep leading zeroes\n        };\n    },\n});\n\nif (!result.success) {\n    // result.error.issues → [{ code: \"custom\", path: [\"guests\"], message: \"...\" }, ...]\n    // result.value is the parsed (and transformed) input\n    return { ok: false, issues: result.error.issues, value: result.value };\n}\n\nreturn { ok: true, stay: result.value };\n```\n\nThrowing methods work the same way: `form()` / `json()` / `pat()` throw an `Error` whose `.issues` is that mapped array. Function validators (`StaySchema.parse`) still work unchanged.\n\n</details>\n\n### SvelteKit example\n\n<details>\n<summary><strong>Expand example</strong></summary>\n\n**routes/+page.server.ts**\n\n```ts\nimport { z } from 'zod';\nimport { Bodyguard } from '@auth70/bodyguard';\n\nconst bodyguard = new Bodyguard(); // Or use a singleton, or put it in locals\n\nconst RouteSchema = z.object({ name: z.string() });\n\nexport const actions = {\n    default: async ({ request, locals }) => {\n        const { success, value } = await bodyguard.softForm(request, RouteSchema);\n        /**\n         * success: boolean\n         * error?: Error\n         * value?: { name: string }\n         */\n        if(!success) {\n            return {\n                status: 400,\n                body: JSON.stringify({ error: error.message }),\n            }\n        }\n        return {\n            status: 302,\n            headers: {\n                location: `/${value.name}`,\n            },\n        }\n    },\n} satisfies Actions;\n```\n</details>\n\n### Hono example\n\n<details id=\"hono-example\">\n<summary><strong>Expand example</strong></summary>\n\n**src/index.ts**\n\n```ts\nimport { Bodyguard } from '@auth70/bodyguard';\nimport { Hono } from 'hono'\n\nconst app = new Hono()\nconst bodyguard = new Bodyguard();\n\napp.use(\n    '*',\n        async (c, next) => {\n            c.locals.bodyguard = bodyguard; // As a singleton in locals\n            return next();\n        }\n    }\n)\n\nconst RouteSchema = z.object({ name: z.string() });\n\napp.post('/page', (c) => {\n    const { success, value } = await c.locals.bodyguard.softForm(c.request, RouteSchema);\n    /**\n     * success: boolean\n     * error?: Error\n     * value?: { name: string }\n     */\n    if(!success) {\n        return {\n            status: 400,\n            body: JSON.stringify({ error: error.message }),\n        }\n    }\n    return {\n        status: 302,\n        headers: {\n            location: `/${value.name}`,\n        },\n    }\n})\n```\n\n</details>\n\n---\n\n## API\n\nBelow are the methods and types available in the Bodyguard class.\n\n### Constructor\n\n#### `new Bodyguard(config)`\n\n- `config?`: `BodyguardConfig`\n\n---\n\n### Types\n\n#### `BodyguardConfig`\n\n- `maxSize?`: `number` - Maximum allowed size of the body in bytes. Default: `1024 * 1024 * 1` (1MB)\n- `maxKeys?`: `number` - Maximum allowed number of keys in the body. Default: `100`\n- `maxDepth?`: `number` - Maximum allowed depth of the body. Default: `10`\n- `maxKeyLength?`: `number` - Maximum allowed length of a key in the body. Default: `100`\n- `castNumbers?`: `boolean` - Whether to cast numbers from strings in form data. Default: `false`\n- `castBooleans?`: `boolean` - Whether to cast `\"true\"` and `\"false\"` as booleans in form data. Default: `false`\n- `transform?`: `(value: JSONLike) => JSONLike | Promise<JSONLike>` - Applied after parsing and before validation (form, JSON, and `pat` / `softPat`). Use this to coerce selected fields by schema shape. Default: `undefined`\n\n#### `BodyguardFormConfig` (extends `BodyguardConfig`, used in `form()` and `softForm()`)\n\n- `maxSize?`: `number` - Maximum allowed size of the body in bytes. Default: `1024 * 1024 * 1` (1MB)\n- `maxKeys?`: `number` - Maximum allowed number of keys in the body. Default: `100`\n- `maxDepth?`: `number` - Maximum allowed depth of the body. Default: `10`\n- `maxKeyLength?`: `number` - Maximum allowed length of a key in the body. Default: `100`\n- `castNumbers?`: `boolean` - Whether to cast numbers from strings in form data. Default: `false`\n- `castBooleans?`: `boolean` - Whether to cast `\"true\"` and `\"false\"` as booleans in form data. Default: `false`\n- `transform?`: `(value: JSONLike) => JSONLike | Promise<JSONLike>` - Applied after parsing and before validation. Default: `undefined`\n- `convertPluses?`: `boolean` - Whether to convert `+` to spaces in urlencoded form data. Default: `false`\n- `maxFiles?`: `number` - Maximum allowed number of files in the body. Default: `Infinity`\n- `maxFilenameLength?`: `number` - Maximum allowed length of a filename in the body. Default: `255`\n- `allowedContentTypes?`: `string[]` - Allowed content types for file uploads. Default: `undefined`\n\n#### `BodyguardResult<T> = BodyguardSuccess<T> | BodyguardError<T>`\n\n- `success`: `boolean` - Whether the parsing was successful.\n- `error?`: `Error` - The error that occurred, if any.\n- `value?`: `T` - The parsed value, if successful.\n\n#### `BodyguardSuccess<T>`\n\n- `success`: `true`\n- `value`: `T`\n\n#### `BodyguardError<T>`\n\n- `success`: `false`\n- `error`: `Error`\n- `value?`: `T`\n\n#### `BodyguardValidator<T = JSONLike> = (obj: JSONLike) => T`\n\nA throwing function validator. Standard Schema v1 objects are also accepted anywhere a validator is accepted; the result type is then `StandardSchemaV1.InferOutput<T>`.\n\n`StandardSchemaV1` (type) and `isStandardSchema()` are re-exported from the package entry.\n\n`assignNestedValue`, `extractNestedKey`, and `possibleCast` are also exported for clients that need to match Bodyguard's form-key grammar.\n\n---\n\n### Form parsing\n\n#### `Bodyguard.softForm<ValidatorType, ErrorType>(input, validator, options): Promise<BodyguardResult<ReturnType<ValidatorType>, ErrorType>>`\n\nParses an urlencoded or multipart form data stream into a JavaScript object. If an error occurs, it is returned instead of throwing.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed object against.\n- `config?: Partial<BodyguardConfig>` - Optional config to override the constructor options.\n\nReturns a `BodyguardResult`:\n\n```ts\n{\n    success: boolean,\n    error?: Error,\n    value?: ReturnType<ValidatorType>,\n}\n```\n\n#### `Bodyguard.form(input, validator, options): Promise<ReturnType<ValidatorType>>`\n\nParses an urlencoded or multipart form data stream into a JavaScript object. Errors are thrown.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed object against.\n- `config?: Partial<BodyguardConfig>` - Optional config to override the constructor options.\n\nReturns the parsed object (not a `BodyguardResult`).\n\n---\n\n### JSON parsing\n\n#### `Bodyguard.softJson<ValidatorType, ErrorType>(input, validator, options): Promise<BodyguardResult<ReturnType<ValidatorType>, ErrorType>>`\n\nParses a JSON stream into a JavaScript object. If an error occurs, it is returned instead of throwing.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed object against.\n- `config?: Partial<BodyguardConfig>` - Optional config to override the constructor options.\n\nReturns a `BodyguardResult`:\n\n```ts\n{\n    success: boolean,\n    error?: Error,\n    value?: ReturnType<ValidatorType>,\n}\n```\n\n#### `Bodyguard.json(input, validator, options): Promise<ReturnType<ValidatorType>>`\n\nParses a JSON stream into a JavaScript object. Errors are thrown.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed object against.\n- `config?: Partial<BodyguardConfig>` - Optional config to override the constructor options.\n\nReturns the parsed object (not a `BodyguardResult`).\n\n---\n\n### Text parsing\n\n#### `Bodyguard.softText<ValidatorType, ErrorType>(input, validator, options): Promise<BodyguardResult<ReturnType<ValidatorType>, ErrorType>>`\n\nParses raw UTF-8 text into a string. The byte limit is enforced but no key or depth limits are enforced as there is no way to know what the structure of the text is. If an error occurs, it is returned instead of throwing.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed string against.\n- `config?: Partial<BodyguardConfig>` - Optional config to override the constructor options.\n\n#### `Bodyguard.text(input, validator, options): Promise<ReturnType<ValidatorType>>`\n\nParses raw UTF-8 text into a string. The byte limit is enforced but no key or depth limits are enforced as there is no way to know what the structure of the text is. Errors are thrown.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed string against.\n- `config?: Partial<BodyguardConfig>` - Optional config to override the constructor options.\n\n---\n\n### Automatic content type detection\n\n#### `Bodyguard.softPat<ValidatorType, ErrorType>(input, validator, options): Promise<BodyguardResult<ReturnType<ValidatorType>, ErrorType>>`\n\nParses a request or response body into a JavaScript object. Internally uses `softJson()` or `softForm()` depending on the content type. If an error occurs, it is returned instead of throwing.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed object against.\n- `config?: Partial<BodyguardConfig | BodyguardFormConfig>` - Optional config to override the constructor options.\n\nReturns a `BodyguardResult`:\n\n```ts\n{\n    success: boolean,\n    error?: Error,\n    value?: ReturnType<ValidatorType>,\n}\n```\n\n#### `Bodyguard.pat(input, validator, options): Promise<ReturnType<ValidatorType>>`\n\nParses a request or response body into a JavaScript object. Internally uses `json()` or `form()` depending on the content type. Errors are thrown.\n\n- `input: Request | Response` - Fetch API compatible input.\n- `validator?: ValidatorType extends BodyguardValidator` - Optional validator to validate the parsed object against.\n- `config?: Partial<BodyguardConfig | BodyguardFormConfig>` - Optional config to override the constructor options.\n\nReturns the parsed object (not a `BodyguardResult`).\n\n---\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}