1
0
mirror of https://github.com/actions/setup-python synced 2024-11-30 21:22:28 +08:00
setup-python/node_modules/xml-name-validator/lib/xml-name-validator.js

18 lines
449 B
JavaScript
Raw Normal View History

2019-06-27 09:12:00 +08:00
"use strict";
const parser = require("./generated-parser.js");
exports.name = function (potentialName) {
return mapResult(parser.startWith("Name").exec(potentialName));
};
exports.qname = function (potentialQname) {
return mapResult(parser.startWith("QName").exec(potentialQname));
};
function mapResult(result) {
return {
success: result.success,
error: result.error && parser.getTrace(result.error.message)
};
}