{"name":"bare-type","version":"1.3.0","author":{"name":"Holepunch"},"license":"Apache-2.0","_id":"bare-type@1.3.0","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/holepunchto/bare-type#readme","bugs":{"url":"https://github.com/holepunchto/bare-type/issues"},"dist":{"shasum":"417c3fc4bff0ee5911f1e3560230c9b4aafc1934","tarball":"http://registry-npm.ywwl.com/bare-type/download/bare-type-1.3.0.tgz","fileCount":21,"integrity":"sha512-tkjQYFt36GSlF/0dFycMm+vGREy6YOgy08EXxuZ1C6wQgTWNT6VcILNUdU81vHTF0YDUVoIzxtpUs11uwl3ihg==","signatures":[{"sig":"MEYCIQCiZHB2mbxjOIdfbK4k6sHhe+5LFYogdMybc6gcbGxjgQIhAN+95erJ4j0lYJ7/hrFqgSkn5N4dNA8Tlx1voBAWha0K","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDvcGUuHBEIo42fx0Sb4bxc9YLhTQiHI69K3MDG1cAdTwIhAIBW9O9RW4ZF6oNSX1Q4uvU56bnoAb2a8nrXaVoMweT/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/bare-type@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":523939,"size":147129,"noattachment":false,"key":"/bare-type/-/bare-type-1.3.0.tgz"},"addon":true,"types":"./index.d.ts","engines":{"bare":">=1.32.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./package":"./package.json"},"gitHead":"2988b3d37cc33a0f7bfce776e18c965a92a751dd","scripts":{"lint":"prettier --check . && lunte","test":"brittle-bare --coverage test.js","format":"prettier --write . && lunte --fix"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:26f91582-25e8-4d64-8d58-08c9e679e288"}},"repository":{"url":"git+https://github.com/holepunchto/bare-type.git","type":"git"},"_npmVersion":"11.19.0","description":"Cross-realm type predicates for Bare","directories":{},"_nodeVersion":"24.21.0","_hasShrinkwrap":false,"devDependencies":{"lunte":"^1.8.4","brittle":"^3.4.0","prettier":"^3.4.1","cmake-bare":"^1.1.6","prettier-config-holepunch":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bare-type_1.3.0_1790078859909_0.5425855161081874","host":"s3://npm-registry-packages-npm-production"},"readme":"# bare-type\n\nCross-realm type predicates for Bare.\n\n```\nnpm i bare-type\n```\n\n## Usage\n\n```js\nconst type = require('bare-type')\n\nif (type(123).isNumber()) {\n  console.log(123, 'is a number')\n}\n```\n\nTo test a value against many types at once, switch on `type.of()` rather than walking the predicates. Every constant carries its base type, so each one matches outright:\n\n```js\nconst type = require('bare-type')\n\nconst { ARRAY, DATE, MAP } = type.constants\n\nswitch (type.of(value)) {\n  case ARRAY:\n    return value.length\n  case DATE:\n    return value.getTime()\n  case MAP:\n    return value.size\n}\n```\n\n## API\n\nSee the [`bare-type` reference](https://docs.pears.com/reference/bare/modules/bare-type).\n\n## Threat model\n\n`bare-type` is one of the addons Bare compiles into its binary, so it inherits [Bare's threat model](https://github.com/holepunchto/bare/blob/main/docs/threat-model.md). See [`docs/threat-model.md`](docs/threat-model.md) for where this addon sits in it.\n\n## License\n\nApache-2.0\n","publish_time":1790078860007,"_cnpm_publish_time":1790078860007,"dist-tags":{"latest":"1.4.0"}}