{"name":"bare-type","version":"1.2.0","author":{"name":"Holepunch"},"license":"Apache-2.0","_id":"bare-type@1.2.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":"961edc441bfdd01ed87537f88b76bc1e658eb3c3","tarball":"http://registry-npm.ywwl.com/bare-type/download/bare-type-1.2.0.tgz","fileCount":21,"integrity":"sha512-ezfNV5zskrsVQkdaprY8XQ47gneuOzleIQj6eLnbzqnKPZNgOoMYyRBoDoG9vJhe/uUF1Xae6vHYBkv5oaXicg==","signatures":[{"sig":"MEUCICrCfXzh/KbPp3HXYRVFSHkvLGHMYl2spmwePYyncbj/AiEA8ewrgQZT1xX5+mqj1lgJvwR7gRBxTXzIk03iOO6US+A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIEaGqi0QawpWHSNnNd7/pdcSllaR5JZ5DinPTJhVGEy0AiAXwhD/K2vOG5L+cWbwUy0fixGZtSU9uPLHRPMxdw4AXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/bare-type@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":521603,"size":146579,"noattachment":false,"key":"/bare-type/-/bare-type-1.2.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":"fcf09a42abac0ce1f7279545d9f5ef13c8792f27","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.20.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.2.0_1790062887263_0.7902299360241747","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":1790062887375,"_cnpm_publish_time":1790062887375,"dist-tags":{"latest":"1.4.0"}}