{"_id":"@accuser/hast-util-type-guards","name":"@accuser/hast-util-type-guards","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@accuser/hast-util-type-guards","version":"1.0.0","description":"TypeScript type guards for `hast` nodes.","type":"module","main":"dist/index.js","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"keywords":["hast","typescript","type guard"],"author":{"name":"Matthew Gibbons","email":"mhgibbons@me.com","url":"https://github.com/accuser"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/accuser/hast-util-type-guards.git"},"bugs":{"url":"https://github.com/accuser/hast-util-type-guards/issues"},"devDependencies":{"@types/node":"^22.7.4","@typescript-eslint/eslint-plugin":"^8.8.0","@typescript-eslint/parser":"^8.8.0","eslint":"^9.11.1","eslint-config-prettier":"^9.1.0","prettier":"^3.3.3","tslib":"^2.7.0","typescript":"^5.6.2","vitest":"^2.1.2"},"dependencies":{"@accuser/unist-util-type-guards":"^1.1.0","@types/hast":"^3.0.4"},"scripts":{"build":"tsc","format":"prettier --write {src,test}/**/*.{js,ts}","lint":"eslint","test":"vitest"},"_id":"@accuser/hast-util-type-guards@1.0.0","types":"./dist/index.d.ts","homepage":"https://github.com/accuser/hast-util-type-guards#readme","_integrity":"sha512-0YuXacKP1M0af8op11uubI39rAX+78T3M5Ia+XxqDrzDXAYvOGCjeqR432TpJhXYfN3CyHw0LQA1+jpZerDWtw==","_resolved":"/tmp/eb84ee153b5f9d3c2864330c31a5f636/accuser-hast-util-type-guards-1.0.0.tgz","_from":"file:accuser-hast-util-type-guards-1.0.0.tgz","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-0YuXacKP1M0af8op11uubI39rAX+78T3M5Ia+XxqDrzDXAYvOGCjeqR432TpJhXYfN3CyHw0LQA1+jpZerDWtw==","shasum":"09ebe95d868a49a6af2f4e3229f81169a3a8f47b","tarball":"https://registry.npmjs.org/@accuser/hast-util-type-guards/-/hast-util-type-guards-1.0.0.tgz","fileCount":26,"unpackedSize":18616,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGszQM/KiEwiFWwo6BO/3DfnSV1y8paFTiy8zfK3d1LVAiEA2CQ1uY2GkN2jQfhVjIdybISaoWk9Dsf14FmAZxoNsKs="}]},"_npmUser":{"name":"accuser","email":"mhgibbons@me.com"},"directories":{},"maintainers":[{"name":"accuser","email":"mhgibbons@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-type-guards_1.0.0_1728022032268_0.5563335239909557"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-04T06:07:12.189Z","1.0.0":"2024-10-04T06:07:12.440Z","modified":"2024-10-04T06:07:12.680Z"},"maintainers":[{"name":"accuser","email":"mhgibbons@me.com"}],"description":"TypeScript type guards for `hast` nodes.","homepage":"https://github.com/accuser/hast-util-type-guards#readme","keywords":["hast","typescript","type guard"],"repository":{"type":"git","url":"git+https://github.com/accuser/hast-util-type-guards.git"},"author":{"name":"Matthew Gibbons","email":"mhgibbons@me.com","url":"https://github.com/accuser"},"bugs":{"url":"https://github.com/accuser/hast-util-type-guards/issues"},"license":"MIT","readme":"# TypeScript Type Guards for Hast Nodes\n\nThis package provides TypeScript type guards for [Hast](https://github.com/syntax-tree/hast) nodes.\n\n## Installation\n\n```sh\nnpm install @accuser/hast-util-type-guards\n```\n\n## Usage\n\n```ts\nimport { isText } from '@accuser/hast-util-type-guards';\n\nconst value = {\n  type: 'text',\n  value: 'Hello, world!'\n};\n\nisNode(value); // true, value is Node\nisLiteral(value); // true, value is Literal\nisText(value); // true, value is Text\n```\n\n## API\n\nThis package exports the identifiers:\n\n- [`isComment`](api-iscomment)\n- [`isDoctype`](api-isdoctype)\n- [`isElement`](api-iselement)\n- [`isLiteral`](api-isliteral)\n- [`isNode`](api-isnode)\n- [`isParent`](api-isparent)\n- [`isRoot`](api-isroot)\n- [`isText`](api-istext)\n\nThere is no default export.\n\n### `isComment(value: unknown): value is Comment`\n\nTest if the given value is a valid [`Comment`](https://github.com/syntax-tree/hast/#comment) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Comment`](https://github.com/syntax-tree/hast/#comment) node.\n\n### `isDoctype(value: unknown): value is Doctype`\n\nTest if the given value is a valid [`Doctype`](https://github.com/syntax-tree/hast/#doctype) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Doctype`](https://github.com/syntax-tree/hast/#doctype) node.\n\n### `isElement(value: unknown): value is Element`\n\nTest if the given value is a valid [`Element`](https://github.com/syntax-tree/hast/#element) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Element`](https://github.com/syntax-tree/hast/#element) node.\n\n### `isLiteral(value: unknown): value is Literal`\n\nTest is a given value is a valid [`Literal`](https://github.com/syntax-tree/hast/#literal) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid Unist literal value.\n\n### `isNode(value: unknown): value is Node`\n\nTest if a given value is a valid [`Node`](https://github.com/syntax-tree/hast/#node).\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Node`](https://github.com/syntax-tree/hast/#node).\n\n### `isParent(value: unknown): value is Parent`\n\nTest is a given value is a valid [`Parent`](https://github.com/syntax-tree/hast/#parent) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Parent`](https://github.com/syntax-tree/hast/#parent) node.\n\n### `isRoot(value: unknown): value is Root`\n\nTest if a given value is a valid [`Root`](https://github.com/syntax-tree/hast/#root) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Root`](https://github.com/syntax-tree/hast/#root) node.\n\n### `isText(value: unknown): value is Text`\n\nTest if a given value is a valid [`Text`](https://github.com/syntax-tree/hast/#text) node.\n\n###### Parameters\n\n* `value` (`unknown`)\n\t- value to check.\n\n###### Returns\n\nReturns `true` if `value` is a valid [`Text`](https://github.com/syntax-tree/hast/#text) node.\n\n## Tests\n\n```sh\nnpm test\n```\n\n## License\n\n[MIT](https://raw.githubusercontent.com/accuser/unist-util-type-guards/main/LICENSE)\n\n[api-iscomment]: #isliteralvalue-unknown-value-is-comment\n[api-isdoctype]: #isliteralvalue-unknown-value-is-doctype\n[api-iselement]: #iselementvalue-unknown-value-is-element\n[api-isliteral]: #isliteralvalue-unknown-value-is-literal\n[api-isnode]: #isnodevalue-unknown-value-is-node\n[api-isparent]: #isparentvalue-unknown-value-is-parent\n[api-isroot]: #isrootvalue-unknown-value-is-root\n[api-istext]: #istextvalue-unknown-value-is-text","readmeFilename":"README.md"}