Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

prevOpen Source→ast-contains-only-empty-spacenext

ast-contains-only-empty-space4.2.0

Does AST contain only empty space?

Downloads per monthChangelogMIT Licenselibera manifesto
  • the top
  • Installation
  • Quick Take
  • Examples
  • PURPOSE
  • API — EMPTY()
  • API — VERSION
  • Changelog

Installation

Quick Take

Examples

  • Non-object values
  • Non-plain objects
  • Various

Purpose

Working with parsed HTML is always a battle against the white space. This program tells if given data structure is empty. Various nested structures consisting of whitespace strings counts as empty here.

API — empty()

The main function empty() is imported like this:

It’s a function which takes one input argument:

The function returns a boolean.

None of the input arguments will be mutated by this program, we have unit tests to prove that.

API — version

You can import version:

Changelog

Open Changelog
↑ back to top
prev next

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab