UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 871 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{checkWasmError as e}from"./wasmUtils.js";function t(t,r,a,o=!1){const c=new a.ClientDataFetchRequestEncoder;c.deleteLater();for(const e of t){const t=n(e,r,a,o);c.add_client_data_fetch_request_parameter(t)}c.encode();const s=c.get_encoding_result();return e(s.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(s.get_byte_buffer())}function n(e,t,n,r){const a=new n.ClientDataKey;a.deleteLater(),a.key_string=e;const o=new n.ClientDataFetchRequestParameter;o.deleteLater(),o.set_key(a);const c=t.get(e);return c&&!r&&(o.v_tag={v_tag:c.version}),o}export{n as clientDataKeyToWasmFetchRequestParam,t as encodeClientDataAtKeysRequest};