@journeyapps/core-xml
Advanced tools
Comparing version 0.0.0-dev.e1bb307.8f08b9e to 0.0.0-dev.e53f4f0
@@ -26,5 +26,17 @@ import { XMLElement } from '@journeyapps/domparser/types'; | ||
private tagMap; | ||
/** | ||
* null means clear; undefined means unchanged. | ||
*/ | ||
private textContent; | ||
constructor(sourceElement: XMLElement, handledTags: string[]); | ||
append(sourceElement: XMLElement | null, builder: ElementBuilder): void; | ||
/** | ||
* If there is an existing text node, replace it. | ||
* If there are multiple text nodes, remove all after the first one. | ||
* If there are no text nodes, append one. | ||
* | ||
* @param text The text, or null to clear. | ||
*/ | ||
setTextContent(text: string | null): void; | ||
update(element: XMLElement): void; | ||
} |
@@ -14,3 +14,3 @@ import { XMLNode, XMLDocument } from '@journeyapps/domparser/types'; | ||
export declare function pretty(document: XMLDocument, options?: Partial<PrettyOptions>): XMLDocument; | ||
export declare function prettyText(document: XMLDocument, options?: Partial<PrettyOptions>): string; | ||
export declare function prettyText(node: XMLDocument | XMLNode, options?: Partial<PrettyOptions>): string; | ||
export declare function serializeToString(node: XMLNode): string; | ||
@@ -17,0 +17,0 @@ /** |
@@ -1,7 +0,11 @@ | ||
import { XMLElement, XMLNode, IterableNodeList } from '@journeyapps/domparser/types'; | ||
import { XMLElement, XMLNode, IterableNodeList, XMLCharacterNode } from '@journeyapps/domparser/types'; | ||
export declare const ELEMENT_NODE = 1; | ||
export declare const ATTRIBUTE_NODE = 2; | ||
export declare const TEXT_NODE = 3; | ||
export declare const DOCUMENT_NODE = 9; | ||
export declare function isAttribute(node: unknown): node is AttributeNode; | ||
export declare function isElement(node: unknown): node is XMLElement; | ||
export declare function isText(node: unknown): node is XMLCharacterNode; | ||
export declare function isCdataNode(node: unknown): node is XMLCharacterNode; | ||
export declare function isCommentNode(node: unknown): node is XMLCharacterNode; | ||
/** | ||
@@ -13,2 +17,3 @@ * Subset of the fields we're interested in. | ||
name: string; | ||
value: string; | ||
} | ||
@@ -18,2 +23,6 @@ /** | ||
* | ||
* If an attribute value is either null or matches the default, and the current | ||
* element attribute value is also either null or matches the default, it is preserved. | ||
* If the current element attribute value is anything else, it is removed. | ||
* | ||
* @param element - The element to set the attributes on | ||
@@ -23,5 +32,8 @@ * @param attributes - The attributes to set. | ||
* If an attribute is present in the element but not this map, it is preserved. | ||
* @param defaults - Default attribute values, which are treated the same as not present. | ||
*/ | ||
export declare function setAttributes(element: XMLElement, attributes: { | ||
[key: string]: string | null; | ||
}, defaults?: { | ||
[key: string]: string; | ||
}): void; | ||
@@ -28,0 +40,0 @@ /** |
@@ -10,6 +10,7 @@ "use strict"; | ||
// and @journeyapps/domparser for parsing. | ||
//@ts-ignore | ||
const implementation = document.implementation; | ||
const parser = new domparser_1.DOMParser({ implementation }); | ||
const serializer = new XMLSerializer(); | ||
xml_1.configureParser({ | ||
(0, xml_1.configureParser)({ | ||
implementation, | ||
@@ -28,3 +29,3 @@ parser, | ||
const serializer = new xmldom.XMLSerializer(); | ||
xml_1.configureParser({ | ||
(0, xml_1.configureParser)({ | ||
implementation, | ||
@@ -31,0 +32,0 @@ parser, |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./xml")); | ||
__export(require("./utils")); | ||
__export(require("./OrderedIncrementalUpdater")); | ||
__export(require("./UnorderedIncrementalUpdater")); | ||
__export(require("./pretty")); | ||
__exportStar(require("./xml"), exports); | ||
__exportStar(require("./utils"), exports); | ||
__exportStar(require("./OrderedIncrementalUpdater"), exports); | ||
__exportStar(require("./UnorderedIncrementalUpdater"), exports); | ||
__exportStar(require("./pretty"), exports); | ||
__exportStar(require("./ElementBuilder"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
// This is the default import for NodeJS. | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Export the same values as for browsers. | ||
__export(require("./index")); | ||
__exportStar(require("./index"), exports); | ||
// Auto-configure the parser | ||
require("./domparser"); | ||
//# sourceMappingURL=node.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OrderedIncrementalUpdater = void 0; | ||
const index_1 = require("./index"); | ||
@@ -35,2 +36,12 @@ /** | ||
} | ||
/** | ||
* If there is an existing text node, replace it. | ||
* If there are multiple text nodes, remove all after the first one. | ||
* If there are no text nodes, append one. | ||
* | ||
* @param text The text, or null to clear. | ||
*/ | ||
setTextContent(text) { | ||
this.textContent = text; | ||
} | ||
update(element) { | ||
@@ -58,2 +69,3 @@ const doc = element.ownerDocument; | ||
// 2. Merge source elements. | ||
let seenSourceText = false; | ||
if (this.sourceElement) { | ||
@@ -68,6 +80,22 @@ const sourceNodes = this.sourceElement.childNodes; | ||
} | ||
else if (index_1.isElement(child) && this.tagMap[child.tagName]) { | ||
else if ((0, index_1.isElement)(child) && this.tagMap[child.tagName]) { | ||
// A known element that isn't inserted already. | ||
// Skip it. | ||
} | ||
else if ((0, index_1.isText)(child) && this.textContent !== undefined) { | ||
// Skip any nodes after the first one. | ||
if (!seenSourceText) { | ||
if (this.textContent !== null) { | ||
// Replace the text | ||
const textNode = doc.createTextNode(this.textContent); | ||
if (insertBefore) { | ||
element.insertBefore(textNode, insertBefore); | ||
} | ||
else { | ||
element.appendChild(textNode); | ||
} | ||
} | ||
seenSourceText = true; | ||
} | ||
} | ||
else { | ||
@@ -86,2 +114,6 @@ // Insert before the last known one | ||
} | ||
if (!seenSourceText && this.textContent !== undefined && this.textContent !== null) { | ||
// No source text found - append text | ||
element.appendChild(doc.createTextNode(this.textContent)); | ||
} | ||
} | ||
@@ -88,0 +120,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const xml_1 = require("./xml"); | ||
exports.stripWhitespace = exports.serializeToString = exports.prettyText = exports.pretty = void 0; | ||
const types_1 = require("@journeyapps/domparser/types"); | ||
const utils_1 = require("./utils"); | ||
const serialize_1 = require("./serialize"); | ||
/** | ||
@@ -12,9 +14,6 @@ * Given a document, return a copy that is formatted. | ||
const newDoc = document.implementation.createDocument(document.documentElement.tagName, null, null); | ||
const actualOptions = { | ||
indentSpaces: 4, | ||
...options | ||
}; | ||
const actualOptions = Object.assign({ indentSpaces: 4 }, options); | ||
for (let i = 0; i < document.childNodes.length; i++) { | ||
const child = document.childNodes.item(i); | ||
if (isText(child)) { | ||
if ((0, utils_1.isText)(child)) { | ||
// workaround for xmldom that has text nodes in the document | ||
@@ -28,13 +27,21 @@ continue; | ||
exports.pretty = pretty; | ||
function prettyText(document, options) { | ||
const doc = pretty(document, options); | ||
// TODO: close tags with " />". | ||
return serializeToString(doc); | ||
function isDocument(document) { | ||
return document.nodeType == types_1.DOCUMENT_NODE; | ||
} | ||
function prettyText(node, options) { | ||
if (isDocument(node)) { | ||
const doc = pretty(node, options); | ||
return serializeToString(doc); | ||
} | ||
else { | ||
const actualOptions = Object.assign({ indentSpaces: 4 }, options); | ||
const prettyElement = prettyNode(node.ownerDocument, node, actualOptions, 0); | ||
return serializeToString(prettyElement); | ||
} | ||
} | ||
exports.prettyText = prettyText; | ||
function serializeToString(node) { | ||
const { serializer } = xml_1.getParser(); | ||
if (node.nodeType != types_1.DOCUMENT_NODE) { | ||
// Not a document - use the default | ||
return serializer.serializeToString(node); | ||
return serialize_1.serializer.serializeToString(node); | ||
} | ||
@@ -45,4 +52,3 @@ // Whitespace characters between processing instructions are lost, and browsers serialize them differently. | ||
let result = ''; | ||
if (node.firstChild && | ||
node.firstChild.nodeType == types_1.PROCESSING_INSTRUCTION_NODE) { | ||
if (node.firstChild && node.firstChild.nodeType == types_1.PROCESSING_INSTRUCTION_NODE) { | ||
// Has a processing instruction. | ||
@@ -55,9 +61,9 @@ } | ||
const children = node.childNodes; | ||
for (var i = 0; i < children.length; i++) { | ||
for (let i = 0; i < children.length; i++) { | ||
const child = children[i]; | ||
if (isText(child)) { | ||
if ((0, utils_1.isText)(child)) { | ||
// Workaround for xmldom inserting extra newlines | ||
continue; | ||
} | ||
const part = serializer.serializeToString(children[i]); | ||
const part = serialize_1.serializer.serializeToString(child); | ||
result += part; | ||
@@ -85,8 +91,2 @@ result += '\n'; | ||
exports.stripWhitespace = stripWhitespace; | ||
function isElement(node) { | ||
return node.nodeType == types_1.ELEMENT_NODE; | ||
} | ||
function isText(node) { | ||
return node.nodeType == types_1.TEXT_NODE; | ||
} | ||
function indent(n, options) { | ||
@@ -101,5 +101,12 @@ let r = '\n'; | ||
const DOUBLE_NEW_LINE = {}; | ||
function removeFinalNewline(text) { | ||
const lines = text.split('\n'); | ||
if (/^\s*$/.test(lines[lines.length - 1])) { | ||
lines.pop(); | ||
} | ||
return lines.join('\n'); | ||
} | ||
function prettyNode(doc, node, options, level) { | ||
let newNode = node.cloneNode(false); | ||
if (isText(node)) { | ||
if ((0, utils_1.isText)(node)) { | ||
const trimmedText = node.nodeValue.trim(); | ||
@@ -122,3 +129,3 @@ const newLines = node.nodeValue.split('\n').length - 1; | ||
} | ||
else if (isElement(node)) { | ||
else if ((0, utils_1.isElement)(node)) { | ||
let filteredChildren = []; | ||
@@ -129,4 +136,5 @@ for (let i = 0; i < node.childNodes.length; i++) { | ||
} | ||
filteredChildren = filteredChildren.filter(node => node != null); | ||
if (filteredChildren.length == 1 && isText(filteredChildren[0])) { | ||
filteredChildren = filteredChildren.filter((node) => node != null); | ||
if (filteredChildren.length == 1 && (0, utils_1.isText)(filteredChildren[0])) { | ||
// Text on its own. Preserve whitespace. | ||
newNode.appendChild(filteredChildren[0]); | ||
@@ -156,6 +164,16 @@ } | ||
else { | ||
if (level != null) { | ||
newNode.appendChild(doc.createTextNode(indent(level + 1, options))); | ||
if ((0, utils_1.isText)(child)) { | ||
// Text in mixed-mode. | ||
// We currently preserve whitespace _before_ the text element, but not _after_. | ||
// If the last line is a blank line, remove it, and replace it with our indentation. | ||
let text = child.nodeValue; | ||
newNode.appendChild(doc.createTextNode(removeFinalNewline(text))); | ||
} | ||
newNode.appendChild(child); | ||
else { | ||
if (level != null) { | ||
const indentation = indent(level + 1, options); | ||
newNode.appendChild(doc.createTextNode(indentation)); | ||
} | ||
newNode.appendChild(child); | ||
} | ||
} | ||
@@ -162,0 +180,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UnorderedIncrementalUpdater = void 0; | ||
const index_1 = require("./index"); | ||
@@ -61,4 +62,4 @@ /** | ||
// Copy existing children | ||
for (let child of index_1.iter(this.sourceElement.childNodes)) { | ||
if (index_1.isElement(child) && child.tagName in this.sourceElements) { | ||
for (let child of (0, index_1.iter)(this.sourceElement.childNodes)) { | ||
if ((0, index_1.isElement)(child) && child.tagName in this.sourceElements) { | ||
if (this.sourceElements[child.tagName].has(child)) { | ||
@@ -65,0 +66,0 @@ // Present - update! |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.iter = exports.setAttributes = exports.isCommentNode = exports.isCdataNode = exports.isText = exports.isElement = exports.isAttribute = exports.DOCUMENT_NODE = exports.TEXT_NODE = exports.ATTRIBUTE_NODE = exports.ELEMENT_NODE = void 0; | ||
const types_1 = require("@journeyapps/domparser/types"); | ||
// From: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 | ||
@@ -9,6 +11,6 @@ // These constants are also defined one Node, but it's better to not | ||
exports.TEXT_NODE = 3; | ||
exports.DOCUMENT_NODE = 9; | ||
function isAttribute(node) { | ||
return (node.nodeType == exports.ATTRIBUTE_NODE || | ||
(typeof node.name == 'string' && | ||
typeof node.ownerElement == 'object')); | ||
(typeof node.name == 'string' && typeof node.ownerElement == 'object')); | ||
} | ||
@@ -20,5 +22,21 @@ exports.isAttribute = isAttribute; | ||
exports.isElement = isElement; | ||
function isText(node) { | ||
return node.nodeType == exports.TEXT_NODE; | ||
} | ||
exports.isText = isText; | ||
function isCdataNode(node) { | ||
return node.nodeType == types_1.CDATA_SECTION_NODE; | ||
} | ||
exports.isCdataNode = isCdataNode; | ||
function isCommentNode(node) { | ||
return node.nodeType == types_1.COMMENT_NODE; | ||
} | ||
exports.isCommentNode = isCommentNode; | ||
/** | ||
* Set or clear a set of attributes. | ||
* | ||
* If an attribute value is either null or matches the default, and the current | ||
* element attribute value is also either null or matches the default, it is preserved. | ||
* If the current element attribute value is anything else, it is removed. | ||
* | ||
* @param element - The element to set the attributes on | ||
@@ -28,8 +46,20 @@ * @param attributes - The attributes to set. | ||
* If an attribute is present in the element but not this map, it is preserved. | ||
* @param defaults - Default attribute values, which are treated the same as not present. | ||
*/ | ||
function setAttributes(element, attributes) { | ||
function setAttributes(element, attributes, defaults) { | ||
if (defaults == null) { | ||
defaults = {}; | ||
} | ||
for (let key in attributes) { | ||
const value = attributes[key]; | ||
if (value == null) { | ||
element.removeAttribute(key); | ||
const defaultValue = defaults[key]; | ||
if (value == null || value === defaultValue) { | ||
if (element.getAttribute(key) !== defaultValue) { | ||
// The attribute is not currently equal to the default value, so we remove it. | ||
element.removeAttribute(key); | ||
} | ||
else { | ||
// The element currently contains the default value explicitly. | ||
// We preserve it. | ||
} | ||
} | ||
@@ -36,0 +66,0 @@ else { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.childContent = exports.childNode = exports.documentToText = exports.createDocument = exports.parse = exports.configureParser = exports.getParser = exports.validateChildren = exports.children = exports.attribute = exports.parseElement = exports.warning = exports.error = exports.attributeNode = exports.elementTextPosition = exports.attributeValuePosition = exports.getPosition = exports.getAttribute = void 0; | ||
const utils_1 = require("./utils"); | ||
@@ -48,3 +49,3 @@ let configuredParser = null; | ||
var owner; | ||
if (utils_1.isAttribute(node)) { | ||
if ((0, utils_1.isAttribute)(node)) { | ||
owner = node.ownerElement.ownerDocument; | ||
@@ -61,5 +62,3 @@ } | ||
} | ||
else if (utils_1.isElement(node) && | ||
node.openStart != null && | ||
node.nameEnd != null) { | ||
else if ((0, utils_1.isElement)(node) && node.openStart != null && node.nameEnd != null) { | ||
// This is an element | ||
@@ -69,10 +68,6 @@ position.start = locator.position(node.openStart + 1); | ||
} | ||
else if (utils_1.isAttribute(node)) { | ||
else if ((0, utils_1.isAttribute)(node)) { | ||
// This is an attribute | ||
var attrPosition = node.ownerElement.attributePositions == null | ||
? null | ||
: node.ownerElement.attributePositions[node.name]; | ||
if (attrPosition != null && | ||
attrPosition.valueStart != null && | ||
attrPosition.end != null) { | ||
var attrPosition = node.ownerElement.attributePositions == null ? null : node.ownerElement.attributePositions[node.name]; | ||
if (attrPosition != null && attrPosition.valueStart != null && attrPosition.end != null) { | ||
if (attrPosition.end - attrPosition.valueStart > 2) { | ||
@@ -98,4 +93,3 @@ // Exclude quotes | ||
if (locator) { | ||
if (element.attributePositions != null && | ||
element.attributePositions.hasOwnProperty(attributeName)) { | ||
if (element.attributePositions != null && element.attributePositions.hasOwnProperty(attributeName)) { | ||
var p = element.attributePositions[attributeName]; | ||
@@ -119,4 +113,3 @@ return { | ||
if (locator) { | ||
if (element.attributePositions != null && | ||
element.attributePositions.hasOwnProperty(attributeName)) { | ||
if (element.attributePositions != null && element.attributePositions.hasOwnProperty(attributeName)) { | ||
var p = element.attributePositions[attributeName]; | ||
@@ -165,3 +158,9 @@ if (start == end) { | ||
if (element.getAttributeNode(attributeName)) { | ||
return { ownerElement: element, name: attributeName }; | ||
return { | ||
ownerElement: element, | ||
name: attributeName, | ||
get value() { | ||
return element.getAttribute(attributeName); | ||
} | ||
}; | ||
} | ||
@@ -204,3 +203,4 @@ else { | ||
}; | ||
if (type == null) { | ||
// The specific tag exclusions if for the specs | ||
if (type == null && tag != 'context-menu' && tag != 'button') { | ||
result.type = null; | ||
@@ -273,5 +273,3 @@ result.errors.push(warning(element, "Invalid element '" + tag + "'")); | ||
if (options.indexOf(value) == -1) { | ||
var message = customMessage == null | ||
? element.name + ' must be one of ' + options | ||
: customMessage; | ||
var message = customMessage == null ? element.name + ' must be one of ' + options : customMessage; | ||
throw new Error(message); | ||
@@ -289,5 +287,3 @@ } | ||
if (options.indexOf(value) == -1) { | ||
var message = customMessage == null | ||
? element.name + ' must be one of ' + options | ||
: customMessage; | ||
var message = customMessage == null ? element.name + ' must be one of ' + options : customMessage; | ||
throw new Error(message); | ||
@@ -300,21 +296,31 @@ } | ||
return function (valuesString, element) { | ||
var values = valuesString.split(','); | ||
var invalidValues = []; | ||
Array.prototype.forEach.call(values, function (value) { | ||
if (options.indexOf(value) == -1) { | ||
invalidValues.push(value); | ||
} | ||
}); | ||
if (invalidValues.length === 0) { | ||
return validateMultiOptions(valuesString, element, options, customMessage); | ||
}; | ||
}; | ||
exports.attribute.multiOptionListWithFunctions = function multiOptionList(options, functionPrefix, customMessage) { | ||
return function (valuesString, element) { | ||
if (valuesString.indexOf(functionPrefix) === 0) { | ||
// function token expression, therefore allow | ||
return valuesString; | ||
} | ||
else { | ||
var message = 'Invalid values: ' + invalidValues + '. '; | ||
var extraMessage = customMessage == null | ||
? element.name + ' values must be from ' + options | ||
: customMessage; | ||
throw new Error(message + extraMessage); | ||
} | ||
return validateMultiOptions(valuesString, element, options, customMessage); | ||
}; | ||
}; | ||
function validateMultiOptions(valuesString, element, options, customMessage) { | ||
var values = valuesString.split(','); | ||
var invalidValues = []; | ||
values.forEach((value) => { | ||
if (options.indexOf(value) == -1) { | ||
invalidValues.push(value); | ||
} | ||
}); | ||
if (invalidValues.length === 0) { | ||
return valuesString; | ||
} | ||
else { | ||
var message = 'Invalid values: ' + invalidValues + '. '; | ||
var extraMessage = customMessage == null ? element.name + ' values must be from ' + options : customMessage; | ||
throw new Error(message + extraMessage); | ||
} | ||
} | ||
// filter can be an array of strings, or a comma-separated list | ||
@@ -339,3 +345,3 @@ function children(element, filter) { | ||
var child = all[i]; | ||
if (utils_1.isElement(child) && | ||
if ((0, utils_1.isElement)(child) && | ||
child.tagName != null && | ||
@@ -353,3 +359,3 @@ (allowedNames == null || allowedNames.indexOf(child.tagName) != -1)) { | ||
Array.prototype.forEach.call(element.childNodes, function (child) { | ||
if (utils_1.isElement(child)) { | ||
if ((0, utils_1.isElement)(child)) { | ||
var tag = child.tagName; | ||
@@ -385,6 +391,7 @@ var order = tagNames[tag]; | ||
function loadDefaultParser() { | ||
if (typeof document != 'undefined' && | ||
typeof document.implementation != 'undefined') { | ||
if (typeof document != 'undefined' && typeof document.implementation != 'undefined') { | ||
configureParser({ | ||
//@ts-ignore | ||
implementation: document.implementation, | ||
//@ts-ignore | ||
parser: new DOMParser(), | ||
@@ -423,3 +430,3 @@ serializer: new XMLSerializer() | ||
var child = element.childNodes[i]; | ||
if (utils_1.isElement(child) && child.tagName == childName) { | ||
if ((0, utils_1.isElement)(child) && child.tagName == childName) { | ||
return child; | ||
@@ -426,0 +433,0 @@ } |
{ | ||
"name": "@journeyapps/core-xml", | ||
"version": "0.0.0-dev.e1bb307.8f08b9e", | ||
"description": "Journey JS library", | ||
"version": "0.0.0-dev.e53f4f0", | ||
"description": "Journey XML library", | ||
"main": "./dist/src/node.js", | ||
"browser": "./dist/src/index.js", | ||
"typings": "./dist/@types/src/index", | ||
"scripts": { | ||
"build": "../node_modules/.bin/tsc --build", | ||
"test": "yarn build && yarn test:node && yarn test:browser", | ||
"test:browser": "karma start karma.conf.js --single-run", | ||
"test:node": "jasmine dist/test/unit/all.js" | ||
}, | ||
"dependencies": { | ||
"@journeyapps/domparser": "^0.3.0" | ||
"@journeyapps/domparser": "^0.4.1", | ||
"xmldom": "^0.6.0" | ||
}, | ||
"devDependencies": { | ||
"@journeyapps/core-test-helpers": "0.0.0-dev.e1bb307.8f08b9e" | ||
"@journeyapps/core-test-helpers": "^0.0.0-dev.e53f4f0" | ||
}, | ||
@@ -25,3 +20,8 @@ "files": [ | ||
], | ||
"gitHead": "c4e4938d2eb360efe52455f2d8f6465ab90a309e" | ||
} | ||
"scripts": { | ||
"build": "../node_modules/.bin/tsc --build", | ||
"test": "pnpm build && pnpm test:node && pnpm test:browser", | ||
"test:browser": "karma start karma.conf.js --single-run", | ||
"test:node": "jasmine dist/test/unit/all.js" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
155568
39
1437
2
+ Addedxmldom@^0.6.0
+ Added@journeyapps/domparser@0.4.1(transitive)
+ Addedxmldom@0.6.0(transitive)
- Removed@journeyapps/domparser@0.3.0(transitive)