UNPKG

salve-annos

Version:

A fork with support for documentation of Salve, a Javascript library which implements a validator able to validate an XML document on the basis of a subset of RelaxNG.

35 lines 1.65 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.InternalValidator = void 0; /** * A schema validator that uses salve to validate the schema. * * @author Louis-Dominique Dubeau * @license MPL 2.0 * @copyright Mangalam Research Center for Buddhist Languages */ const internal_1 = require("../schema-simplifiers/internal"); const schema_validation_1 = require("../schema-validation"); class InternalValidator { constructor(options) { this.options = options; } validate(schemaPath) { return __awaiter(this, void 0, void 0, function* () { const simplifier = new internal_1.InternalSimplifier(Object.assign(Object.assign({}, this.options), { validate: true })); return simplifier.simplify(schemaPath); }); } } exports.InternalValidator = InternalValidator; (0, schema_validation_1.registerValidator)("internal", InternalValidator); //# sourceMappingURL=internal.js.map