UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 939 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import r from"../../../../../core/Error.js";import e from"../../../../../core/Logger.js";import{parseWhereClause as t}from"../../../../../core/sql.js";const n=()=>e.getLogger("esri.views.2d.layers.FeatureLayerView2D"),o={getAttribute:(r,e)=>r.readAttribute(e)};async function a(e,a){try{const s=await t(e,a);return s.isStandardized||n().error(new r("sql-parse-error","expression is not standardized",{where:e})),(t,a)=>{const i=t.readArcadeFeature();try{return s.testFeatureCompiled(i,o,a.currentUser)}catch(u){return n().warn(new r("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:u})),!0}}}catch(s){return n().warn(new r("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:s})),r=>!0}}export{a as createWhereClause};