@jsenv/utils
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -1,2 +0,2 @@ | ||
import { require } from "@jsenv/utils/require.js" | ||
import { parse, serialize, parseFragment } from "parse5" | ||
@@ -11,4 +11,3 @@ // https://github.com/inikulin/parse5/blob/master/packages/parse5/lib/tree-adapters/default.js | ||
) => { | ||
const parse5 = require("parse5") | ||
const htmlAst = parse5.parse(htmlString, { sourceCodeLocationInfo: true }) | ||
const htmlAst = parse(htmlString, { sourceCodeLocationInfo: true }) | ||
if (storeOriginalPositions) { | ||
@@ -167,3 +166,2 @@ const htmlNode = findChild(htmlAst, (node) => node.nodeName === "html") | ||
) => { | ||
const parse5 = require("parse5") | ||
if (removeOriginalPositionAttributes) { | ||
@@ -188,3 +186,3 @@ const htmlNode = findChild(htmlAst, (node) => node.nodeName === "html") | ||
} | ||
const htmlString = parse5.serialize(htmlAst) | ||
const htmlString = serialize(htmlAst) | ||
@@ -195,4 +193,3 @@ return htmlString | ||
export const parseSvgString = (svgString) => { | ||
const parse5 = require("parse5") | ||
const svgAst = parse5.parseFragment(svgString, { | ||
const svgAst = parseFragment(svgString, { | ||
sourceCodeLocationInfo: true, | ||
@@ -477,4 +474,3 @@ }) | ||
)}>${textContent}</${tagName}>` | ||
const parse5 = require("parse5") | ||
const fragment = parse5.parseFragment(html) | ||
const fragment = parseFragment(html) | ||
return fragment.childNodes[0] | ||
@@ -481,0 +477,0 @@ } |
{ | ||
"name": "@jsenv/utils", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"license": "MIT", | ||
@@ -32,3 +32,3 @@ "repository": { | ||
"magic-string": "0.26.2", | ||
"parse5": "6.0.1", | ||
"parse5": "7.0.0", | ||
"postcss": "8.4.14", | ||
@@ -35,0 +35,0 @@ "postcss-value-parser": "4.2.0", |
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
182989
5306
+ Addedentities@4.5.0(transitive)
+ Addedparse5@7.0.0(transitive)
- Removedparse5@6.0.1(transitive)
Updatedparse5@7.0.0