Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parse5/tools

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parse5/tools - npm Package Compare versions

Comparing version 0.0.2-1 to 0.0.2-4

2

lib/main.d.ts

@@ -110,3 +110,3 @@ import { html, Token } from 'parse5';

*/
export declare function createElement(tagName: string, namespaceURI?: html.NS, attrs?: Record<string, string> | Token.Attribute[]): Element;
export declare function createElement(tagName: string, namespaceURI?: html.NS | string, attrs?: Record<string, string> | Token.Attribute[]): Element;
/**

@@ -113,0 +113,0 @@ * Sets the text content of the given node

@@ -171,2 +171,10 @@ import { defaultTreeAdapter, html } from 'parse5';

}
const namespaceMap = {
HTML: html.NS.HTML,
XML: html.NS.XML,
MATHML: html.NS.MATHML,
SVG: html.NS.SVG,
XLINK: html.NS.XLINK,
XMLNS: html.NS.XMLNS
};
/**

@@ -181,2 +189,3 @@ * Creates an element node

const normalisedAttrs = [];
const normalisedNamespace = namespaceMap[namespaceURI.toUpperCase()] ?? namespaceURI;
if (Array.isArray(attrs)) {

@@ -197,3 +206,3 @@ for (const attr of attrs) {

}
return defaultTreeAdapter.createElement(tagName, namespaceURI, normalisedAttrs);
return defaultTreeAdapter.createElement(tagName, normalisedNamespace, normalisedAttrs);
}

@@ -200,0 +209,0 @@ /**

{
"name": "@parse5/tools",
"version": "0.0.2-1",
"version": "0.0.2-4",
"description": "A small set of utilities for dealing with parse5 syntax trees",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

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