main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
985 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | "use strict";
|
---|
| 2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
---|
| 3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
---|
| 4 | };
|
---|
| 5 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 6 | const keywords_1 = __importDefault(require("./keywords"));
|
---|
| 7 | const ajvKeywords = (ajv, keyword) => {
|
---|
| 8 | if (Array.isArray(keyword)) {
|
---|
| 9 | for (const k of keyword)
|
---|
| 10 | get(k)(ajv);
|
---|
| 11 | return ajv;
|
---|
| 12 | }
|
---|
| 13 | if (keyword) {
|
---|
| 14 | get(keyword)(ajv);
|
---|
| 15 | return ajv;
|
---|
| 16 | }
|
---|
| 17 | for (keyword in keywords_1.default)
|
---|
| 18 | get(keyword)(ajv);
|
---|
| 19 | return ajv;
|
---|
| 20 | };
|
---|
| 21 | ajvKeywords.get = get;
|
---|
| 22 | function get(keyword) {
|
---|
| 23 | const defFunc = keywords_1.default[keyword];
|
---|
| 24 | if (!defFunc)
|
---|
| 25 | throw new Error("Unknown keyword " + keyword);
|
---|
| 26 | return defFunc;
|
---|
| 27 | }
|
---|
| 28 | exports.default = ajvKeywords;
|
---|
| 29 | module.exports = ajvKeywords;
|
---|
| 30 | // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
---|
| 31 | module.exports.default = ajvKeywords;
|
---|
| 32 | //# sourceMappingURL=index.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.