{"name":"hast-util-whitespace","version":"2.0.1","description":"hast utility to check if a node is inter-element whitespace","license":"MIT","keywords":["unist","hast","hast-util","util","utility","html","inter","element","inter-element","white-space","whitespace"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/hast-util-whitespace.git"},"bugs":{"url":"https://github.com/syntax-tree/hast-util-whitespace/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/node":"^18.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.53.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"9d5e793c0d8e099581cb6d49056672e34f76ee01","homepage":"https://github.com/syntax-tree/hast-util-whitespace#readme","_id":"hast-util-whitespace@2.0.1","_nodeVersion":"19.3.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==","shasum":"0ec64e257e6fc216c7d14c8a1b74d27d650b4557","tarball":"http://registry-npm.ywwl.com/hast-util-whitespace/download/hast-util-whitespace-2.0.1.tgz","fileCount":5,"unpackedSize":11400,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3pkKv1Wf8q/l3XSQa97Jjpu4ZlGUZJRBtmBpKFUCj+gIhAP7+rDq2jl6kBTjgJVtUuk5oLdEt4WtvPl4H+y4zA2+t"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuA82ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrbBAAnnTNBnGr7/PnAB21TIPoEDCBC+Pu9GdspkliGV+ckz9e3Kuc\r\nkluCgOylze5PQdF3rFW9fpAw/OZnc9DZC91zhrdMdTxuUYwdFiekwKkXjc+W\r\nCbk9roLdzprSQyRfltcigca2SICZcVlgACzy/XHGp4O09UDzDBsBBi+wTvea\r\nIPEz9BD0rQ9+eGXY3CZpcEVgbtQcp6fk3P9zM4UcC1099Wz4hR2ckeVztWW0\r\nOQB+mqTGwdBE8tAaji+EiJymM/1fnzpQXDg/wuaHu8od4zbZTZeQxosnAZ52\r\nG4d8ZfpjBgLVMd0IUIc62TC4qB+tQqzKLS7Y8Oa2+HouAPtH3FN0kfF8/vPc\r\nG7m9jqwMLtzAkgmsAQpWbVRdJfIT4hgm4UfUC7DUVLjRhHwHXUHda5Mij83j\r\nPwHfkADTs+ztgcqGgKpsebh/Vyc5ji+OmT+EATB5O48/lVNHMia2R+Sa9pqd\r\nI07MMnNBJInJLGr26VAWLT2/nr/mU+BkjvYYg5AStZmXX6qo2R2gK0d3D2Th\r\njXqIgdMjZ/lFunrobHc1EnkD9ulf7YHCP44oAWatMv22VU2HLIEGYvbSAZsw\r\nOajcVwYV7pHGxvwqJqdMSm7xmSwg3S9aGFpFA9geXW2+v+7BA0wEiQr962TT\r\nhrin+35CMUVwNDdVcyL797tSVA9ToUsF6SQ=\r\n=AEh4\r\n-----END PGP SIGNATURE-----\r\n","size":4047,"noattachment":false,"key":"/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-whitespace_2.0.1_1673006902624_0.6260609618630901"},"_hasShrinkwrap":false,"readme":"# hast-util-whitespace\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[hast][] utility to check if a node is [*inter-element whitespace*][spec].\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`whitespace(thing)`](#whitespacething)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a small utility that checks if a node is whitespace according to\nHTML.\n\n## When should I use this?\n\nThis utility is super niche, if you’re here you probably know what you’re\nlooking for!\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install hast-util-whitespace\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {whitespace} from 'https://esm.sh/hast-util-whitespace@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {whitespace} from 'https://esm.sh/hast-util-whitespace@3?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {whitespace} from 'hast-util-whitespace'\n\nwhitespace({\n  type: 'element',\n  tagName: 'div',\n  properties: {},\n  children: []\n}) // => false\n\nwhitespace({\n  type: 'text',\n  value: '\\t  \\n'\n}) // => true\n\nwhitespace({\n  type: 'text',\n  value: '  text\\f'\n}) // => false\n```\n\n## API\n\nThis package exports the identifier [`whitespace`][api-whitespace].\nThere is no default export.\n\n### `whitespace(thing)`\n\nCheck if the given value is [*inter-element whitespace*][spec].\n\n###### Parameters\n\n*   `thing` ([`Node`][node] or `string`, optional)\n    — thing to check\n\n###### Returns\n\nWhether the `value` is inter-element whitespace (`boolean`): consisting of zero\nor more of space, tab (`\\t`), line feed (`\\n`), carriage return (`\\r`), or form\nfeed (`\\f`).\nIf a node is passed it must be a [`Text`][text] node, whose `value` field is\nchecked.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `hast-util-whitespace@^3`,\ncompatible with Node.js 16.\n\n## Security\n\n`hast-util-whitespace` does not change the syntax tree so there are no openings\nfor [cross-site scripting (XSS)][xss] attacks.\n\n## Related\n\n*   [`hast-util-is-element`](https://github.com/syntax-tree/hast-util-is-element)\n    — check if a node is a (certain) element\n*   [`hast-util-has-property`](https://github.com/syntax-tree/hast-util-has-property)\n    — check if a node has a property\n*   [`hast-util-transparent`](https://github.com/syntax-tree/hast-util-transparent)\n    — check if a node is a transparent element\n*   [`hast-util-heading`](https://github.com/syntax-tree/hast-util-heading)\n    — check if a node is a heading element\n*   [`hast-util-labelable`](https://github.com/syntax-tree/hast-util-labelable)\n    — check whether a node is labelable\n*   [`hast-util-phrasing`](https://github.com/syntax-tree/hast-util-phrasing)\n    — check if a node is phrasing content\n*   [`hast-util-embedded`](https://github.com/syntax-tree/hast-util-embedded)\n    — check if a node is an embedded element\n*   [`hast-util-sectioning`](https://github.com/syntax-tree/hast-util-sectioning)\n    — check if a node is a sectioning element\n*   [`hast-util-interactive`](https://github.com/syntax-tree/hast-util-interactive)\n    — check if a node is interactive\n*   [`hast-util-script-supporting`](https://github.com/syntax-tree/hast-util-script-supporting)\n    — check if a node is a script-supporting element\n*   [`hast-util-is-body-ok-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-body-ok-link)\n    — check if a node is “Body OK” link element\n*   [`hast-util-is-conditional-comment`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-conditional-comment)\n    — check if a node is a conditional comment\n*   [`hast-util-is-css-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-link)\n    — check if a node is a CSS link element\n*   [`hast-util-is-css-style`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-style)\n    — check if a node is a CSS style element\n*   [`hast-util-is-javascript`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-javascript)\n    — check if a node is a JavaScript script element\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definition -->\n\n[build-badge]: https://github.com/syntax-tree/hast-util-whitespace/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/hast-util-whitespace/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-whitespace.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/hast-util-whitespace\n\n[downloads-badge]: https://img.shields.io/npm/dm/hast-util-whitespace.svg\n\n[downloads]: https://www.npmjs.com/package/hast-util-whitespace\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-whitespace\n\n[size]: https://bundlejs.com/?q=hast-util-whitespace\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[hast]: https://github.com/syntax-tree/hast\n\n[spec]: https://html.spec.whatwg.org/multipage/dom.html#inter-element-whitespace\n\n[node]: https://github.com/syntax-tree/hast#nodes\n\n[text]: https://github.com/syntax-tree/hast#text\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-whitespace]: #whitespacething\n","publish_time":1673006902786,"_cnpm_publish_time":1673006902786,"dist-tags":{"latest":"3.0.0"}}