Installation
Quick Take
Examples
- Recognise a tree made only from empty strings and containers
- Return null when the tree contains an unsupported value type
- Treat whitespace-only strings as content
Purpose
Sometimes you need to check, does given AST contain only empty structures:
- empty strings (those that trim to zero length)
- arrays containing zero or more keys containing empty structures
- plain objects with containing zero or more keys containing empty structures
This program helps with that.
API — isEmpty()
The main function isEmpty() is imported like this:
It’s a function which takes one input arguments, of any type:
It returns boolean or null (in case of non-AST structure, like a function).
API — version
You can import version: