Newline Proliferating Maniac

    hast-util-is-conditional-comment
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    hast-util-is-conditional-comment

    Build Coverage Downloads Size Sponsors Backers Chat

    Check if a node is a conditional comment.

    Install

    This package is ESM only: Node 12+ is needed to use it and it must be importeded instead of requiredd.

    npm:

    npm install hast-util-is-conditional-comment

    This package exports the following identifiers: isConditionalComment. There is no default export.

    Use

    import {u} from 'unist-builder'
    import {isConditionalComment} from 'hast-util-is-conditional-comment'
    
    isConditionalComment(u('comment', '[if IE]>...<![endif]')) //=> true
    isConditionalComment(u('comment', '<![endif]')) //=> true
    isConditionalComment(u('comment', 'foo')) //=> false

    API

    isConditionalComment(node)

    Return true if node is a comment node matching one of the know IE conditional comments.

    Contribute

    See contributing.md in rehypejs/.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

    Install

    npm i hast-util-is-conditional-comment

    DownloadsWeekly Downloads

    12,092

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    5.38 kB

    Total Files

    4

    Last publish

    Collaborators

    • wooorm
    • kmck