@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.05 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import e from"../../core/Error.js";import{A as r}from"../../chunks/ajv.bundle.js";import{json as t}from"../../portal/schemas/buildingSceneLayerItem.js";import{json as s}from"../../portal/schemas/integratedMesh3DTilesLayerItem.js";import{json as a}from"../../portal/schemas/integratedMeshLayerItem.js";import{json as o}from"../../portal/schemas/pointCloudLayerItem.js";import{json as n}from"../../portal/schemas/sceneLayerItem.js";import{convertAjvErrors as i}from"../../support/validationUtilsAjv.js";const m=new r({allErrors:!0,extendRefs:!0});function l(e,r){return m.validate(c(r),e),i(m.errors||[])}function c(r){switch(r){case"building-scene":return t;case"integrated-mesh":return a;case"integrated-mesh-3dtiles":return s;case"point-cloud":return o;case"scene":return n;default:throw new e("portalitemlayertype:unknown","Can not validate against unknown PortalItemLayerType.")}}export{l as validate};