install-nix-action/node_modules/xml-name-validator/lib/xml-name-validator.js
Domen Kožar 08403cd828
v5
2019-11-13 17:14:48 +01:00

17 lines
449 B
JavaScript

"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)
};
}