{"_id":"@accuser/mdast-util-directive-type-guards","_rev":"1-4702362fec3a7b602eba7243995a0c8b","name":"@accuser/mdast-util-directive-type-guards","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@accuser/mdast-util-directive-type-guards","version":"1.0.0","keywords":["directive","mdast","typescript","type guard"],"author":{"url":"https://github.com/accuser","name":"Matthew Gibbons","email":"mhgibbons@me.com"},"license":"MIT","_id":"@accuser/mdast-util-directive-type-guards@1.0.0","maintainers":[{"name":"accuser","email":"mhgibbons@me.com"}],"homepage":"https://github.com/accuser/mdast-util-directive-type-guards#readme","bugs":{"url":"https://github.com/accuser/mdast-util-type-directive-guards/issues"},"dist":{"shasum":"7d71c3b9907881f9fc9c7805f393dc3f441e5cbb","tarball":"https://registry.npmjs.org/@accuser/mdast-util-directive-type-guards/-/mdast-util-directive-type-guards-1.0.0.tgz","fileCount":18,"integrity":"sha512-iPRfY4jFwgl/ddpxKYhQF1Oa34xm7kZ/E9L1t1/AJhgw++4z+is/8DJdlLulJ5JlXU705CjNQu0dyVhUED/BPw==","signatures":[{"sig":"MEQCICXN6MZZx9sHp9bc2SubiRnBWqEvSyxG8JNw/PCH2IOUAiBcx9nlx3U3dRU2H+bIIGkxEtJN4/uBb15cTI7na2UweA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13556},"main":"dist/index.js","type":"module","_from":"file:accuser-mdast-util-directive-type-guards-1.0.0.tgz","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"default":"./dist/index.js","require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"./package.json":"./package.json"},"scripts":{"lint":"eslint","test":"vitest","build":"pnpm build:cjs && pnpm build:esm","format":"prettier --write {src,test}/**/*.{js,ts}","build:cjs":"tsc --module commonjs --outDir dist/cjs","build:esm":"tsc"},"_npmUser":{"name":"accuser","email":"mhgibbons@me.com"},"_resolved":"/tmp/9fa521ad7e9fdb8b076b847ad94f98ba/accuser-mdast-util-directive-type-guards-1.0.0.tgz","_integrity":"sha512-iPRfY4jFwgl/ddpxKYhQF1Oa34xm7kZ/E9L1t1/AJhgw++4z+is/8DJdlLulJ5JlXU705CjNQu0dyVhUED/BPw==","repository":{"url":"git+https://github.com/accuser/mdast-util-directive-type-guards.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript type guards for `mdast` directive nodes.","directories":{},"_nodeVersion":"20.17.0","dependencies":{"mdast-util-directive":"^3.0.0","@accuser/mdast-util-type-guards":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.7.0","eslint":"^9.11.0","vitest":"^2.1.1","prettier":"^3.3.3","typescript":"^5.6.2","@types/node":"^22.5.5","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.6.0","@typescript-eslint/eslint-plugin":"^8.6.0"},"_npmOperationalInternal":{"tmp":"tmp/mdast-util-directive-type-guards_1.0.0_1726890849266_0.888146810497362","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@accuser/mdast-util-directive-type-guards","version":"1.1.0","description":"TypeScript type guards for `mdast` directive nodes.","type":"module","main":"dist/index.js","exports":{".":{"default":"./dist/index.js","import":{"default":"./dist/index.js","types":"./dist/index.d.ts"},"require":{"default":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts"}},"./package.json":"./package.json"},"keywords":["directive","mdast","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/mdast-util-directive-type-guards.git"},"bugs":{"url":"https://github.com/accuser/mdast-util-type-directive-guards/issues"},"devDependencies":{"@types/node":"^22.5.5","@typescript-eslint/eslint-plugin":"^8.6.0","@typescript-eslint/parser":"^8.6.0","eslint":"^9.11.0","eslint-config-prettier":"^9.1.0","prettier":"^3.3.3","tslib":"^2.7.0","typescript":"^5.6.2","vitest":"^2.1.1"},"dependencies":{"@accuser/mdast-util-type-guards":"^1.0.3","mdast-util-directive":"^3.0.0"},"scripts":{"build":"pnpm build:cjs && pnpm build:esm","build:cjs":"tsc --module commonjs --outDir dist/cjs","build:esm":"tsc","format":"prettier --write {src,test}/**/*.{js,ts}","lint":"eslint","test":"vitest"},"_id":"@accuser/mdast-util-directive-type-guards@1.1.0","types":"./dist/index.d.ts","homepage":"https://github.com/accuser/mdast-util-directive-type-guards#readme","_integrity":"sha512-TqOdsQN7sUt7wS3TYqtxzwKtuQbDTmW8e3gXSwxXtfcPJaFKVLjj1AzNWoO5/oQEpTNE3Ca/duKEhfVPJ56cjg==","_resolved":"/tmp/f9ddc4329fda6aaaadf8b2d48ddc9ab9/accuser-mdast-util-directive-type-guards-1.1.0.tgz","_from":"file:accuser-mdast-util-directive-type-guards-1.1.0.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-TqOdsQN7sUt7wS3TYqtxzwKtuQbDTmW8e3gXSwxXtfcPJaFKVLjj1AzNWoO5/oQEpTNE3Ca/duKEhfVPJ56cjg==","shasum":"06bb9205b02da2a09acaa6337b769d73816fd770","tarball":"https://registry.npmjs.org/@accuser/mdast-util-directive-type-guards/-/mdast-util-directive-type-guards-1.1.0.tgz","fileCount":22,"unpackedSize":17328,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCiqqJvt4k7c5a6PFrgQbtjGcXEKFUGIFMr2CM4W4zcWwIgYjOh07+Sn8FWT1cYz9ldXF7Quk6geQj02DU58PrYLfI="}]},"_npmUser":{"name":"accuser","email":"mhgibbons@me.com"},"directories":{},"maintainers":[{"name":"accuser","email":"mhgibbons@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mdast-util-directive-type-guards_1.1.0_1738247200188_0.6936577001724633"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-21T03:54:09.161Z","modified":"2025-01-30T14:26:40.531Z","1.0.0":"2024-09-21T03:54:09.435Z","1.1.0":"2025-01-30T14:26:40.373Z"},"bugs":{"url":"https://github.com/accuser/mdast-util-type-directive-guards/issues"},"author":{"name":"Matthew Gibbons","email":"mhgibbons@me.com","url":"https://github.com/accuser"},"license":"MIT","homepage":"https://github.com/accuser/mdast-util-directive-type-guards#readme","keywords":["directive","mdast","typescript","type guard"],"repository":{"type":"git","url":"git+https://github.com/accuser/mdast-util-directive-type-guards.git"},"description":"TypeScript type guards for `mdast` directive nodes.","maintainers":[{"name":"accuser","email":"mhgibbons@me.com"}],"readme":"# TypeScript Type Guards for Mdast Directive Nodes\n\nThis package provides TypeScript type guards for [Mdast](https://github.com/syntax-tree/mdast) [Directive](https://github.com/syntax-tree/mdast-util-directive) nodes.\n\n## Installation\n\n```sh\nnpm install @accuser/mdast-util-directive-type-guards\n```\n\n## Usage\n\n```ts\nimport { isTextDirective } from '@accuser/mdast-util-directive-type-guards';\n\nconst node = {\n\ttype: 'textDirective',\n\tname: 'foo',\n\tchildren: [{ type: 'text', value: 'Hello, world!' }]\n} as unknown;\n\nif (isTextDirective(node)) {\n\t// node is TextDirective\n}\n```\n\n## API\n\nThis package exports the identifiers:\n\n- [`isContainerDirective`](api-iscontainterdirective)\n- [`isDirectives`](api-isdirectives)\n- [`isLeafDirective`](api-isleafdirective)\n- [`isTextDirective`](api-istextdirective)\n\nThere is no default export.\n\n### `isContainerDirective(node: unknown): node is ContainerDirective`\n\nTest if a given value is a valid Mdast `ContainerDirective` node.\n\n###### Parameters\n\n- `node` (`unknown`)\n  - value to check.\n\n###### Returns\n\nReturns `true` if `node` is a valid `ContainerDirective` node.\n\n###### Example\n\n```ts\nimport { isContainerDirective } from '@accuser/mdast-util-directive-type-guards';\n\nconst node = {\n\ttype: 'containerDirective',\n\tname: 'foo',\n\tchildren: [{ type: 'text', value: 'Hello, world!' }]\n} as unknown;\n\nif (isContainerDirective(node)) {\n\tconsole.log(node.name); // 'foo'\n\tconsole.log(node.children[0]); // { type: 'text', value: 'Hello, world!' }\n}\n```\n\n### `isDirectives(node: unknown): node is Directives`\n\nTest if a given value is a valid Mdast `Directives` node.\n\n###### Parameters\n\n- `node` (`unknown`)\n  - value to check.\n\n###### Returns\n\nReturns `true` if `node` is a valid `Directives` node.\n\n###### Example\n\n```ts\nimport { isDirectives } from '@accuser/mdast-util-directive-type-guards';\n\nconst node = {\n\ttype: 'containerDirective',\n\tname: 'foo',\n\tchildren: [{ type: 'text', value: 'Hello, world!' }]\n} as unknown;\n\nif (isDirectives(node)) {\n\tconsole.log(node.name); // 'foo'\n\tconsole.log(node.children[0]); // { type: 'text', value: 'Hello, world!' }\n}\n```\n\n### `isLeftDirective(node: unknown): node is LeftDirective`\n\nTest if a given value is a valid Mdast `LeafDirective` node.\n\n###### Parameters\n\n- `node` (`unknown`)\n  - value to check.\n\n###### Returns\n\nReturns `true` if `node` is a valid `LeafDirective` node.\n\n###### Example\n\n```ts\nimport { isLeafDirective } from '@accuser/mdast-util-directive-type-guards';\n\nconst node = {\n\ttype: 'leafDirective',\n\tname: 'foo',\n\tchildren: [{ type: 'text', value: 'Hello, world!' }]\n} as unknown;\n\nif (isLeafDirective(node)) {\n\tconsole.log(node.name); // 'foo'\n\tconsole.log(node.children[0]); // { type: 'text', value: 'Hello, world!' }\n}\n```\n\n### `isTextDirective(node: unknown): node is TextDirective`\n\nTest if a given value is a valid Mdast `TextDirective` node.\n\n###### Parameters\n\n- `node` (`unknown`)\n  - value to check.\n\n###### Returns\n\nReturns `true` if `node` is a valid `TextDirective` node.\n\n###### Example\n\n```ts\nimport { isTextDirective } from '@accuser/mdast-util-directive-type-guards';\n\nconst node = {\n\ttype: 'textDirective',\n\tname: 'foo',\n\tchildren: [{ type: 'text', value: 'Hello, world!' }]\n} as unknown;\n\nif (isTextDirective(node)) {\n\tconsole.log(node.name); // 'foo'\n\tconsole.log(node.children[0]); // { type: 'text', value: 'Hello, world!' }\n}\n```\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-iscontainterdirective]: #iscontainerdirectivenode-unknown-node-is-containerdirective\n[api-isdirectives]: #isdirectivesnode-unknown-node-is-directives\n[api-isleafdirective]: #isleafdirectivenode-unknown-node-is-leafdirective\n[api-istextdirective]: #istextdirectivenode-unknown-node-is-textdirective\n","readmeFilename":"README.md"}