rehype-remove-duplicate-attribute-values
Advanced tools
Comparing version 4.0.0 to 4.0.1
export { default } from "./lib/index.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,2 +8,3 @@ /** | ||
export default function rehypeRemoveDuplicateAttributeValues(): (tree: Root) => undefined; | ||
export type Root = import('hast').Root; | ||
import type { Root } from 'hast'; | ||
//# sourceMappingURL=index.d.ts.map |
/** | ||
* @typedef {import('hast').Root} Root | ||
* @import {Root} from 'hast' | ||
*/ | ||
@@ -25,14 +25,14 @@ | ||
/** @type {string} */ | ||
let prop | ||
let property | ||
for (prop in node.properties) { | ||
if (Object.hasOwn(node.properties, prop)) { | ||
const value = node.properties[prop] | ||
for (property in node.properties) { | ||
if (Object.hasOwn(node.properties, property)) { | ||
const value = node.properties[property] | ||
if ( | ||
Object.hasOwn(schema, prop) && | ||
isElement(node, schema[prop]) && | ||
Object.hasOwn(schema, property) && | ||
isElement(node, schema[property]) && | ||
Array.isArray(value) | ||
) { | ||
node.properties[prop] = [...new Set(value)] | ||
node.properties[property] = [...new Set(value)] | ||
} | ||
@@ -39,0 +39,0 @@ } |
/** @type {Record<string, Array<string> | string | null>} */ | ||
export const schema: Record<string, Array<string> | string | null>; | ||
//# sourceMappingURL=schema.d.ts.map |
{ | ||
"name": "rehype-remove-duplicate-attribute-values", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "rehype plugin to remove duplicates in attribute values with unique tokens", | ||
@@ -34,2 +34,3 @@ "license": "MIT", | ||
"index.d.ts", | ||
"index.d.ts.map", | ||
"index.js", | ||
@@ -50,3 +51,8 @@ "lib/" | ||
}, | ||
"xo": false | ||
"xo": { | ||
"prettier": true, | ||
"rules": { | ||
"capitalized-comments": "off" | ||
} | ||
} | ||
} |
@@ -17,16 +17,16 @@ <!--This file is generated--> | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`unified().use(rehypeRemoveDuplicateAttributeValues)`](#unifieduserehyperemoveduplicateattributevalues) | ||
* [Example](#example) | ||
* [Syntax](#syntax) | ||
* [Syntax tree](#syntax-tree) | ||
* [Types](#types) | ||
* [Compatibility](#compatibility) | ||
* [Security](#security) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`unified().use(rehypeRemoveDuplicateAttributeValues)`](#unifieduserehyperemoveduplicateattributevalues) | ||
* [Example](#example) | ||
* [Syntax](#syntax) | ||
* [Syntax tree](#syntax-tree) | ||
* [Types](#types) | ||
* [Compatibility](#compatibility) | ||
* [Security](#security) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
@@ -33,0 +33,0 @@ ## What is this? |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10868
12