Socket
Socket
Sign inDemoInstall

rehype-remove-duplicate-attribute-values

Package Overview
Dependencies
6
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

36

index.js

@@ -8,34 +8,38 @@ /**

'use strict';
'use strict'
var uniq = require('uniq');
var array = require('x-is-array');
var visit = require('unist-util-visit');
var is = require('hast-util-is-element');
var attributes = require('./schema');
var uniq = require('uniq')
var array = require('x-is-array')
var visit = require('unist-util-visit')
var is = require('hast-util-is-element')
var attributes = require('./schema')
module.exports = empty;
module.exports = empty
var own = {}.hasOwnProperty;
var own = {}.hasOwnProperty
function empty() {
return transform;
return transform
}
function transform(tree) {
visit(tree, 'element', visitor);
visit(tree, 'element', visitor)
}
function visitor(node) {
var props = node.properties;
var prop;
var val;
var props = node.properties
var prop
var val
for (prop in props) {
val = props[prop];
val = props[prop]
if (own.call(attributes, prop) && is(node, attributes[prop]) && array(val)) {
uniq(val);
if (
own.call(attributes, prop) &&
is(node, attributes[prop]) &&
array(val)
) {
uniq(val)
}
}
}
{
"name": "rehype-remove-duplicate-attribute-values",
"version": "1.0.1",
"description": "Remove duplicates in attribute values with unique tokens",
"version": "1.0.2",
"description": "rehype plugin to remove duplicates in attribute values with unique tokens",
"license": "MIT",
"keywords": [
"unified",
"rehype",

@@ -14,5 +15,5 @@ "hast",

],
"repository": "https://github.com/wooorm/rehype-minify/tree/master/packages/rehype-remove-duplicate-attribute-values",
"bugs": "https://github.com/wooorm/rehype-minify/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"repository": "https://github.com/rehypejs/rehype-minify/tree/master/packages/rehype-remove-duplicate-attribute-values",
"bugs": "https://github.com/rehypejs/rehype-minify/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [

@@ -19,0 +20,0 @@ "Titus Wormer <tituswormer@gmail.com>"

@@ -5,2 +5,10 @@ <!--This file is generated by `build-packages.js`-->

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
Remove duplicates in attribute values with unique tokens.

@@ -10,2 +18,4 @@

[npm][]:
```sh

@@ -29,4 +39,54 @@ npm install rehype-remove-duplicate-attribute-values

## Contribute
See [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [Code of Conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT](https://github.com/wooorm/rehype-minify/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com)
[MIT][license] © [Titus Wormer][author]
[build-badge]: https://img.shields.io/travis/rehypejs/rehype-minify.svg
[build]: https://travis-ci.org/rehypejs/rehype-minify
[coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype-minify.svg
[coverage]: https://codecov.io/github/rehypejs/rehype-minify
[downloads-badge]: https://img.shields.io/npm/dm/rehype-remove-duplicate-attribute-values.svg
[downloads]: https://www.npmjs.com/package/rehype-remove-duplicate-attribute-values
[size-badge]: https://img.shields.io/bundlephobia/minzip/rehype-remove-duplicate-attribute-values.svg
[size]: https://bundlephobia.com/result?p=rehype-remove-duplicate-attribute-values
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[chat]: https://spectrum.chat/unified/rehype
[npm]: https://docs.npmjs.com/cli/install
[health]: https://github.com/rehypejs/.github
[contributing]: https://github.com/rehypejs/.github/blob/master/contributing.md
[support]: https://github.com/rehypejs/.github/blob/master/support.md
[coc]: https://github.com/rehypejs/.github/blob/master/code-of-conduct.md
[license]: https://github.com/rehypejs/rehype-minify/blob/master/license
[author]: https://wooorm.com
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc