New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

posthtml-ast-is-empty

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthtml-ast-is-empty - npm Package Compare versions

Comparing version 2.1.2 to 3.0.0

dist/posthtml-ast-is-empty.cjs.js

8

changelog.md

@@ -7,2 +7,9 @@ # Change Log

## [3.0.0] - 2017-12-09
### Changed
- ✨ Rebased in ES Modules. Now with help of Rollup we're generating 3 builds: CommonJS, UMD and ES Modules.
- ✨ Dropped JS Standards and tapped raw ESLint on `airbnb-base` preset, with only exception - semicolons off.
API hasn't changed, but bumping semver major just in case.
## 2.0.0 - 2016-12-25

@@ -14,2 +21,3 @@ ### Changed

[3.0.0]: https://github.com/codsen/posthtml-ast-is-empty/compare/v2.0.0...v3.0.0
[2.0.0]: https://github.com/codsen/posthtml-ast-is-empty/compare/v1.3.0...v2.0.0

135

package.json
{
"name": "posthtml-ast-is-empty",
"version": "2.1.2",
"description": "Find out, is nested array/object/string tree is empty",
"main": "index.js",
"version": "3.0.0",
"description": "Find out, is nested array/object/string/AST tree is empty",
"license": "MIT",
"engines": {
"node": ">=6",
"npm": ">=5",
"yarn": ">=1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/codsen/posthtml-ast-is-empty.git"
},
"bugs": {
"url": "https://github.com/codsen/posthtml-ast-is-empty/issues"
},
"homepage": "https://github.com/codsen/posthtml-ast-is-empty#readme",
"author": {
"email": "roy@codsen.com",
"name": "Roy Revelt",
"url": "codsen.com"
},
"main": "dist/posthtml-ast-is-empty.cjs.js",
"module": "dist/posthtml-ast-is-empty.esm.js",
"browser": "dist/posthtml-ast-is-empty.umd.js",
"scripts": {
"build": "rollup -c",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"dev": "rollup -c -w",
"precommit": "npm test",
"test": "standard && nyc --reporter=html --reporter=text ava"
"prepare": "npm run build",
"pretest": "npm run build",
"test": "./node_modules/.bin/eslint src/*.js test/*.js && nyc --reporter=html --reporter=text ava"
},
"repository": "codsen/posthtml-ast-is-empty",
"ava": {
"verbose": true
},
"clinton": {
"rules": {
"xo": 0
}
},
"keywords": [

@@ -33,12 +65,72 @@ "ast",

],
"author": {
"name": "Roy Revelt",
"email": "roy@codsen.com",
"url": "codsen.com"
"lect": {
"babelrc": {
"override": false,
"set": false
},
"badges": {
"contributors": true,
"cov": true,
"deps": true,
"deps2d": true,
"dev": true,
"downloads": true,
"license": true,
"node": true,
"npm": true,
"overall": true,
"runkit": true,
"travis": true,
"vulnerabilities": true
},
"contribution_types": [
"Answering Questions",
"Blogposts",
"Bug reports*",
"Code*",
"Documentation*",
"Design",
"Examples",
"Event Organizers",
"Financial Support",
"Funding/Grant Finders",
"Ideas & Planning",
"Infrastructure (Hosting, Build-Tools, etc)",
"Plugin/utility libraries",
"Reviewed Pull Requests",
"Tools",
"Translation",
"Tests*",
"Tutorials",
"Talks",
"Videos"
],
"contributors": [
{
"contribution": [
"Code",
"Documentation",
"Tests"
],
"username": "revelt"
}
],
"eslintrc": {
"add": [],
"remove": []
},
"header": {
"dontQuoteDescription": false,
"rightFloatedBadge": ""
},
"licence": {
"extras": []
},
"various": {
"back_to_top": {
"enabled": true,
"label": ""
}
}
},
"license": "MIT",
"bugs": {
"url": "https://github.com/codsen/posthtml-ast-is-empty/issues"
},
"homepage": "https://github.com/codsen/posthtml-ast-is-empty#readme",
"dependencies": {

@@ -49,10 +141,17 @@ "lodash.isplainobject": "*"

"ava": "*",
"babel-preset-env": "^1.6.1",
"coveralls": "*",
"eslint": "^4.13.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-ava": "^4.4.0",
"eslint-plugin-import": "^2.8.0",
"husky": "*",
"nyc": "*",
"standard": "^10.0.3"
},
"ava": {
"verbose": false
"rollup": "^0.52.1",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify": "^2.0.1",
"uglify-es": "^3.2.1"
}
}

105

readme.md
# posthtml-ast-is-empty
<a href="https://standardjs.com" style="float: right; padding: 0 0 20px 20px;"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard JavaScript" width="100" align="right"></a>
<a href="https://github.com/revelt/eslint-on-airbnb-base-badge" style="float: right; padding: 0 0 20px 20px;"><img src="https://cdn.rawgit.com/revelt/eslint-on-airbnb-base-badge/0c3e46c9/lint-badge.svg" alt="ESLint on airbnb-base with caveats" width="100" align="right"></a>
> Find out, is nested array/object/string tree (like PostHTML-parsed AST) is empty
> Find out, is nested array/object/string/AST tree is empty
[![Minimum Node version required][node-img]][node-url]
[![Link to npm page][npm-img]][npm-url]
[![Build Status][travis-img]][travis-url]
[![Coverage][cov-img]][cov-url]
[![bitHound Overall Score][overall-img]][overall-url]
[![bitHound Dependencies][deps-img]][deps-url]
[![View dependencies as 2D chart][deps2d-img]][deps2d-url]
[![bitHound Dev Dependencies][dev-img]][dev-url]
[![Coverage Status][cov-img]][cov-url]
[![Known Vulnerabilities][vulnerabilities-img]][vulnerabilities-url]
[![Downloads/Month][downloads-img]][downloads-url]
[![View dependencies as 2D chart][deps2d-img]][deps2d-url]
[![Test in browser][runkit-img]][runkit-url]
[![MIT License][license-img]][license-url]

@@ -27,6 +29,4 @@ > This is not a PostHTML plugin but a regular JS library. It is meant to work with anything, including nested array/object trees, like parsed HTML, that is, AST (abstract syntax trees) that come out of the PostHTML-parser. Hence the name, `posthtml-ast-`.

- [Install](#install)
- [Use](#use)
- [Rationale](#rationale)
- [API](#api)
- [Testing](#testing)
- [Contributing](#contributing)

@@ -40,11 +40,10 @@ - [Licence](#licence)

```bash
$ npm install --save posthtml-ast-is-empty
$ npm i posthtml-ast-is-empty
```
## Use
```js
// require first:
var isEmpty = require('posthtml-ast-is-empty')
...
// consume as CommonJS require:
const isEmpty = require('posthtml-ast-is-empty')
// or as a ES Module:
import isEmpty from 'posthtml-ast-is-empty'
// then, for example, feed a parsed HTML tree into it:

@@ -54,2 +53,12 @@ console.log(isEmpty(htmlAstObj))

Here's what you'll get:
Type | Key in `package.json` | Path | Size
----------------|-----------------------|-------|--------
Main export - **CommonJS version**, transpiled, contains `require` and `module.exports` | `main` | `dist/posthtml-ast-is-empty.cjs.js` | 1&nbsp;KB
**ES module** build that Webpack/Rollup understands. Untranspiled ES6 code with `import`/`export`. | `module` | `dist/posthtml-ast-is-empty.esm.js` | 893&nbsp;B
**UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/posthtml-ast-is-empty.umd.js` | 1&nbsp;KB
**[⬆ &nbsp;back to top](#)**
## Rationale

@@ -97,4 +106,8 @@

**[⬆ &nbsp;back to top](#)**
## API
Anything-in, Boolean-out.
```js

@@ -107,68 +120,56 @@ isEmpty (

## Testing
## Contributing
```bash
$ npm test
```
Hi! 99% of people in the society are passive - consumers. They wait for others to take action, they prefer to blend in. The remaining 1% are proactive citizens who will _do_ something rather than _wait_. If you are one of that 1%, you're in luck because I am the same and _together_ we can make something happen.
Unit tests use [AVA](https://github.com/avajs/ava), [Istanbul CLI](https://www.npmjs.com/package/nyc) (to count test coverage) and, of course, [JS Standard](https://standardjs.com) notation.
* If you **want a new feature** in this package or you would like to change some of its functionality, raise an [issue on this repo](https://github.com/codsen/posthtml-ast-is-empty/issues). Also, you can [email me](mailto:roy@codsen.com). Just let it out.
## Contributing
* If you tried to use this library but it misbehaves, or **you need an advice setting it up**, and its readme doesn't make sense, just document it and raise an [issue on this repo](https://github.com/codsen/posthtml-ast-is-empty/issues). Alternatively, you can [email me](mailto:roy@codsen.com).
All contributions are welcome. Please stick to [Standard JavaScript](https://standardjs.com) notation and supplement the `test.js` with new unit tests covering your feature(s).
* If you don't like the code in here and would like to **give an advice** about how something could be done better, please do. Same drill - [GitHub issues](https://github.com/codsen/posthtml-ast-is-empty/issues) or [email](mailto:roy@codsen.com), your choice.
If you see anything incorrect whatsoever, do [raise an issue](https://github.com/codsen/posthtml-ast-is-empty/issues). If you file a pull request, I'll do my best to help you to get it merged soon. If you have any comments on the code, including ideas how to improve things, don't hesitate to contact me by email.
* If you would like to **add or change some features**, just fork it, hack away, and file a pull request. I'll do my best to merge it quickly. Code style is `airbnb`, only without semicolons. If you use a good code editor, it will pick up the established ESLint setup.
**[⬆ &nbsp;back to top](#)**
## Licence
> MIT License (MIT)
MIT License (MIT)
> Copyright (c) 2017 Codsen Ltd, Roy Revelt
Copyright © 2017 Codsen Ltd, Roy Revelt
> Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
[node-img]: https://img.shields.io/node/v/posthtml-ast-is-empty.svg?style=flat-square&label=works%20on%20node
[node-url]: https://www.npmjs.com/package/posthtml-ast-is-empty
> The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[npm-img]: https://img.shields.io/npm/v/posthtml-ast-is-empty.svg
[npm-img]: https://img.shields.io/npm/v/posthtml-ast-is-empty.svg?style=flat-square&label=release
[npm-url]: https://www.npmjs.com/package/posthtml-ast-is-empty
[travis-img]: https://travis-ci.org/codsen/posthtml-ast-is-empty.svg?branch=master
[travis-img]: https://img.shields.io/travis/codsen/posthtml-ast-is-empty.svg?style=flat-square
[travis-url]: https://travis-ci.org/codsen/posthtml-ast-is-empty
[cov-img]: https://coveralls.io/repos/github/codsen/posthtml-ast-is-empty/badge.svg?branch=master
[cov-img]: https://coveralls.io/repos/github/codsen/posthtml-ast-is-empty/badge.svg?style=flat-square?branch=master
[cov-url]: https://coveralls.io/github/codsen/posthtml-ast-is-empty?branch=master
[overall-img]: https://www.bithound.io/github/codsen/posthtml-ast-is-empty/badges/score.svg
[overall-img]: https://img.shields.io/bithound/code/github/codsen/posthtml-ast-is-empty.svg?style=flat-square
[overall-url]: https://www.bithound.io/github/codsen/posthtml-ast-is-empty
[deps-img]: https://www.bithound.io/github/codsen/posthtml-ast-is-empty/badges/dependencies.svg
[deps-img]: https://img.shields.io/bithound/dependencies/github/codsen/posthtml-ast-is-empty.svg?style=flat-square
[deps-url]: https://www.bithound.io/github/codsen/posthtml-ast-is-empty/master/dependencies/npm
[dev-img]: https://www.bithound.io/github/codsen/posthtml-ast-is-empty/badges/devDependencies.svg
[deps2d-img]: https://img.shields.io/badge/deps%20in%202D-see_here-08f0fd.svg?style=flat-square
[deps2d-url]: http://npm.anvaka.com/#/view/2d/posthtml-ast-is-empty
[dev-img]: https://img.shields.io/bithound/devDependencies/github/codsen/posthtml-ast-is-empty.svg?style=flat-square
[dev-url]: https://www.bithound.io/github/codsen/posthtml-ast-is-empty/master/dependencies/npm
[downloads-img]: https://img.shields.io/npm/dm/posthtml-ast-is-empty.svg
[downloads-url]: https://www.npmjs.com/package/posthtml-ast-is-empty
[vulnerabilities-img]: https://snyk.io/test/github/codsen/posthtml-ast-is-empty/badge.svg
[vulnerabilities-img]: https://snyk.io/test/github/codsen/posthtml-ast-is-empty/badge.svg?style=flat-square
[vulnerabilities-url]: https://snyk.io/test/github/codsen/posthtml-ast-is-empty
[deps2d-img]: https://img.shields.io/badge/deps%20in%202D-see_here-08f0fd.svg
[deps2d-url]: http://npm.anvaka.com/#/view/2d/posthtml-ast-is-empty
[downloads-img]: https://img.shields.io/npm/dm/posthtml-ast-is-empty.svg?style=flat-square
[downloads-url]: https://npmcharts.com/compare/posthtml-ast-is-empty
[runkit-img]: https://img.shields.io/badge/runkit-test_in_browser-a853ff.svg
[runkit-img]: https://img.shields.io/badge/runkit-test_in_browser-a853ff.svg?style=flat-square
[runkit-url]: https://npm.runkit.com/posthtml-ast-is-empty
[license-img]: https://img.shields.io/npm/l/posthtml-ast-is-empty.svg?style=flat-square
[license-url]: https://github.com/codsen/posthtml-ast-is-empty/blob/master/license.md
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc