@journeyapps/core-xml
Advanced tools
Comparing version 0.0.0-dev.3d82e35.28b73fb to 0.0.0-dev.4073ebe3.cae5e07
@@ -10,3 +10,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +13,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -11,3 +11,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -14,0 +14,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -197,3 +197,4 @@ "use strict"; | ||
}; | ||
if (type == null) { | ||
// The specific tag exclusions if for the specs | ||
if (type == null && tag != 'context-menu' && tag != 'button') { | ||
result.type = null; | ||
@@ -287,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 | ||
@@ -306,0 +319,0 @@ function children(element, filter) { |
{ | ||
"name": "@journeyapps/core-xml", | ||
"version": "0.0.0-dev.3d82e35.28b73fb", | ||
"version": "0.0.0-dev.4073ebe3.cae5e07", | ||
"description": "Journey JS library", | ||
@@ -18,3 +18,3 @@ "main": "./dist/src/node.js", | ||
"devDependencies": { | ||
"@journeyapps/core-test-helpers": "0.0.0-dev.3d82e35.28b73fb" | ||
"@journeyapps/core-test-helpers": "0.0.0-dev.4073ebe3.cae5e07" | ||
}, | ||
@@ -26,3 +26,3 @@ "files": [ | ||
], | ||
"gitHead": "f044d164080528680e2caf9504974227789a2e1b" | ||
"gitHead": "03fafcf967f666529bcba1be9778d494cef95cd3" | ||
} |
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