{"name":"bare-type","version":"1.1.1","author":{"name":"Holepunch"},"license":"Apache-2.0","_id":"bare-type@1.1.1","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":"987a123b45a5c2d860b8be15ca33db7fa0315d29","tarball":"http://registry-npm.ywwl.com/bare-type/download/bare-type-1.1.1.tgz","fileCount":21,"integrity":"sha512-5HwbjDbnYr+Lwu5I59IqwOFcRcVo4jxo408t42gKhKnikw0ojwyPXPlx58AQP4dR2VvGw57ppX/qxYCn60Wujw==","signatures":[{"sig":"MEUCIBijb3MggAbESOYoFLVdXy7GL5+z+wd+K+/Q0zXIuuz/AiEAn72oMrf9LwtsM0cOgYtToklCytz05mJ7yKNrtdm1dC4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/bare-type@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":541982,"size":153669,"noattachment":false,"key":"/bare-type/-/bare-type-1.1.1.tgz"},"addon":true,"types":"./index.d.ts","engines":{"bare":">=1.2.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./package":"./package.json"},"gitHead":"33a5acd4dd335653f44c63f5c3117e973a290a6b","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.17.0","description":"Cross-realm type predicates for Bare","directories":{},"_nodeVersion":"24.19.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.1.1_1788248105903_0.7918883329804045","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":1788248106109,"_cnpm_publish_time":1788248106109,"dist-tags":{"latest":"1.4.0"}}