Narcoleptic Programmers' Medicine
    Wondering what’s next for npm?Check out our public roadmap! »

    ast-is-empty
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.16 • Public • Published

    ast-is-empty

    Find out, is nested array/object/string/AST tree is empty

    Install

    npm i ast-is-empty

    Quick Take

    import { strict as assert } from "assert";
    import { isEmpty } from "ast-is-empty";
    
    assert.equal(
      isEmpty({
        a: "",
      }),
      true
    );
    
    assert.equal(
      isEmpty({
        a: [""],
        b: {
          c: {
            d: "",
          },
        },
      }),
      true
    );
    
    assert.equal(
      isEmpty([
        {
          a: [""],
          b: { c: { d: "" } },
        },
        "",
        ["", "", ""],
      ]),
      true
    );

    Documentation

    Please visit codsen.com for a full description of the API and examples.

    Contributing

    To report bugs or request features or assistance, raise an issue on GitHub.

    Licence

    MIT License

    Copyright (c) 2010-2021 Roy Revelt and other contributors

    ok codsen star

    Install

    npm i ast-is-empty

    DownloadsWeekly Downloads

    8,013

    Version

    2.0.16

    License

    MIT

    Unpacked Size

    20.5 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar