{"_id":"@typeschema/suretype","_rev":"1-57f8656ce5ff97c71afbc60cedc88d2f","name":"@typeschema/suretype","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@typeschema/suretype","version":"0.1.0","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","_id":"@typeschema/suretype@0.1.0","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"homepage":"https://typeschema.com","bugs":{"url":"https://github.com/decs/typeschema/issues"},"//":"This file is partially generated. Only some fields can be modified manually!","dist":{"shasum":"cb87d33f1b3aa3a064cc6dfdb067a898a8fd67e1","tarball":"https://registry.npmjs.org/@typeschema/suretype/-/suretype-0.1.0.tgz","fileCount":7,"integrity":"sha512-pz2yXUdX5SdjNXgr7aZNs6sdBC6Q+IioaiG5I+idYbfyxdccvAyT0BMogfxKCrBQ7/vgGZJVCl+w3sGBhIXBgQ==","signatures":[{"sig":"MEUCIDa7poi8Vm+MC3mKFwau1CSkA31L1+Bewk2QGpqKFLaBAiEAk6IfZi40EcYxkpRpbAAVI/drLEGYKQEGgh4LqaZn03Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13432},"main":"dist/index.js","_from":"file:typeschema-suretype-0.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"lint":"eslint src --fix","test":"vitest --config ../../vitest.config.ts","build":"tsup --config ../../tsup.config.ts","lint:package":"publint && attw --pack","upgrade:deps":"ncu -u --dep=dev,peer --reject ow"},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"//version":"This field is manually maintained.","_resolved":"/tmp/41cc2bd6563e0be10320bd4389115621/typeschema-suretype-0.1.0.tgz","_integrity":"sha512-pz2yXUdX5SdjNXgr7aZNs6sdBC6Q+IioaiG5I+idYbfyxdccvAyT0BMogfxKCrBQ7/vgGZJVCl+w3sGBhIXBgQ==","repository":{"url":"git+https://github.com/decs/typeschema.git","type":"git"},"_npmVersion":"10.2.4","description":"Reusable adapter for Suretype schemas","directories":{},"sideEffects":false,"_nodeVersion":"20.11.1","dependencies":{"@typeschema/core":"0.13.2"},"//description":"This field is manually maintained.","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"suretype":"^3.3.1"},"peerDependencies":{"suretype":"^3.3.1"},"//devDependencies":"This field is manually maintained.","//peerDependencies":{"//":"This field is manually maintained.","suretype":"Required for inference, validation, and serialization"},"peerDependenciesMeta":{"suretype":{"optional":true}},"//peerDependenciesMeta":"This field is manually maintained.","_npmOperationalInternal":{"tmp":"tmp/suretype_0.1.0_1709410649104_0.40786028301197175","host":"s3://npm-registry-packages"}},"0.2.0":{"//":"This file is partially generated. Only some fields can be modified manually!","name":"@typeschema/suretype","//version":"This field is manually maintained.","version":"0.2.0","//description":"This field is manually maintained.","description":"Reusable adapter for Suretype schemas","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"homepage":"https://typeschema.com","license":"MIT","author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/decs/typeschema.git"},"dependencies":{"@typeschema/core":"0.14.0"},"//devDependencies":"This field is manually maintained.","devDependencies":{"suretype":"^3.3.1"},"//peerDependencies":{"//":"This field is manually maintained.","suretype":"Required for inference, validation, and serialization"},"peerDependencies":{"suretype":"^3.3.1"},"//peerDependenciesMeta":"This field is manually maintained.","peerDependenciesMeta":{"suretype":{"optional":true}},"scripts":{"build":"tsup --config ../../tsup.config.ts","lint":"eslint src --fix","lint:package":"publint && attw --pack","test":"vitest --config ../../vitest.config.ts","upgrade:deps":"ncu -u --dep=dev,peer --reject ow"},"_id":"@typeschema/suretype@0.2.0","bugs":{"url":"https://github.com/decs/typeschema/issues"},"_integrity":"sha512-AbVY4IHN3vGffUx40HPFaR5HMeXc/KyaBEP2sZsg8kL94EBfBzeLu0sg+0wR7cC1L2+M6MMdAYnkxMO08ESJnw==","_resolved":"/tmp/edc16ecb82802759c52758a63334b9b4/typeschema-suretype-0.2.0.tgz","_from":"file:typeschema-suretype-0.2.0.tgz","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-AbVY4IHN3vGffUx40HPFaR5HMeXc/KyaBEP2sZsg8kL94EBfBzeLu0sg+0wR7cC1L2+M6MMdAYnkxMO08ESJnw==","shasum":"bcc79d09150af5f68ebcd14d9831d5fe66ea8af4","tarball":"https://registry.npmjs.org/@typeschema/suretype/-/suretype-0.2.0.tgz","fileCount":7,"unpackedSize":13434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2c4b8tt8bMfgJxg6ucyHSbK/Fd3ui+MvC3bfqPCpaxAIgbe0zzwhcV7fLmpfqdPkteVD90rNI+6gHvkUFzx74x6U="}]},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"directories":{},"maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/suretype_0.2.0_1724625241114_0.17388816017734277"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-02T20:17:28.977Z","modified":"2024-08-25T22:34:01.448Z","0.1.0":"2024-03-02T20:17:29.300Z","0.2.0":"2024-08-25T22:34:01.258Z"},"bugs":{"url":"https://github.com/decs/typeschema/issues"},"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","homepage":"https://typeschema.com","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"repository":{"type":"git","url":"git+https://github.com/decs/typeschema.git"},"description":"Reusable adapter for Suretype schemas","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"readme":"<!-- This file is generated. Do not modify it manually! -->\n\n<img src=\"https://typeschema.com/assets/logo.png\" width=\"64px\" alt=\"TypeSchema\" />\n<h1>@typeschema/suretype</h1>\n<p>\n  <a href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"><img src=\"https://img.shields.io/github/license/decs/typeschema\" alt=\"License\"></a>\n  <a href=\"https://bundlephobia.com/package/@typeschema/suretype\" rel=\"nofollow\"><img src=\"https://img.shields.io/bundlephobia/minzip/%40typeschema%2Fsuretype\" alt=\"Bundle size\"></a>\n  <a href=\"https://www.npmjs.com/package/@typeschema/suretype\" rel=\"nofollow\"><img src=\"https://img.shields.io/npm/dw/@typeschema/suretype.svg\" alt=\"npm downloads\"></a>\n  <a href=\"https://github.com/decs/typeschema/stargazers\" rel=\"nofollow\"><img src=\"https://img.shields.io/github/stars/decs/typeschema\" alt=\"GitHub stars\"></a>\n</p>\n<p>\n  Reusable adapter for Suretype schemas\n  <br />\n  <a href=\"https://typeschema.com\">https://typeschema.com</a> ✨\n</p>\n\n```ts\nimport {initTRPC} from '@trpc/server';\nimport {v} from 'suretype';\n\nimport {wrap} from '@typeschema/suretype';\n\nconst schema = v.object({\n  name: v.string().required(),\n});\n\nconst t = initTRPC.create();\nconst appRouter = t.router({\n  hello: t.procedure\n    .input(wrap(schema))\n    .query(({input}) => `Hello, ${input.name}!`),\n  //         ^? {name: string}\n});\n\n```\n\nUse it directly or through [`@typeschema/main`](https://github.com/decs/typeschema/tree/main/packages/main)\n\n## Dependencies\n- [`suretype`](https://www.npmjs.com/package/suretype): Required for inference, validation, and serialization (`^3.3.1`)\n\n## API\n\n### Inference\n- `Infer<TSchema>`: Extracts the output type of a schema\n- `InferIn<TSchema>`: Extracts the input type of a schema\n\n### Validation\n- `wrap(schema)`: Returns the wrapped schema with access to its operations\n- `validate(schema, data)`: Returns the validated data or a list of validation issues\n- `assert(schema, data)`: Returns the validated data or throws an `AggregateError`\n\n### Serialization\n- `toJSONSchema(schema)`: Converts the schema into the equivalent JSON schema\n","readmeFilename":"README.md"}