Socket
Socket
Sign inDemoInstall

parse5-htmlparser2-tree-adapter

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse5-htmlparser2-tree-adapter - npm Package Compare versions

Comparing version 7.0.0 to 7.1.0

3

dist/cjs/index.d.ts
import { type TreeAdapterTypeMap, type TreeAdapter } from 'parse5';
import { type AnyNode, type ParentNode, type ChildNode, Element, Document, ProcessingInstruction, Comment, Text } from 'domhandler';
export declare type Htmlparser2TreeAdapterMap = TreeAdapterTypeMap<AnyNode, ParentNode, ChildNode, Document, Document, Element, Comment, Text, Element, ProcessingInstruction>;
export type Htmlparser2TreeAdapterMap = TreeAdapterTypeMap<AnyNode, ParentNode, ChildNode, Document, Document, Element, Comment, Text, Element, ProcessingInstruction>;
/** @internal */
export declare function serializeDoctypeContent(name: string, publicId: string, systemId: string): string;
export declare const adapter: TreeAdapter<Htmlparser2TreeAdapterMap>;
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.adapter = exports.serializeDoctypeContent = void 0;
exports.adapter = void 0;
exports.serializeDoctypeContent = serializeDoctypeContent;
const parse5_1 = require("parse5");
const domhandler_1 = require("domhandler");
function createTextNode(value) {
return new domhandler_1.Text(value);
}
function enquoteDoctypeId(id) {

@@ -30,3 +28,2 @@ const quote = id.includes('"') ? "'" : '"';

}
exports.serializeDoctypeContent = serializeDoctypeContent;
exports.adapter = {

@@ -65,2 +62,5 @@ // Re-exports from domhandler

},
createTextNode(value) {
return new domhandler_1.Text(value);
},
//Tree mutation

@@ -104,5 +104,5 @@ appendChild(parentNode, newNode) {

}
doctypeNode['x-name'] = name !== null && name !== void 0 ? name : undefined;
doctypeNode['x-publicId'] = publicId !== null && publicId !== void 0 ? publicId : undefined;
doctypeNode['x-systemId'] = systemId !== null && systemId !== void 0 ? systemId : undefined;
doctypeNode['x-name'] = name;
doctypeNode['x-publicId'] = publicId;
doctypeNode['x-systemId'] = systemId;
},

@@ -137,3 +137,3 @@ setDocumentMode(document, mode) {

else {
exports.adapter.appendChild(parentNode, createTextNode(text));
exports.adapter.appendChild(parentNode, exports.adapter.createTextNode(text));
}

@@ -147,3 +147,3 @@ },

else {
exports.adapter.insertBefore(parentNode, createTextNode(text), referenceNode);
exports.adapter.insertBefore(parentNode, exports.adapter.createTextNode(text), referenceNode);
}

@@ -154,3 +154,3 @@ },

const attrName = attrs[i].name;
if (typeof recipient.attribs[attrName] === 'undefined') {
if (recipient.attribs[attrName] === undefined) {
recipient.attribs[attrName] = attrs[i].value;

@@ -221,2 +221,1 @@ recipient['x-attribsNamespace'][attrName] = attrs[i].namespace;

};
//# sourceMappingURL=index.js.map
import { type TreeAdapterTypeMap, type TreeAdapter } from 'parse5';
import { type AnyNode, type ParentNode, type ChildNode, Element, Document, ProcessingInstruction, Comment, Text } from 'domhandler';
export declare type Htmlparser2TreeAdapterMap = TreeAdapterTypeMap<AnyNode, ParentNode, ChildNode, Document, Document, Element, Comment, Text, Element, ProcessingInstruction>;
export type Htmlparser2TreeAdapterMap = TreeAdapterTypeMap<AnyNode, ParentNode, ChildNode, Document, Document, Element, Comment, Text, Element, ProcessingInstruction>;
/** @internal */
export declare function serializeDoctypeContent(name: string, publicId: string, systemId: string): string;
export declare const adapter: TreeAdapter<Htmlparser2TreeAdapterMap>;
//# sourceMappingURL=index.d.ts.map
import { html } from 'parse5';
import { Element, Document, ProcessingInstruction, Comment, Text, isDirective, isText, isComment, isTag, } from 'domhandler';
function createTextNode(value) {
return new Text(value);
}
function enquoteDoctypeId(id) {

@@ -60,2 +57,5 @@ const quote = id.includes('"') ? "'" : '"';

},
createTextNode(value) {
return new Text(value);
},
//Tree mutation

@@ -99,5 +99,5 @@ appendChild(parentNode, newNode) {

}
doctypeNode['x-name'] = name !== null && name !== void 0 ? name : undefined;
doctypeNode['x-publicId'] = publicId !== null && publicId !== void 0 ? publicId : undefined;
doctypeNode['x-systemId'] = systemId !== null && systemId !== void 0 ? systemId : undefined;
doctypeNode['x-name'] = name;
doctypeNode['x-publicId'] = publicId;
doctypeNode['x-systemId'] = systemId;
},

@@ -132,3 +132,3 @@ setDocumentMode(document, mode) {

else {
adapter.appendChild(parentNode, createTextNode(text));
adapter.appendChild(parentNode, adapter.createTextNode(text));
}

@@ -142,3 +142,3 @@ },

else {
adapter.insertBefore(parentNode, createTextNode(text), referenceNode);
adapter.insertBefore(parentNode, adapter.createTextNode(text), referenceNode);
}

@@ -149,3 +149,3 @@ },

const attrName = attrs[i].name;
if (typeof recipient.attribs[attrName] === 'undefined') {
if (recipient.attribs[attrName] === undefined) {
recipient.attribs[attrName] = attrs[i].value;

@@ -219,2 +219,1 @@ recipient['x-attribsNamespace'][attrName] = attrs[i].namespace;

};
//# sourceMappingURL=index.js.map

@@ -5,6 +5,6 @@ {

"description": "htmlparser2 tree adapter for parse5.",
"version": "7.0.0",
"version": "7.1.0",
"author": "Ivan Nikulin <ifaaan@gmail.com> (https://github.com/inikulin)",
"contributors": "https://github.com/inikulin/parse5/graphs/contributors",
"homepage": "https://github.com/inikulin/parse5",
"homepage": "https://parse5.js.org",
"funding": "https://github.com/inikulin/parse5?sponsor=1",

@@ -26,7 +26,7 @@ "keywords": [

"dependencies": {
"domhandler": "^5.0.2",
"domhandler": "^5.0.3",
"parse5": "^7.0.0"
},
"scripts": {
"build:cjs": "tsc --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
"build:cjs": "tsc --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
},

@@ -38,5 +38,6 @@ "repository": {

"files": [
"dist",
"!*.map"
"dist/cjs/package.json",
"dist/**/*.js",
"dist/**/*.d.ts"
]
}
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