mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 08:30:51 +00:00
17 lines
449 B
JavaScript
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)
|
|
};
|
|
}
|