.dotfiles/.config/chromium/Default/Extensions/likgccmbimhjbgkjambclfkhldnlhbnn/24.9.9.0_0/lib/validate-schemas.js

5 lines
400 KiB
JavaScript
Raw Normal View History

2024-09-21 14:05:15 -04:00
// @ts-nocheck
import {ucs2length} from './ucs2length.js';"use strict";export const customAudioList = validate10;const schema11 = {"$id":"customAudioList","$schema":"http://json-schema.org/draft-07/schema#","type":"object","required":["type","audioSources"],"additionalProperties":false,"properties":{"type":{"type":"string","const":"audioSourceList"},"audioSources":{"type":"array","items":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"name":{"type":"string"},"url":{"type":"string"}}}}}};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="customAudioList" */;let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((data.type === undefined) && (missing0 = "type")) || ((data.audioSources === undefined) && (missing0 = "audioSources"))){validate10.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((key0 === "type") || (key0 === "audioSources"))){validate10.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.type !== undefined){let data0 = data.type;const _errs2 = errors;if(typeof data0 !== "string"){validate10.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if("audioSourceList" !== data0){validate10.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/const",keyword:"const",params:{allowedValue: "audioSourceList"},message:"must be equal to constant"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.audioSources !== undefined){let data1 = data.audioSources;const _errs4 = errors;if(errors === _errs4){if(Array.isArray(data1)){var valid1 = true;const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];const _errs6 = errors;if(errors === _errs6){if(data2 && typeof data2 == "object" && !Array.isArray(data2)){let missing1;if((data2.url === undefined) && (missing1 = "url")){validate10.errors = [{instancePath:instancePath+"/audioSources/" + i0,schemaPath:"#/properties/audioSources/items/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs8 = errors;for(const key1 in data2){if(!((key1 === "name") || (key1 === "url"))){validate10.errors = [{instancePath:instancePath+"/audioSources/" + i0,schemaPath:"#/properties/audioSources/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs8 === errors){if(data2.name !== undefined){const _errs9 = errors;if(typeof data2.name !== "string"){validate10.errors = [{instancePath:instancePath+"/audioSources/" + i0+"/name",schemaPath:"#/properties/audioSources/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs9 === errors;}else {var valid2 = true;}if(valid2){if(data2.url !== undefined){const _errs11 = errors;if(typeof data2.url !== "string"){validate10.errors = [{instancePath:instancePath+"/audioSources/" + i0+"/url",schemaPath:"#/properties/audioSources/items/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs11 === errors;}else {var valid2 = true;}}}}}else {validate10.errors = [{instancePath:instancePath+"/audioSources/" + i0,schemaPath:"#/properties/audioSources/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid1 = _errs6 === errors;if(!valid1){break;}}}else {validate10.errors = [{instancePath:instancePath+"/audioSources",s
missingProperty: missing3,
depsCount: 2,
deps: "indexUrl, downloadUrl"},message:"must have properties indexUrl, downloadUrl when property isUpdatable is present"}];return false;}else {if(data.title !== undefined){const _errs4 = errors;if(typeof data.title !== "string"){validate11.errors = [{instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs4 === errors;}else {var valid2 = true;}if(valid2){if(data.revision !== undefined){const _errs6 = errors;if(typeof data.revision !== "string"){validate11.errors = [{instancePath:instancePath+"/revision",schemaPath:"#/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs6 === errors;}else {var valid2 = true;}if(valid2){if(data.sequenced !== undefined){const _errs8 = errors;if(typeof data.sequenced !== "boolean"){validate11.errors = [{instancePath:instancePath+"/sequenced",schemaPath:"#/properties/sequenced/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid2 = _errs8 === errors;}else {var valid2 = true;}if(valid2){if(data.format !== undefined){let data3 = data.format;const _errs10 = errors;if(!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))){validate11.errors = [{instancePath:instancePath+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(!(((data3 === 1) || (data3 === 2)) || (data3 === 3))){validate11.errors = [{instancePath:instancePath+"/format",schemaPath:"#/properties/format/enum",keyword:"enum",params:{allowedValues: schema12.properties.format.enum},message:"must be equal to one of the allowed values"}];return false;}var valid2 = _errs10 === errors;}else {var valid2 = true;}if(valid2){if(data.version !== undefined){let data4 = data.version;const _errs12 = errors;if(!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){validate11.errors = [{instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}if(!(((data4 === 1) || (data4 === 2)) || (data4 === 3))){validate11.errors = [{instancePath:instancePath+"/version",schemaPath:"#/properties/version/enum",keyword:"enum",params:{allowedValues: schema12.properties.version.enum},message:"must be equal to one of the allowed values"}];return false;}var valid2 = _errs12 === errors;}else {var valid2 = true;}if(valid2){if(data.author !== undefined){const _errs14 = errors;if(typeof data.author !== "string"){validate11.errors = [{instancePath:instancePath+"/author",schemaPath:"#/properties/author/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs14 === errors;}else {var valid2 = true;}if(valid2){if(data.isUpdatable !== undefined){let data6 = data.isUpdatable;const _errs16 = errors;if(typeof data6 !== "boolean"){validate11.errors = [{instancePath:instancePath+"/isUpdatable",schemaPath:"#/properties/isUpdatable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}if(true !== data6){validate11.errors = [{instancePath:instancePath+"/isUpdatable",schemaPath:"#/properties/isUpdatable/const",keyword:"const",params:{allowedValue: true},message:"must be equal to constant"}];return false;}var valid2 = _errs16 === errors;}else {var valid2 = true;}if(valid2){if(data.indexUrl !== undefined){const _errs18 = errors;if(typeof data.indexUrl !== "string"){validate11.errors = [{instancePath:instancePath+"/indexUrl",schemaPath:"#/properties/indexUrl/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs18 === errors;}else {var valid2 = true;}if(valid2){if(data.downloadUrl !== undefined){const _errs20 = errors;if(typeof data.downloadUrl !== "string"){validate11.errors = [{instancePath:instancePath+"/downloadUrl",schemaPath:"#/properties/downloadUrl/type",keyword:"type",params:{type: "