{"_id":"@tinyfox/shapecheck","_rev":"5-5e72e015ef2201e79543bbbd20c43f10","name":"@tinyfox/shapecheck","dist-tags":{"latest":"0.8.8"},"versions":{"0.7.4":{"name":"@tinyfox/shapecheck","version":"0.7.4","keywords":["validation","shape","type-check","schema","runtime"],"author":{"url":"https://github.com/tinyfox","name":"tinyfox","email":"tinyfox@pm.me"},"license":"MIT","_id":"@tinyfox/shapecheck@0.7.4","maintainers":[{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"}],"homepage":"https://github.com/tinyfox/shapecheck#readme","bugs":{"url":"https://github.com/tinyfox/shapecheck/issues"},"dist":{"shasum":"86e8ca6e9199c0396476553de94b109a65b8ae81","tarball":"https://registry.npmjs.org/@tinyfox/shapecheck/-/shapecheck-0.7.4.tgz","fileCount":6,"integrity":"sha512-p8EJ4Z8PwI4xmaJDb6YsdfFVVh/C/A53X31TBOWmK+kgrP29V1fJdY+xkVAotka+t3vDpD7AkLqpEEMKXD9/BA==","signatures":[{"sig":"MEUCIFoMBXI1/FLsWcvJUBVbuji+dBsubRzXk7Y1+XptPI5wAiEAiODIgpuNPEk2Smf1Fb3k+nbcQUyy9xEaZ1gwJIR1Ecw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8900},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=14"},"gitHead":"19545a329e07662d3b98f2dfad7be139add8a11b","scripts":{"postinstall":"node lib/bootstrap.js"},"_npmUser":{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"},"repository":{"url":"git+https://github.com/tinyfox/shapecheck.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny runtime shape check — predicate, validate, assert. No deps.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shapecheck_0.7.4_1780558403439_0.5096747394792907","host":"s3://npm-registry-packages-npm-production"}},"0.8.5":{"name":"@tinyfox/shapecheck","version":"0.8.5","keywords":["runtime","validation","branded","shape","bigint","typescript","rules","guard","dsl","schema"],"author":{"url":"https://github.com/tinyfox","name":"tinyfox","email":"tinyfox@pm.me"},"license":"MIT","_id":"@tinyfox/shapecheck@0.8.5","maintainers":[{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"}],"homepage":"https://github.com/tinyfox/shapecheck#readme","bugs":{"url":"https://github.com/tinyfox/shapecheck/issues"},"dist":{"shasum":"f331efc313573a063568f3f895dd792c046038cd","tarball":"https://registry.npmjs.org/@tinyfox/shapecheck/-/shapecheck-0.8.5.tgz","fileCount":64,"integrity":"sha512-pSQRP0N3yn0F7ubM8GrNZ3p7uAHNRX0Gnmut+aQ/XSjpmsaBn4Jc9Nx5kMOBodqEwvblWefOXblI9EVReplIFg==","signatures":[{"sig":"MEYCIQCCNWYf/LbhcxhEGIJRVWeoeGf8u4n8TduH4umYQtMvjwIhAJVPuIsfyuEHuEbv6FjFzhGJ8Ngp9m/Skl7+VvrCWUcv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":104403},"main":"dist/rulr.cjs","type":"module","types":"dist/rulr.d.ts","module":"dist/rulr.modern.js","engines":{"node":">=14"},"exports":{".":{"types":"./dist/rulr.d.ts","import":"./dist/rulr.modern.js","default":"./dist/rulr.modern.js","require":"./dist/rulr.cjs"},"./package.json":"./package.json"},"gitHead":"9ac73f158cb5b37ccaaa68dd19d21c9007fb9d17","scripts":{"postinstall":"node dist/bootstrap.cjs"},"_npmUser":{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"},"repository":{"url":"git+https://github.com/tinyfox/shapecheck.git","type":"git"},"_npmVersion":"11.11.0","description":"Functional runtime validation DSL with branded types, bigint, and composable rule constructors for TypeScript.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"atob":"^2.1.2","validator":"^13.0.0","make-error":"^1.3.6"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shapecheck_0.8.5_1781415212521_0.3472041547636662","host":"s3://npm-registry-packages-npm-production"}},"0.8.6":{"name":"@tinyfox/shapecheck","version":"0.8.6","keywords":["runtime","validation","branded","shape","bigint","typescript","rules","guard","dsl","schema"],"author":{"url":"https://github.com/tinyfox","name":"tinyfox","email":"tinyfox@pm.me"},"license":"MIT","_id":"@tinyfox/shapecheck@0.8.6","maintainers":[{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"}],"homepage":"https://github.com/ryasmi/rulr#readme","bugs":{"url":"https://github.com/ryasmi/rulr/issues"},"dist":{"shasum":"009cee6f53c9ffcd54fd261fb9fab990f1b80821","tarball":"https://registry.npmjs.org/@tinyfox/shapecheck/-/shapecheck-0.8.6.tgz","fileCount":64,"integrity":"sha512-jGTP7RDGngr1BJXD7al5lA242qiGKn15LeGAaPDx4KnusWKq6nzD4xRnsCwC0IUkCuBn2qyQNKW8fvS+3Pz8Ag==","signatures":[{"sig":"MEUCIEyGHnFW398XR8gVXH3jZhkDzV4gdtMgLUATjeKvpjNbAiEAxa2+vdnWrCoNwcUHlu6OdpZFDnP4gl+9oLiOYLFBKMs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":104386},"main":"dist/rulr.cjs","type":"module","types":"dist/rulr.d.ts","module":"dist/rulr.modern.js","engines":{"node":">=14"},"exports":{".":{"types":"./dist/rulr.d.ts","import":"./dist/rulr.modern.js","default":"./dist/rulr.modern.js","require":"./dist/rulr.cjs"},"./package.json":"./package.json"},"gitHead":"e08a4a5780522e10b377cbc1ae9a34af92d9c3a7","scripts":{"postinstall":"node dist/bootstrap.cjs"},"_npmUser":{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"},"repository":{"url":"git+https://github.com/ryasmi/rulr.git","type":"git"},"_npmVersion":"11.11.0","description":"Functional runtime validation DSL with branded types, bigint, and composable rule constructors for TypeScript.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"atob":"^2.1.2","validator":"^13.0.0","make-error":"^1.3.6"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shapecheck_0.8.6_1781420322565_0.3983665526214042","host":"s3://npm-registry-packages-npm-production"}},"0.8.7":{"name":"@tinyfox/shapecheck","version":"0.8.7","keywords":["runtime","validation","branded","shape","bigint","typescript","rules","guard","dsl","schema"],"author":{"url":"https://github.com/tinyfox","name":"tinyfox","email":"tinyfox@pm.me"},"license":"MIT","_id":"@tinyfox/shapecheck@0.8.7","maintainers":[{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"}],"homepage":"https://github.com/ryasmi/rulr#readme","bugs":{"url":"https://github.com/ryasmi/rulr/issues"},"dist":{"shasum":"698e40291d89caea8e64fbe2c2b41d15794adb9c","tarball":"https://registry.npmjs.org/@tinyfox/shapecheck/-/shapecheck-0.8.7.tgz","fileCount":64,"integrity":"sha512-zMvys1vNpKWGs3rWuT+6O/GHCK7Q5E1KqpEwMRFQm7O8llaHN/vfvE2PrCTJZc4aBcfHXoO7JcuCIVixJSeesA==","signatures":[{"sig":"MEUCIQDBpTeQlCyb8LfwqmpscYPN4TLzHBbVN+lkgait/SH1DgIgelU98sGjylGJzShVISXDX1ftjyJ2Usj5Nh137v7n1hA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":636374},"main":"dist/rulr.cjs","type":"module","types":"dist/rulr.d.ts","module":"dist/rulr.modern.js","engines":{"node":">=14"},"exports":{".":{"types":"./dist/rulr.d.ts","import":"./dist/rulr.modern.js","default":"./dist/rulr.modern.js","require":"./dist/rulr.cjs"},"./package.json":"./package.json"},"gitHead":"58ce5518ae5f5c68191c3cf4276a7a28ca9ad4e9","scripts":{"postinstall":"node dist/bootstrap.cjs"},"_npmUser":{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"},"repository":{"url":"git+https://github.com/ryasmi/rulr.git","type":"git"},"_npmVersion":"11.11.0","description":"Functional runtime validation DSL with branded types, bigint, and composable rule constructors for TypeScript.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"atob":"^2.1.2","validator":"^13.0.0","make-error":"^1.3.6"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shapecheck_0.8.7_1781765311608_0.8741904157716389","host":"s3://npm-registry-packages-npm-production"}},"0.8.8":{"name":"@tinyfox/shapecheck","version":"0.8.8","description":"Functional runtime validation DSL with branded types, bigint, and composable rule constructors for TypeScript.","type":"module","main":"dist/rulr.cjs","module":"dist/rulr.modern.js","types":"dist/rulr.d.ts","exports":{".":{"types":"./dist/rulr.d.ts","import":"./dist/rulr.modern.js","require":"./dist/rulr.cjs","default":"./dist/rulr.modern.js"},"./package.json":"./package.json"},"sideEffects":false,"license":"MIT","author":{"name":"tinyfox","email":"tinyfox@pm.me","url":"https://github.com/tinyfox"},"repository":{"type":"git","url":"git+https://github.com/ryasmi/rulr.git"},"bugs":{"url":"https://github.com/ryasmi/rulr/issues"},"homepage":"https://github.com/ryasmi/rulr#readme","engines":{"node":">=14"},"dependencies":{"atob":"^2.1.2","make-error":"^1.3.6","validator":"^13.0.0"},"keywords":["runtime","validation","branded","shape","bigint","typescript","rules","guard","dsl","schema"],"gitHead":"92964335a9a1f1e5691a2a6ac0754323c80c669d","_id":"@tinyfox/shapecheck@0.8.8","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-2R7lsuGjIh5C0LjEuViMnAhLnocCloS6cuZ+AVo/RaAYjki6npme8EW6B5SkD1vooHY0dNY7vn0SKo0hQH01Og==","shasum":"5d5017d87e62357a9138bffcc1b53098fe28fae1","tarball":"https://registry.npmjs.org/@tinyfox/shapecheck/-/shapecheck-0.8.8.tgz","fileCount":64,"unpackedSize":636309,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGi/ekxLl3WQvarwiILNp9KcGaqXzZB6l717tEavQITrAiBGi0CUIcQQXbnqyco/5G1+d4aQYilD9Y8oB/NiQlgdVQ=="}]},"_npmUser":{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"},"directories":{},"maintainers":[{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/shapecheck_0.8.8_1781770107616_0.5030585108646513"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T07:33:23.272Z","modified":"2026-06-18T08:08:27.923Z","0.7.4":"2026-06-04T07:33:23.580Z","0.8.5":"2026-06-14T05:33:32.684Z","0.8.6":"2026-06-14T06:58:42.696Z","0.8.7":"2026-06-18T06:48:31.818Z","0.8.8":"2026-06-18T08:08:27.796Z"},"bugs":{"url":"https://github.com/ryasmi/rulr/issues"},"author":{"name":"tinyfox","email":"tinyfox@pm.me","url":"https://github.com/tinyfox"},"license":"MIT","homepage":"https://github.com/ryasmi/rulr#readme","keywords":["runtime","validation","branded","shape","bigint","typescript","rules","guard","dsl","schema"],"repository":{"type":"git","url":"git+https://github.com/ryasmi/rulr.git"},"description":"Functional runtime validation DSL with branded types, bigint, and composable rule constructors for TypeScript.","maintainers":[{"name":"tinyfox","email":"tinyfox-yjwiqz@wshu.net"}],"readme":"# @tinyfox/shapecheck\n\nFunctional runtime validation DSL for TypeScript with branded types, `bigint`, and composable rule constructors.\n\n```ts\n// Install with `npm i @tinyfox/shapecheck`\nimport * as shapecheck from '@tinyfox/shapecheck'\n\n// Compile-time error.\nconst positiveNumber1: shapecheck.PositiveNumber = -1\n\n// Runtime error.\nconst positiveNumber2 = shapecheck.positiveNumber(-1)\n\n// Composable rules and guards like `object`.\nconst example = shapecheck.object({\n  required: {\n    price: shapecheck.positiveNumber,\n  },\n})\n\n// Turn rules into types so you don't have to duplicate information.\ntype Example = shapecheck.Static<typeof example>\n\n// Turn rules into guards so you don't have to duplicate code.\nconst isExample = shapecheck.guard(example)\n\n// Use rules and/or guards to guarantee data validity.\nconst myExample: Example = example({ price: 12.34 })\nif (isExample(myExample)) {\n  // myExample.price is typed as a PositiveNumber here\n}\n```\n\n## Why shapecheck\n\n- Functional API — every rule is just `(input: unknown) => Output`.\n- Branded types via `Static<typeof rule>` — no nominal-typing tricks needed at call sites.\n- Aggregated errors — `object`/`array`/`tuple` collect every failure in one pass instead of throwing on the first.\n- First-class `bigint`, symbol, and constant rules.\n- Plays well with NestJS pipes, Express handlers, Cloudflare Workers, and Fastify.\n\n## Built-in rules\n\n- [allowNull](./src/higherOrderRules/allowNull/readme.md)\n- [allowUndefined](./src/higherOrderRules/allowUndefined/readme.md)\n- [any](./src/valueRules/any/readme.md)\n- [array](./src/higherOrderRules/array/readme.md)\n- [bigint](./src/valueRules/bigint/readme.md)\n- [boolean](./src/valueRules/boolean/readme.md)\n  - [trueRule](./src/valueRules/trueRule/readme.md)\n  - [falseRule](./src/valueRules/falseRule/readme.md)\n- [constant](./src/valueRules/constant/readme.md)\n- [date](./src/valueRules/date/readme.md)\n- [dictionary](./src/higherOrderRules/dictionary/readme.md)\n- [enum](./src/valueRules/enum/readme.md)\n- [literal](./src/valueRules/literal/readme.md)\n- [number](./src/valueRules/number/readme.md)\n- [object](./src/higherOrderRules/object/readme.md)\n- [string](./src/valueRules/string/readme.md)\n- [symbol](./src/valueRules/symbol/readme.md)\n- [tuple](./src/higherOrderRules/tuple/readme.md)\n- [union](./src/higherOrderRules/union/readme.md)\n- [unknown](./src/valueRules/unknown/readme.md)\n\n## Sized strings\n\nRestricts string size to avoid UI overflow and database storage issues.\n\n- [nonEmptyString](./src/sizedStrings/nonEmptyString/readme.md)\n- [tinyText](./src/sizedStrings/tinyText/readme.md) (0–255 characters)\n- [text](./src/sizedStrings/text/readme.md) (0–65,535 characters)\n- [mediumText](./src/sizedStrings/mediumText/readme.md) (0–16,777,215 characters)\n\n## Constrained strings\n\nBuilt on top of `validator` for well-known string formats.\n\n- [email](./src/constrainedStrings/email/readme.md)\n- [iri](./src/constrainedStrings/iri/readme.md)\n- [iso8601Duration](./src/constrainedStrings/iso8601Duration/readme.md)\n- [iso8601FullDate](./src/constrainedStrings/iso8601FullDate/readme.md)\n- [iso8601Timestamp](./src/constrainedStrings/iso8601Timestamp/readme.md)\n- [locale](./src/constrainedStrings/locale/readme.md)\n- [mailto](./src/constrainedStrings/mailto/readme.md)\n- [mimeType](./src/constrainedStrings/mimeType/readme.md)\n- [mongoId](./src/constrainedStrings/mongoId/readme.md)\n- [scormInteractionType](./src/constrainedStrings/scormInteractionType/readme.md)\n- [semanticVersion](./src/constrainedStrings/semanticVersion/readme.md)\n- [sha1](./src/constrainedStrings/sha1/readme.md)\n- [url](./src/constrainedStrings/url/readme.md)\n- [uuidv4](./src/constrainedStrings/uuidv4/readme.md)\n\n## Constrained non-strings\n\n- [integer](./src/constrainedValues/integer/readme.md)\n- [negativeInteger](./src/constrainedValues/negativeInteger/readme.md)\n- [negativeNumber](./src/constrainedValues/negativeNumber/readme.md)\n- [positiveInteger](./src/constrainedValues/positiveInteger/readme.md)\n- [positiveNumber](./src/constrainedValues/positiveNumber/readme.md)\n\n## Sanitization\n\nCoerces values from HTTP headers, URL params, and form bodies.\n\n- [sanitizeBooleanFromString](./src/sanitizationRules/sanitizeBooleanFromString/readme.md)\n- [sanitizeJsonFromString](./src/sanitizationRules/sanitizeJsonFromString/readme.md)\n- [sanitizeNumberFromString](./src/sanitizationRules/sanitizeNumberFromString/readme.md)\n- [sanitizeBasicAuthFromString](./src/sanitizationRules/sanitizeBasicAuthFromString/readme.md)\n- [sanitizeJWTBearerAuthFromString](./src/sanitizationRules/sanitizeJWTBearerAuthFromString/readme.md)\n\n## Rule constructors\n\nBuild your own rules from a regex or a length window.\n\n- [regexRuleConstructor](./src/ruleConstructors/regexRuleConstructor/readme.md)\n- [sizedArrayRuleConstructor](./src/ruleConstructors/sizedArrayRuleConstructor/readme.md)\n\n## License\n\nMIT\n","readmeFilename":"readme.md"}