Have ideas to improve npm?Join in the discussion! »

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

2.0.6 • 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

7,159

Version

2.0.6

License

MIT

Unpacked Size

21 kB

Total Files

12

Last publish

Collaborators

  • avatar