@keymanapp/common-types
Version:
Keyman Developer keyboard file types
269 lines (267 loc) • 17.2 kB
JavaScript
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0f6b27cf-0fbe-58e7-a137-c354299c2268")}catch(e){}}();
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
// obj/schemas/displaymap.schema.validator.cjs
var require_displaymap_schema_validator = __commonJS({
"obj/schemas/displaymap.schema.validator.cjs"(exports, module) {
module.exports = validate20;
module.exports.default = validate20;
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
if (data.pua !== void 0) {
const _errs1 = errors;
if (typeof data.pua !== "string") {
validate22.errors = [{ instancePath: instancePath + "/pua", schemaPath: "#/properties/pua/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
var valid0 = _errs1 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.str !== void 0) {
const _errs3 = errors;
if (typeof data.str !== "string") {
validate22.errors = [{ instancePath: instancePath + "/str", schemaPath: "#/properties/str/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
var valid0 = _errs3 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.unicode !== void 0) {
const _errs5 = errors;
if (typeof data.unicode !== "string") {
validate22.errors = [{ instancePath: instancePath + "/unicode", schemaPath: "#/properties/unicode/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
var valid0 = _errs5 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.usages !== void 0) {
let data3 = data.usages;
const _errs7 = errors;
const _errs8 = errors;
let valid1 = false;
const _errs9 = errors;
if (errors === _errs9) {
if (Array.isArray(data3)) {
var valid2 = true;
const len0 = data3.length;
for (let i0 = 0; i0 < len0; i0++) {
let data4 = data3[i0];
const _errs11 = errors;
const _errs12 = errors;
if (errors === _errs12) {
if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
if (data4.filename !== void 0) {
const _errs14 = errors;
if (typeof data4.filename !== "string") {
const err0 = { instancePath: instancePath + "/usages/" + i0 + "/filename", schemaPath: "#/definitions/usage/properties/filename/type", keyword: "type", params: { type: "string" }, message: "must be string" };
if (vErrors === null) {
vErrors = [err0];
}
else {
vErrors.push(err0);
}
errors++;
}
var valid4 = _errs14 === errors;
}
else {
var valid4 = true;
}
if (valid4) {
if (data4.count !== void 0) {
let data6 = data4.count;
const _errs16 = errors;
if (!(typeof data6 == "number" && isFinite(data6))) {
const err1 = { instancePath: instancePath + "/usages/" + i0 + "/count", schemaPath: "#/definitions/usage/properties/count/type", keyword: "type", params: { type: "number" }, message: "must be number" };
if (vErrors === null) {
vErrors = [err1];
}
else {
vErrors.push(err1);
}
errors++;
}
var valid4 = _errs16 === errors;
}
else {
var valid4 = true;
}
}
}
else {
const err2 = { instancePath: instancePath + "/usages/" + i0, schemaPath: "#/definitions/usage/type", keyword: "type", params: { type: "object" }, message: "must be object" };
if (vErrors === null) {
vErrors = [err2];
}
else {
vErrors.push(err2);
}
errors++;
}
}
var valid2 = _errs11 === errors;
if (!valid2) {
break;
}
}
}
else {
const err3 = { instancePath: instancePath + "/usages", schemaPath: "#/properties/usages/anyOf/0/type", keyword: "type", params: { type: "array" }, message: "must be array" };
if (vErrors === null) {
vErrors = [err3];
}
else {
vErrors.push(err3);
}
errors++;
}
}
var _valid0 = _errs9 === errors;
valid1 = valid1 || _valid0;
if (!valid1) {
const _errs18 = errors;
if (errors === _errs18) {
if (Array.isArray(data3)) {
var valid5 = true;
const len1 = data3.length;
for (let i1 = 0; i1 < len1; i1++) {
const _errs20 = errors;
if (typeof data3[i1] !== "string") {
const err4 = { instancePath: instancePath + "/usages/" + i1, schemaPath: "#/properties/usages/anyOf/1/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
if (vErrors === null) {
vErrors = [err4];
}
else {
vErrors.push(err4);
}
errors++;
}
var valid5 = _errs20 === errors;
if (!valid5) {
break;
}
}
}
else {
const err5 = { instancePath: instancePath + "/usages", schemaPath: "#/properties/usages/anyOf/1/type", keyword: "type", params: { type: "array" }, message: "must be array" };
if (vErrors === null) {
vErrors = [err5];
}
else {
vErrors.push(err5);
}
errors++;
}
}
var _valid0 = _errs18 === errors;
valid1 = valid1 || _valid0;
}
if (!valid1) {
const err6 = { instancePath: instancePath + "/usages", schemaPath: "#/properties/usages/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
if (vErrors === null) {
vErrors = [err6];
}
else {
vErrors.push(err6);
}
errors++;
validate22.errors = vErrors;
return false;
}
else {
errors = _errs8;
if (vErrors !== null) {
if (_errs8) {
vErrors.length = _errs8;
}
else {
vErrors = null;
}
}
}
var valid0 = _errs7 === errors;
}
else {
var valid0 = true;
}
}
}
}
}
else {
validate22.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
validate22.errors = vErrors;
return errors === 0;
}
function validate21(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
if (data.map !== void 0) {
let data0 = data.map;
const _errs1 = errors;
if (errors === _errs1) {
if (Array.isArray(data0)) {
var valid1 = true;
const len0 = data0.length;
for (let i0 = 0; i0 < len0; i0++) {
const _errs3 = errors;
if (!validate22(data0[i0], { instancePath: instancePath + "/map/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
errors = vErrors.length;
}
var valid1 = _errs3 === errors;
if (!valid1) {
break;
}
}
}
else {
validate21.errors = [{ instancePath: instancePath + "/map", schemaPath: "#/properties/map/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
return false;
}
}
}
}
else {
validate21.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
validate21.errors = vErrors;
return errors === 0;
}
function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (!validate21(data, { instancePath, parentData, parentDataProperty, rootData })) {
vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);
errors = vErrors.length;
}
validate20.errors = vErrors;
return errors === 0;
}
}
});
export default require_displaymap_schema_validator();
//# sourceMappingURL=displaymap.schema.validator.mjs.map
//# debugId=0f6b27cf-0fbe-58e7-a137-c354299c2268