Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

ast-is-empty

1.10.10 • 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.

Licence

MIT License

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

ok codsen star

Install

npm i ast-is-empty

DownloadsWeekly Downloads

6,849

Version

1.10.10

License

MIT

Unpacked Size

15 kB

Total Files

10

Last publish

Collaborators

  • avatar