3.0.0 • Published 10 months ago

unist-util-generated v3.0.0

Weekly downloads
1,709,074
License
MIT
Repository
github
Last release
10 months ago

unist-util-generated

Build Coverage Downloads Size Sponsors Backers Chat

unist utility to check if a node is generated.

Contents

What is this?

This utility can be used to check if a node is said to be generated.

When should I use this?

You can use this utility to check is generated. Generated nodes were not in the source of the original file, and thus not authored by a human. This info can then be used to not emit lint messages for generated content.

You might also find the utility unist-util-position useful to get clean positional info. To display positional info to users, use unist-util-stringify-position.

Install

This package is ESM only. In Node.js (version 16+), install with npm:

npm install unist-util-generated

In Deno with esm.sh:

import {generated} from 'https://esm.sh/unist-util-generated@3'

In browsers with esm.sh:

<script type="module">
  import {generated} from 'https://esm.sh/unist-util-generated@3?bundle'
</script>

Use

import {generated} from 'unist-util-generated'

generated({}) // => true

generated({position: {start: {}, end: {}}}) // => true

generated({
  position: {start: {line: 1, column: 1}, end: {line: 1, column: 2}}
}) // => false

API

This package exports the identifier generated. There is no default export.

generated(node)

Check if node is generated.

Parameters
  • node (Node) — node to check
Returns

Whether node is generated (does not have positional info) (boolean).

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

Projects maintained by the unified collective are compatible with maintained versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of Node. This means we try to keep the current release line, unist-util-generated@^2, compatible with Node.js 16.

Related

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

@mapbox/remark-lint-mapbox@saaspe/components@everything-registry/sub-chunk-3014mdast-util-to-hast-cooekdesign-system-fitbank-450sequelcomponentremark-remove-unused-definitionsremark-lint-blank-lines-1-0-2remark-lint-books-linksremark-frontmatter-validatorremark-lint-relative-markdown-file-path-linksremark-lint-heading-word-lengthremark-lint-hiring-without-whiteboards-linksremark-lint-docusaurus-empty-lines-around-admonition-contentremark-lint-fenced-code-flag-caseremark-lint-list-item-styleremark-lint-mdash-styleremark-lint-no-auto-link-without-protocolremark-lint-no-inline-paddingremark-lint-no-empty-image-alt-text@blkmarketco/components-libraryreact-form-component-library@akollegger/remark-lint-play-mdxfn-lib-examplesvelte-component-libtldrawlignin@sfdocs-internal/remark-lint-media-path-constraint@sfdocs-internal/remark-lint-no-dead-url@sfdocs-internal/remark-lint-reference-path@sfdocs-internal/restrict-image-modification@sfdocs-internal/orphan-link-linter@sfdocs-internal/remark-include-resolver@sfdocs-internal/remark-lint-check-allowed-headers@sfdocs-internal/remark-lint-first-heading-level@sfdocs-internal/remark-lint-heading-linting-rules@sfdocs-internal/image-linting-rules@sfdocs-internal/no-modified-images@sfdocs-internal/check-linkszzzxxxyyy321123@shivarajapple/first-library@skeetboothppq/component-library@vitali_shcherbina/styled-libappcharge-checkoutappcharge-checkout-reactjs-sdk@stefanprobst/remark-lint-no-auto-linksadarshsinghal-editor-previewvremark-parseunist-util-to-list-of-char@mdoc/mdast-util-to-hastmdast-util-to-hast-backport@lego-js/testsnlcst-emoji-modifiernpm-all-packages@podlubnaja/ui-kitparvan_componentsparvan_reactjs_components@rdx-js/language-mdast-hast@scm-manager/remark-preset-lint@freeletics/remark-lint-blank-lines
3.0.0

10 months ago

2.0.1

1 year ago

2.0.0

3 years ago

1.1.6

3 years ago

1.1.5

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago