@journeyapps/core-xml
Advanced tools
Comparing version 0.0.0-dev.9496585.b46eb5f to 0.0.0-dev.36825214.7faa00f
"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; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (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; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (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"); | ||
@@ -4,0 +5,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.stripWhitespace = exports.serializeToString = exports.prettyText = exports.pretty = void 0; | ||
const types_1 = require("@journeyapps/domparser/types"); | ||
@@ -13,6 +14,3 @@ const utils_1 = require("./utils"); | ||
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++) { | ||
@@ -38,6 +36,3 @@ const child = document.childNodes.item(i); | ||
else { | ||
const actualOptions = { | ||
indentSpaces: 4, | ||
...options | ||
}; | ||
const actualOptions = Object.assign({ indentSpaces: 4 }, options); | ||
const prettyElement = prettyNode(node.ownerDocument, node, actualOptions, 0); | ||
@@ -44,0 +39,0 @@ return serializeToString(prettyElement); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.serialize = exports.serializer = void 0; | ||
const types_1 = require("@journeyapps/domparser/types"); | ||
@@ -4,0 +5,0 @@ const utils_1 = require("./utils"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UnorderedIncrementalUpdater = void 0; | ||
const index_1 = require("./index"); | ||
@@ -4,0 +5,0 @@ /** |
"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"); | ||
@@ -4,0 +5,0 @@ // From: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 |
"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"); | ||
@@ -196,3 +197,4 @@ let configuredParser = null; | ||
}; | ||
if (type == null) { | ||
// The specific tag exclusions if for the specs | ||
if (type == null && tag != 'context-menu' && tag != 'button') { | ||
result.type = null; | ||
@@ -286,19 +288,31 @@ result.errors.push(warning(element, "Invalid element '" + tag + "'")); | ||
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 | ||
@@ -305,0 +319,0 @@ function children(element, filter) { |
{ | ||
"name": "@journeyapps/core-xml", | ||
"version": "0.0.0-dev.9496585.b46eb5f", | ||
"version": "0.0.0-dev.36825214.7faa00f", | ||
"description": "Journey JS library", | ||
@@ -18,3 +18,3 @@ "main": "./dist/src/node.js", | ||
"devDependencies": { | ||
"@journeyapps/core-test-helpers": "0.0.0-dev.9496585.b46eb5f" | ||
"@journeyapps/core-test-helpers": "0.0.0-dev.36825214.7faa00f" | ||
}, | ||
@@ -26,3 +26,3 @@ "files": [ | ||
], | ||
"gitHead": "7495d3b84993767ab5bf1b44dff60ec2a8f4759b" | ||
"gitHead": "884e53d89cd96f31a9d2428c06dd246b75376c9d" | ||
} |
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
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
152822
1383