Comparing version 3.0.0 to 3.0.1
'use strict'; | ||
var _escape = require('./escape.js'); | ||
var escape = require('./escape.js'); | ||
@@ -326,5 +326,5 @@ /** | ||
} else if (typeof child === "string") { | ||
writer(_escape.escapeXMLText(child)); | ||
writer(escape.escapeXMLText(child)); | ||
} else if (child.toString) { | ||
writer(_escape.escapeXMLText(child.toString(10))); | ||
writer(escape.escapeXMLText(child.toString(10))); | ||
} | ||
@@ -348,3 +348,3 @@ } | ||
writer('="'); | ||
writer(_escape.escapeXML(typeof v === "string" ? v : v.toString(10))); | ||
writer(escape.escapeXML(typeof v === "string" ? v : v.toString(10))); | ||
writer('"'); | ||
@@ -351,0 +351,0 @@ } |
@@ -51,3 +51,3 @@ 'use strict'; | ||
exports.childrenEqual = childrenEqual; | ||
exports['default'] = equal; | ||
exports.default = equal; | ||
exports.nameEqual = nameEqual; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const escapeXMLTable = { | ||
@@ -6,0 +4,0 @@ "&": "&", |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var Element = require('./Element.js'); | ||
@@ -6,0 +4,0 @@ |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var parse = require('./parse.js'); | ||
var Parser = require('./Parser.js'); | ||
var _escape = require('./escape.js'); | ||
var escape = require('./escape.js'); | ||
var Element = require('./Element.js'); | ||
@@ -22,10 +20,10 @@ var equal = require('./equal.js'); | ||
exports.Parser = Parser; | ||
exports.escapeXML = _escape.escapeXML; | ||
exports.escapeXMLText = _escape.escapeXMLText; | ||
exports.unescapeXML = _escape.unescapeXML; | ||
exports.unescapeXMLText = _escape.unescapeXMLText; | ||
exports.escapeXML = escape.escapeXML; | ||
exports.escapeXMLText = escape.escapeXMLText; | ||
exports.unescapeXML = escape.unescapeXML; | ||
exports.unescapeXMLText = escape.unescapeXMLText; | ||
exports.Element = Element; | ||
exports.attrsEqual = equal.attrsEqual; | ||
exports.childrenEqual = equal.childrenEqual; | ||
exports.equal = equal['default']; | ||
exports.equal = equal.default; | ||
exports.nameEqual = equal.nameEqual; | ||
@@ -32,0 +30,0 @@ exports.createElement = createElement; |
'use strict'; | ||
var libxmljs = require('./parsers/libxmljs.js'); | ||
var ltx = require('./parsers/ltx.js'); | ||
@@ -9,6 +10,4 @@ var nodeExpat = require('./parsers/node-expat.js'); | ||
// import libxmljs from "./parsers/libxmljs.js"; | ||
var parsers = [ | ||
// libxmljs, | ||
libxmljs, | ||
ltx, | ||
@@ -15,0 +14,0 @@ nodeExpat, |
@@ -6,10 +6,6 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var libxmljs__default = /*#__PURE__*/_interopDefaultLegacy(libxmljs); | ||
class SaxLibxmljs extends events.EventEmitter { | ||
constructor() { | ||
super(); | ||
this.parser = new libxmljs__default['default'].SaxPushParser(); | ||
this.parser = new libxmljs.SaxPushParser(); | ||
@@ -16,0 +12,0 @@ this.parser.on("startElementNS", (name, attrs, prefix, uri, nss) => { |
'use strict'; | ||
var events = require('events'); | ||
var _escape = require('../escape.js'); | ||
var escape = require('../escape.js'); | ||
@@ -41,6 +41,6 @@ const STATE_TEXT = 0; | ||
if (selfClosing) { | ||
this.emit("endElement", tagName); | ||
this.emit("endElement", tagName, true); | ||
} | ||
} else { | ||
this.emit("endElement", tagName); | ||
this.emit("endElement", tagName, false); | ||
} | ||
@@ -122,3 +122,3 @@ }; | ||
if (text) { | ||
this.emit("text", _escape.unescapeXML(text)); | ||
this.emit("text", escape.unescapeXML(text)); | ||
} | ||
@@ -230,3 +230,3 @@ state = STATE_TAG_NAME; | ||
if (c === attrQuote) { | ||
const value = _escape.unescapeXML(endRecording()); | ||
const value = escape.unescapeXML(endRecording()); | ||
attrs[attrName] = value; | ||
@@ -233,0 +233,0 @@ attrName = undefined; |
@@ -6,6 +6,2 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var expat__default = /*#__PURE__*/_interopDefaultLegacy(expat); | ||
class SaxExpat extends events.EventEmitter { | ||
@@ -15,3 +11,3 @@ constructor() { | ||
this.parser = new expat__default['default'].Parser("UTF-8"); | ||
this.parser = new expat.Parser("UTF-8"); | ||
@@ -18,0 +14,0 @@ this.parser.on("startElement", (name, attrs) => { |
@@ -5,8 +5,4 @@ 'use strict'; | ||
var xml = require('node-xml'); | ||
var _escape = require('../escape.js'); | ||
var escape = require('../escape.js'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var xml__default = /*#__PURE__*/_interopDefaultLegacy(xml); | ||
/** | ||
@@ -19,3 +15,3 @@ * This cannot be used as long as node-xml starts parsing only after | ||
super(); | ||
this.parser = new xml__default['default'].SaxParser((handler) => { | ||
this.parser = new xml.SaxParser((handler) => { | ||
handler.onStartElementNS((elem, attrs, prefix, uri, namespaces) => { | ||
@@ -29,3 +25,3 @@ let i; | ||
const attr = attrs[i]; | ||
attrsHash[attr[0]] = _escape.unescapeXML(attr[1]); | ||
attrsHash[attr[0]] = escape.unescapeXML(attr[1]); | ||
} | ||
@@ -35,3 +31,3 @@ for (i = 0; i < namespaces.length; i++) { | ||
const k = !namespace[0] ? "xmlns" : "xmlns:" + namespace[0]; | ||
attrsHash[k] = _escape.unescapeXML(namespace[1]); | ||
attrsHash[k] = escape.unescapeXML(namespace[1]); | ||
} | ||
@@ -38,0 +34,0 @@ this.emit("startElement", elem, attrsHash); |
@@ -6,10 +6,6 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var sax__default = /*#__PURE__*/_interopDefaultLegacy(sax); | ||
class SaxSaxjs extends events.EventEmitter { | ||
constructor() { | ||
super(); | ||
this.parser = sax__default['default'].parser(true); | ||
this.parser = sax.parser(true); | ||
@@ -16,0 +12,0 @@ this.parser.onopentag = (a) => { |
@@ -6,10 +6,6 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var saxes__default = /*#__PURE__*/_interopDefaultLegacy(saxes); | ||
class SaxSaxesjs extends events.EventEmitter { | ||
constructor() { | ||
super(); | ||
this.parser = new saxes__default['default'].SaxesParser({ fragment: true }); | ||
this.parser = new saxes.SaxesParser({ fragment: true }); | ||
@@ -16,0 +12,0 @@ this.parser.on("opentag", (a) => { |
'use strict'; | ||
var _escape = require('./escape.js'); | ||
var escape = require('./escape.js'); | ||
@@ -14,3 +14,3 @@ function stringify(el, indent, level) { | ||
if (v != null) { | ||
s += ` ${k}="${_escape.escapeXML(typeof v === "string" ? v : v.toString(10))}"`; | ||
s += ` ${k}="${escape.escapeXML(typeof v === "string" ? v : v.toString(10))}"`; | ||
} | ||
@@ -26,3 +26,3 @@ } | ||
typeof child === "string" | ||
? _escape.escapeXMLText(child) | ||
? escape.escapeXMLText(child) | ||
: stringify(child, indent, level + 1); | ||
@@ -29,0 +29,0 @@ } |
'use strict'; | ||
var _escape = require('./escape.js'); | ||
var escape = require('./escape.js'); | ||
@@ -10,3 +10,3 @@ function tagString(literals, ...substitutions) { | ||
str += literals[i]; | ||
str += _escape.escapeXML(substitutions[i]); | ||
str += escape.escapeXML(substitutions[i]); | ||
} | ||
@@ -13,0 +13,0 @@ str += literals[literals.length - 1]; |
{ | ||
"name": "ltx", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "<xml for=\"JavaScript\">", | ||
@@ -10,4 +10,7 @@ "author": "Astro", | ||
"type": "module", | ||
"main": "lib/ltx.js", | ||
"module": "src/ltx.js", | ||
"main": "src/ltx.js", | ||
"exports": { | ||
"import": "./src/ltx.js", | ||
"require": "./lib/ltx.js" | ||
}, | ||
"contributors": [ | ||
@@ -26,9 +29,8 @@ "Stephan Maka", | ||
"unit": "node test/run.js", | ||
"lint": "eslint --cache .", | ||
"lint": "eslint .", | ||
"test": "npm run unit && npm run lint", | ||
"prepare": "husky install", | ||
"prepublishOnly": "rollup -c rollup.config.js" | ||
}, | ||
"lint-staged": { | ||
"*.{js,cjs,mjs}": "eslint --cache --fix", | ||
"*.{js,cjs,mjs}": "eslint --fix", | ||
"*.{json,md,html,css,yaml,yml}": "prettier --write" | ||
@@ -41,17 +43,16 @@ }, | ||
"benchmark": "^2.1.4", | ||
"browserify": "^17.0.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"husky": "^7.0.1", | ||
"lint-staged": "^11.1.2", | ||
"microtime": "^3.0.0", | ||
"node-expat": "^2.4.0", | ||
"eslint": "^9.16.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"husky": "^9.1.7", | ||
"libxmljs": "^1.0.11", | ||
"lint-staged": "^15.2.11", | ||
"microtime": "^3.1.1", | ||
"node-expat": "^2.4.1", | ||
"node-xml": "^1.0.2", | ||
"prettier": "^2.3.2", | ||
"rollup": "^2.56.2", | ||
"sax": "^1.2.4", | ||
"saxes": "^5.0.1", | ||
"prettier": "^3.4.2", | ||
"rollup": "^4.28.1", | ||
"sax": "^1.4.1", | ||
"saxes": "^6.0.0", | ||
"vows": "^0.8.3" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
// import libxmljs from "./parsers/libxmljs.js"; | ||
import libxmljs from "./parsers/libxmljs.js"; | ||
import ltx from "./parsers/ltx.js"; | ||
@@ -9,3 +9,3 @@ import expat from "./parsers/node-expat.js"; | ||
export default [ | ||
// libxmljs, | ||
libxmljs, | ||
ltx, | ||
@@ -12,0 +12,0 @@ expat, |
@@ -39,6 +39,6 @@ import { EventEmitter } from "events"; | ||
if (selfClosing) { | ||
this.emit("endElement", tagName); | ||
this.emit("endElement", tagName, true); | ||
} | ||
} else { | ||
this.emit("endElement", tagName); | ||
this.emit("endElement", tagName, false); | ||
} | ||
@@ -45,0 +45,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14
0
67052
45
2343