Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@loaders.gl/schema

Package Overview
Dependencies
Maintainers
9
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/schema - npm Package Compare versions

Comparing version 4.2.0-alpha.5 to 4.2.0-alpha.6

92

dist/dist.dev.js

@@ -15,2 +15,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __commonJS = (cb, mod) => function __require() {

@@ -41,2 +42,6 @@ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;

var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};

@@ -126,7 +131,10 @@ // external-global-plugin:@loaders.gl/core

var BaseTableBatchAggregator = class {
schema;
options;
shape;
length = 0;
rows = null;
cursor = 0;
_headers = [];
constructor(schema, options) {
this.length = 0;
this.rows = null;
this.cursor = 0;
this._headers = [];
this.options = options;

@@ -227,8 +235,10 @@ this.schema = schema;

var RowTableBatchAggregator = class {
schema;
options;
length = 0;
objectRows = null;
arrayRows = null;
cursor = 0;
_headers = null;
constructor(schema, options) {
this.length = 0;
this.objectRows = null;
this.arrayRows = null;
this.cursor = 0;
this._headers = null;
this.options = options;

@@ -303,6 +313,7 @@ this.schema = schema;

var ColumnarTableBatchAggregator = class {
schema;
length = 0;
allocated = 0;
columns = {};
constructor(schema, options) {
this.length = 0;
this.allocated = 0;
this.columns = {};
this.schema = schema;

@@ -387,12 +398,14 @@ this._reallocateColumns();

var ERR_MESSAGE = "TableBatchBuilder";
var TableBatchBuilder = class {
var _TableBatchBuilder = class {
schema;
options;
aggregator = null;
batchCount = 0;
bytesUsed = 0;
isChunkComplete = false;
lastBatchEmittedMs = Date.now();
totalLength = 0;
totalBytes = 0;
rowBytes = 0;
constructor(schema, options) {
this.aggregator = null;
this.batchCount = 0;
this.bytesUsed = 0;
this.isChunkComplete = false;
this.lastBatchEmittedMs = Date.now();
this.totalLength = 0;
this.totalBytes = 0;
this.rowBytes = 0;
this.schema = schema;

@@ -504,6 +517,6 @@ this.options = { ...DEFAULT_OPTIONS, ...options };

case "arrow-table":
if (!TableBatchBuilder.ArrowBatch) {
if (!_TableBatchBuilder.ArrowBatch) {
throw new Error(ERR_MESSAGE);
}
return TableBatchBuilder.ArrowBatch;
return _TableBatchBuilder.ArrowBatch;
default:

@@ -514,2 +527,4 @@ return BaseTableBatchAggregator;

};
var TableBatchBuilder = _TableBatchBuilder;
__publicField(TableBatchBuilder, "ArrowBatch");

@@ -750,2 +765,6 @@ // src/lib/table/simple-table/table-accessors.ts

var ArrowLikeField = class {
name;
type;
nullable;
metadata;
constructor(name, type, nullable = false, metadata = /* @__PURE__ */ new Map()) {

@@ -767,3 +786,3 @@ this.name = name;

toString() {
return `${this.type}${this.nullable ? ", nullable" : ""}${this.metadata ? `, metadata: ${this.metadata}` : ""}`;
return `${JSON.stringify(this.type)}${this.nullable ? ", nullable" : ""}${this.metadata ? `, metadata: ${JSON.stringify(this.metadata)}` : ""}`;
}

@@ -774,2 +793,4 @@ };

var ArrowLikeSchema = class {
fields;
metadata;
constructor(fields, metadata = /* @__PURE__ */ new Map()) {

@@ -975,2 +996,4 @@ this.fields = fields.map(

var ArrowLikeVector = class {
table;
columnName;
constructor(table, columnName) {

@@ -996,2 +1019,4 @@ this.table = table;

var ArrowLikeTable = class {
schema;
table;
constructor(table) {

@@ -1412,2 +1437,4 @@ const schema = table.schema || deduceTableSchema(table);

var Int = class extends DataType {
isSigned;
bitWidth;
constructor(isSigned, bitWidth) {

@@ -1488,2 +1515,3 @@ super();

var Float = class extends DataType {
precision;
constructor(precision) {

@@ -1563,2 +1591,3 @@ super();

var Date2 = class extends DataType {
unit;
constructor(unit) {

@@ -1598,2 +1627,4 @@ super();

var Time = class extends DataType {
unit;
bitWidth;
constructor(unit, bitWidth) {

@@ -1628,2 +1659,4 @@ super();

var Timestamp = class extends DataType {
unit;
timezone;
constructor(unit, timezone = null) {

@@ -1672,2 +1705,3 @@ super();

var Interval = class extends DataType {
unit;
constructor(unit) {

@@ -1701,2 +1735,4 @@ super();

var FixedSizeList = class extends DataType {
listSize;
children;
constructor(listSize, child) {

@@ -1723,6 +1759,7 @@ super();

toString() {
return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
return `FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`;
}
};
var Struct = class extends DataType {
children;
constructor(children) {

@@ -1736,3 +1773,3 @@ super();

toString() {
return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(", ")}}>`;
return `Struct<{${this.children.map((f) => `${f.name}:${JSON.stringify(f.type)}`).join(", ")}}>`;
}

@@ -1775,2 +1812,5 @@ get [Symbol.toStringTag]() {

var AsyncQueue = class {
_values;
_settlers;
_closed;
constructor() {

@@ -1777,0 +1817,0 @@ this._values = new ArrayQueue();

@@ -7,4 +7,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

else root['loaders'] = factory();})(globalThis, function () {
"use strict";var __exports__=(()=>{var Xt=Object.create;var M=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty;var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ee=(t,e)=>{for(var r in e)M(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Kt(e))!Qt.call(t,a)&&a!==r&&M(t,a,{get:()=>e[a],enumerable:!(s=Zt(e,a))||s.enumerable});return t},U=(t,e,r)=>(_(t,e,"default"),r&&_(r,e,"default")),re=(t,e,r)=>(r=t!=null?Xt(Jt(t)):{},_(e||!t||!t.__esModule?M(r,"default",{value:t,enumerable:!0}):r,t)),se=t=>_(M({},"__esModule",{value:!0}),t);var Nt=te((be,Et)=>{Et.exports=globalThis.loaders});var C={};ee(C,{ArrowLikeDataType:()=>m,ArrowLikeField:()=>p,ArrowLikeSchema:()=>d,ArrowLikeTable:()=>W,AsyncQueue:()=>N,Binary:()=>st,Bool:()=>q,ColumnarTableBatchAggregator:()=>I,Date:()=>T,DateDay:()=>ot,DateMillisecond:()=>nt,FixedSizeList:()=>pt,Float:()=>A,Float16:()=>tt,Float32:()=>et,Float64:()=>rt,Int:()=>f,Int16:()=>V,Int32:()=>G,Int64:()=>X,Int8:()=>H,Interval:()=>F,IntervalDayTime:()=>dt,IntervalYearMonth:()=>ft,Null:()=>P,RowTableBatchAggregator:()=>S,Struct:()=>gt,TableBatchBuilder:()=>x,Time:()=>R,TimeMillisecond:()=>ct,TimeSecond:()=>it,Timestamp:()=>b,TimestampMicrosecond:()=>ht,TimestampMillisecond:()=>ut,TimestampNanosecond:()=>mt,TimestampSecond:()=>lt,Uint16:()=>K,Uint32:()=>J,Uint64:()=>Q,Uint8:()=>Z,Utf8:()=>at,convertTable:()=>Pt,convertToArrayRow:()=>v,convertToObjectRow:()=>L,deduceMeshField:()=>jt,deduceMeshSchema:()=>Vt,deduceTableSchema:()=>w,getDataTypeFromArray:()=>Y,getMeshBoundingBox:()=>Ht,getMeshSize:()=>qt,getTableCell:()=>j,getTableColumnIndex:()=>yt,getTableColumnName:()=>Ut,getTableLength:()=>h,getTableNumCols:()=>z,getTableRowAsArray:()=>E,getTableRowAsObject:()=>O,getTableRowShape:()=>Mt,getTypeInfo:()=>Gt,isTable:()=>_t,makeArrayRowIterator:()=>xt,makeBatchFromTable:()=>$t,makeMeshAttributeMetadata:()=>Tt,makeObjectRowIterator:()=>At,makeRowIterator:()=>kt,makeTableFromBatches:()=>Yt,makeTableFromData:()=>zt});U(C,re(Nt(),1));var k=class{constructor(e,r){if(this.length=0,this.rows=null,this.cursor=0,this._headers=[],this.options=r,this.schema=e,!Array.isArray(e)){this._headers=[];for(let s in e)this._headers[e[s].index]=e[s].name}}rowCount(){return this.length}addArrayRow(e,r){Number.isFinite(r)&&(this.cursor=r),this.shape="array-row-table",this.rows=this.rows||new Array(100),this.rows[this.length]=e,this.length++}addObjectRow(e,r){Number.isFinite(r)&&(this.cursor=r),this.shape="object-row-table",this.rows=this.rows||new Array(100),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}};function L(t,e){if(!t)throw new Error("null row");let r={};if(e)for(let s=0;s<e.length;s++)r[e[s]]=t[s];else for(let s=0;s<t.length;s++){let a=`column-${s}`;r[a]=t[s]}return r}function v(t,e){if(!t)throw new Error("null row");if(e){let r=new Array(e.length);for(let s=0;s<e.length;s++)r[s]=t[e[s]];return r}return Object.values(t)}function Ct(t){let e=[];for(let r=0;r<t.length;r++){let s=`column-${r}`;e.push(s)}return e}function Dt(t){return Object.keys(t)}var Bt=100,S=class{constructor(e,r){if(this.length=0,this.objectRows=null,this.arrayRows=null,this.cursor=0,this._headers=null,this.options=r,this.schema=e,e){this._headers=[];for(let s in e)this._headers[e[s].index]=e[s].name}}rowCount(){return this.length}addArrayRow(e,r){switch(Number.isFinite(r)&&(this.cursor=r),this._headers||(this._headers=Ct(e)),this.options.shape){case"object-row-table":let s=L(e,this._headers);this.addObjectRow(s,r);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(Bt),this.arrayRows[this.length]=e,this.length++;break}}addObjectRow(e,r){switch(Number.isFinite(r)&&(this.cursor=r),this._headers||(this._headers=Dt(e)),this.options.shape){case"array-row-table":let s=v(e,this._headers);this.addArrayRow(s,r);break;case"object-row-table":this.objectRows=this.objectRows||new Array(Bt),this.objectRows[this.length]=e,this.length++;break}}getBatch(){let e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}};var I=class{constructor(e,r){this.length=0,this.allocated=0,this.columns={},this.schema=e,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(e){this._reallocateColumns();let r=0;for(let s in this.columns)this.columns[s][this.length]=e[r++];this.length++}addObjectRow(e){this._reallocateColumns();for(let r in e)this.columns[r][this.length]=e[r];this.length++}getBatch(){this._pruneColumns();let e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(let s in this.schema){let a=this.schema[s];e[a.name]=this.columns[a.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(let e in this.schema){let r=this.schema[e],s=r.type||Float32Array,a=this.columns[r.index];if(a&&ArrayBuffer.isView(a)){let u=new s(this.allocated);u.set(a),this.columns[r.index]=u}else a?(a.length=this.allocated,this.columns[r.index]=a):this.columns[r.index]=new s(this.allocated)}}}_pruneColumns(){for(let[e,r]of Object.entries(this.columns))this.columns[e]=r.slice(0,this.length)}};var ae={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},oe="TableBatchBuilder",x=class{constructor(e,r){this.aggregator=null,this.batchCount=0,this.bytesUsed=0,this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),this.totalLength=0,this.totalBytes=0,this.rowBytes=0,this.schema=e,this.options={...ae,...r}}limitReached(){return!!(Boolean(this.options?.limit)&&this.totalLength>=this.options.limit||Boolean(this.options?._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){let r=this._getTableBatchType();this.aggregator=new r(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){let r=this._getTableBatchType();this.aggregator=new r(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e?.bytesUsed&&(this.bytesUsed=e.bytesUsed);let r=this.aggregator.getBatch();return r.count=this.batchCount,r.bytesUsed=this.bytesUsed,Object.assign(r,e),this.batchCount++,this.aggregator=null,r}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return S;case"columnar-table":return I;case"arrow-table":if(!x.ArrowBatch)throw new Error(oe);return x.ArrowBatch;default:return k}}};function _t(t){switch(typeof t=="object"&&t?.shape){case"array-row-table":case"object-row-table":return Array.isArray(t.data);case"geojson-table":return Array.isArray(t.features);case"columnar-table":return t.data&&typeof t.data=="object";case"arrow-table":return Boolean(t?.data?.numRows!==void 0);default:return!1}}function h(t){switch(t.shape){case"array-row-table":case"object-row-table":return t.data.length;case"geojson-table":return t.features.length;case"arrow-table":return t.data.numRows;case"columnar-table":for(let r of Object.values(t.data))return r.length||0;return 0;default:throw new Error("table")}}function z(t){if(t.schema)return t.schema.fields.length;if(h(t)===0)throw new Error("empty table");switch(t.shape){case"array-row-table":return t.data[0].length;case"object-row-table":return Object.keys(t.data[0]).length;case"geojson-table":return Object.keys(t.features[0]).length;case"columnar-table":return Object.keys(t.data).length;case"arrow-table":return t.data.numCols;default:throw new Error("table")}}function j(t,e,r){switch(t.shape){case"array-row-table":let s=yt(t,r);return t.data[e][s];case"object-row-table":return t.data[e][r];case"geojson-table":return t.features[e][r];case"columnar-table":return t.data[r][e];case"arrow-table":let u=t.data,c=u.schema.fields.findIndex(l=>l.name===r);return u.getChildAt(c)?.get(e);default:throw new Error("todo")}}function Mt(t){switch(t.shape){case"array-row-table":case"object-row-table":return t.shape;case"geojson-table":return"object-row-table";case"columnar-table":default:throw new Error("Not a row table")}}function yt(t,e){let r=t.schema?.fields.findIndex(s=>s.name===e);if(r===void 0)throw new Error(e);return r}function Ut(t,e){let r=t.schema?.fields[e]?.name;if(!r)throw new Error(`${e}`);return r}function O(t,e,r,s){switch(t.shape){case"object-row-table":return s?Object.fromEntries(Object.entries(t.data[e])):t.data[e];case"array-row-table":if(t.schema){let o=r||{};for(let n=0;n<t.schema.fields.length;n++)o[t.schema.fields[n].name]=t.data[e][n];return o}throw new Error("no schema");case"geojson-table":if(t.schema){let o=r||{};for(let n=0;n<t.schema.fields.length;n++)o[t.schema.fields[n].name]=t.features[e][n];return o}throw new Error("no schema");case"columnar-table":if(t.schema){let o=r||{};for(let n=0;n<t.schema.fields.length;n++)o[t.schema.fields[n].name]=t.data[t.schema.fields[n].name][e];return o}else{let o=r||{};for(let[n,g]of Object.entries(t.data))o[n]=g[e];return o}case"arrow-table":let a=t.data,u=r||{},c=a.get(e),l=a.schema;for(let o=0;o<l.fields.length;o++)u[l.fields[o].name]=c?.[l.fields[o].name];return u;default:throw new Error("shape")}}function E(t,e,r,s){switch(t.shape){case"array-row-table":return s?Array.from(t.data[e]):t.data[e];case"object-row-table":if(t.schema){let o=r||[];for(let n=0;n<t.schema.fields.length;n++)o[n]=t.data[e][t.schema.fields[n].name];return o}return Object.values(t.data[e]);case"geojson-table":if(t.schema){let o=r||[];for(let n=0;n<t.schema.fields.length;n++)o[n]=t.features[e][t.schema.fields[n].name];return o}return Object.values(t.features[e]);case"columnar-table":if(t.schema){let o=r||[];for(let n=0;n<t.schema.fields.length;n++)o[n]=t.data[t.schema.fields[n].name][e];return o}else{let o=r||[],n=0;for(let g of Object.values(t.data))o[n]=g[e],n++;return o}case"arrow-table":let a=t.data,u=r||[],c=a.get(e),l=a.schema;for(let o=0;o<l.fields.length;o++)u[o]=c?.[l.fields[o].name];return u;default:throw new Error("shape")}}function*kt(t,e){switch(e){case"array-row-table":yield*xt(t);break;case"object-row-table":yield*At(t);break;default:throw new Error(`Unknown row type ${e}`)}}function*xt(t,e=[]){let r=h(t);for(let s=0;s<r;s++)yield E(t,s,e)}function*At(t,e={}){let r=h(t);for(let s=0;s<r;s++)yield O(t,s,e)}var p=class{constructor(e,r,s=!1,a=new Map){this.name=e,this.type=r,this.nullable=s,this.metadata=a}get typeId(){return this.type&&this.type.typeId}clone(){return new p(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}};var d=class{constructor(e,r=new Map){this.fields=e.map(s=>new p(s.name,s.type,s.nullable,s.metadata)),this.metadata=r instanceof Map?r:new Map(Object.entries(r))}compareTo(e){if(this.metadata!==e.metadata||this.fields.length!==e.fields.length)return!1;for(let r=0;r<this.fields.length;++r)if(!this.fields[r].compareTo(e.fields[r]))return!1;return!0}select(...e){let r=Object.create(null);for(let a of e)r[a]=!0;let s=this.fields.filter(a=>r[a.name]);return new d(s,this.metadata)}selectAt(...e){let r=e.map(s=>this.fields[s]).filter(Boolean);return new d(r,this.metadata)}assign(e){let r,s=this.metadata;if(e instanceof d){let c=e;r=c.fields,s=Lt(Lt(new Map,this.metadata),c.metadata)}else r=e;let a=Object.create(null);for(let c of this.fields)a[c.name]=c;for(let c of r)a[c.name]=c;let u=Object.values(a);return new d(u,s)}};function Lt(t,e){return new Map([...t||new Map,...e||new Map])}function $(t,e="float32"){return t instanceof Date?"date-millisecond":t instanceof Number?e:typeof t=="string"?"utf8":(t===null||t==="undefined","null")}function Y(t){let e=St(t);return e!=="null"?{type:e,nullable:!1}:t.length>0?(e=$(t[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function St(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function vt(t,e){if(!e)switch(t){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:break}return Array}function w(t){switch(t.shape){case"array-row-table":case"object-row-table":return ie(t.data);case"columnar-table":return ne(t.data);case"arrow-table":default:throw new Error("Deduce schema")}}function ne(t){let e=[];for(let[r,s]of Object.entries(t)){let a=ce(s,r);e.push(a)}return{fields:e,metadata:{}}}function ie(t){if(!t.length)throw new Error("deduce from empty table");let e=[],r=t[0];for(let[s,a]of Object.entries(r))e.push(le(a,s));return{fields:e,metadata:{}}}function ce(t,e){if(ArrayBuffer.isView(t)){let r=Y(t);return{name:e,type:r.type||"null",nullable:r.nullable}}if(Array.isArray(t)&&t.length>0){let r=t[0],s=$(r);return{name:e,type:s,nullable:!0}}throw new Error("empty table")}function le(t,e){let r=$(t);return{name:e,type:r,nullable:!0}}var It=class{constructor(e,r){this.table=e,this.columnName=r}get(e){return j(this.table,e,this.columnName)}toArray(){switch(this.table.shape){case"arrow-table":return this.table.data.getChild(this.columnName)?.toArray();case"columnar-table":return this.table.data[this.columnName];default:throw new Error(this.table.shape)}}},W=class{constructor(e){let r=e.schema||w(e);this.schema=new d(r.fields,r.metadata),this.table={...e,schema:r}}get data(){return this.table.shape==="geojson-table"?this.table.features:this.table.data}get numCols(){return z(this.table)}get length(){return h(this.table)}getChild(e){return new It(this.table,e)}};function zt(t){let e;switch(ue(t)){case"array-row-table":e={shape:"array-row-table",data:t};break;case"object-row-table":e={shape:"object-row-table",data:t};break;case"columnar-table":e={shape:"columnar-table",data:t};break;default:throw new Error("table")}let r=w(e);return{...e,schema:r}}function ue(t){if(Array.isArray(t)){if(t.length===0)throw new Error("cannot deduce type of empty table");let e=t[0];if(Array.isArray(e))return"array-row-table";if(e&&typeof e=="object")return"object-row-table"}if(t&&typeof t=="object")return"columnar-table";throw new Error("invalid table")}function $t(t){return{...t,length:h(t),batchType:"data"}}async function Yt(t){let e,r,s,a=null,u;for await(let c of t)switch(a=a||c.shape,u=u||c.schema,c.shape){case"array-row-table":e=e||[];for(let l=0;l<h(c);l++){let o=c.data[l];e.push(o)}break;case"object-row-table":r=r||[];for(let l=0;l<h(c);l++){let o=c.data[l];r.push(o)}break;case"geojson-table":s=s||[];for(let l=0;l<h(c);l++){let o=c.features[l];s.push(o)}break;case"columnar-table":case"arrow-table":default:throw new Error("shape")}if(!a)return null;switch(a){case"array-row-table":return{shape:"array-row-table",data:e,schema:u};case"object-row-table":return{shape:"object-row-table",data:r,schema:u};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:s,schema:u};default:return null}}function Wt(t,e){let r=vt(t.type,t.nullable);return new r(e)}function Pt(t,e){switch(e){case"object-row-table":return fe(t);case"array-row-table":return de(t);case"columnar-table":return me(t);case"arrow-table":return he(t);default:throw new Error(e)}}function he(t){let e=globalThis.__loaders?._makeArrowTable;if(!e)throw new Error("");return e(t)}function me(t){let e=t.schema||w(t),r=t.schema?.fields||[];if(t.shape==="columnar-table")return{...t,schema:e};let s=h(t),a={};for(let u of r){let c=Wt(u,s);a[u.name]=c;for(let l=0;l<s;l++)c[l]=j(t,l,u.name)}return{shape:"columnar-table",schema:e,data:a}}function de(t){if(t.shape==="array-row-table")return t;let e=h(t),r=new Array(e);for(let s=0;s<e;s++)r[s]=E(t,s);return{shape:"array-row-table",schema:t.schema,data:r}}function fe(t){if(t.shape==="object-row-table")return t;let e=h(t),r=new Array(e);for(let s=0;s<e;s++)r[s]=O(t,s);return{shape:"object-row-table",schema:t.schema,data:r}}function qt(t){let e=0;for(let r in t){let s=t[r];ArrayBuffer.isView(s)&&(e+=s.byteLength*s.BYTES_PER_ELEMENT)}return e}function Ht(t){let e=1/0,r=1/0,s=1/0,a=-1/0,u=-1/0,c=-1/0,l=t.POSITION?t.POSITION.value:[],o=l&&l.length;for(let n=0;n<o;n+=3){let g=l[n],D=l[n+1],B=l[n+2];e=g<e?g:e,r=D<r?D:r,s=B<s?B:s,a=g>a?g:a,u=D>u?D:u,c=B>c?B:c}return[[e,r,s],[a,u,c]]}function Vt(t,e={}){return{fields:pe(t),metadata:e}}function jt(t,e,r){let s=St(e.value),a=r||Tt(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:s}]},nullable:!1,metadata:a}}function pe(t){let e=[];for(let r in t){let s=t[r];e.push(jt(r,s))}return e}function Tt(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}var i;(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"})(i||(i={}));var m=class{static isNull(e){return e&&e.typeId===i.Null}static isInt(e){return e&&e.typeId===i.Int}static isFloat(e){return e&&e.typeId===i.Float}static isBinary(e){return e&&e.typeId===i.Binary}static isUtf8(e){return e&&e.typeId===i.Utf8}static isBool(e){return e&&e.typeId===i.Bool}static isDecimal(e){return e&&e.typeId===i.Decimal}static isDate(e){return e&&e.typeId===i.Date}static isTime(e){return e&&e.typeId===i.Time}static isTimestamp(e){return e&&e.typeId===i.Timestamp}static isInterval(e){return e&&e.typeId===i.Interval}static isList(e){return e&&e.typeId===i.List}static isStruct(e){return e&&e.typeId===i.Struct}static isUnion(e){return e&&e.typeId===i.Union}static isFixedSizeBinary(e){return e&&e.typeId===i.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===i.FixedSizeList}static isMap(e){return e&&e.typeId===i.Map}static isDictionary(e){return e&&e.typeId===i.Dictionary}get typeId(){return i.NONE}compareTo(e){return this===e}},P=class extends m{get typeId(){return i.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},q=class extends m{get typeId(){return i.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},f=class extends m{constructor(e,r){super(),this.isSigned=e,this.bitWidth=r}get typeId(){return i.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},H=class extends f{constructor(){super(!0,8)}},V=class extends f{constructor(){super(!0,16)}},G=class extends f{constructor(){super(!0,32)}},X=class extends f{constructor(){super(!0,64)}},Z=class extends f{constructor(){super(!1,8)}},K=class extends f{constructor(){super(!1,16)}},J=class extends f{constructor(){super(!1,32)}},Q=class extends f{constructor(){super(!1,64)}},Rt={HALF:16,SINGLE:32,DOUBLE:64},A=class extends m{constructor(e){super(),this.precision=e}get typeId(){return i.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}},tt=class extends A{constructor(){super(Rt.HALF)}},et=class extends A{constructor(){super(Rt.SINGLE)}},rt=class extends A{constructor(){super(Rt.DOUBLE)}},st=class extends m{constructor(){super()}get typeId(){return i.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},at=class extends m{get typeId(){return i.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},Ft={DAY:0,MILLISECOND:1},T=class extends m{constructor(e){super(),this.unit=e}get typeId(){return i.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${Ft[this.unit]}>`}},ot=class extends T{constructor(){super(Ft.DAY)}},nt=class extends T{constructor(){super(Ft.MILLISECOND)}},y={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},R=class extends m{constructor(e,r){super(),this.unit=e,this.bitWidth=r}get typeId(){return i.Time}toString(){return`Time${this.bitWidth}<${y[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}},it=class extends R{constructor(){super(y.SECOND,32)}},ct=class extends R{constructor(){super(y.MILLISECOND,32)}},b=class extends m{constructor(e,r=null){super(),this.unit=e,this.timezone=r}get typeId(){return i.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${y[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}},lt=class extends b{constructor(e=null){super(y.SECOND,e)}},ut=class extends b{constructor(e=null){super(y.MILLISECOND,e)}},ht=class extends b{constructor(e=null){super(y.MICROSECOND,e)}},mt=class extends b{constructor(e=null){super(y.NANOSECOND,e)}},Ot={DAY_TIME:0,YEAR_MONTH:1},F=class extends m{constructor(e){super(),this.unit=e}get typeId(){return i.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${Ot[this.unit]}>`}},dt=class extends F{constructor(){super(Ot.DAY_TIME)}},ft=class extends F{constructor(){super(Ot.YEAR_MONTH)}},pt=class extends m{constructor(e,r){super(),this.listSize=e,this.children=[r]}get typeId(){return i.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}},gt=class extends m{constructor(e){super(),this.children=e}get typeId(){return i.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}};function Gt(t){return{typeId:t.typeId,ArrayType:t.ArrayType,typeName:t.toString(),typeEnumName:ge(t.typeId),precision:t.precision}}var wt=null;function ge(t){if(!wt){wt={};for(let e in i)wt[i[e]]=e}return wt[t]}var bt=class extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}},N=class{constructor(){this._values=new bt,this._settlers=new bt,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.dequeue();e instanceof Error?r.reject(e):r.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){let e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,r)=>{this._settlers.enqueue({resolve:e,reject:r})})}};return se(C);})();
"use strict";var __exports__=(()=>{var Zt=Object.create;var R=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Qt=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty;var re=(e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ae=(e,t)=>{for(var r in t)R(e,r,{get:t[r],enumerable:!0})},M=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Qt(t))!ee.call(e,a)&&a!==r&&R(e,a,{get:()=>t[a],enumerable:!(s=Kt(t,a))||s.enumerable});return e},U=(e,t,r)=>(M(e,t,"default"),r&&M(r,t,"default")),ne=(e,t,r)=>(r=e!=null?Zt(te(e)):{},M(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e)),oe=e=>M(R({},"__esModule",{value:!0}),e);var Et=(e,t,r)=>(re(e,typeof t!="symbol"?t+"":t,r),r);var Ct=se((Ae,Bt)=>{Bt.exports=globalThis.loaders});var C={};ae(C,{ArrowLikeDataType:()=>m,ArrowLikeField:()=>p,ArrowLikeSchema:()=>d,ArrowLikeTable:()=>P,AsyncQueue:()=>B,Binary:()=>at,Bool:()=>H,ColumnarTableBatchAggregator:()=>S,Date:()=>j,DateDay:()=>ot,DateMillisecond:()=>it,FixedSizeList:()=>gt,Float:()=>x,Float16:()=>et,Float32:()=>rt,Float64:()=>st,Int:()=>f,Int16:()=>J,Int32:()=>G,Int64:()=>X,Int8:()=>V,Interval:()=>O,IntervalDayTime:()=>ft,IntervalYearMonth:()=>pt,Null:()=>q,RowTableBatchAggregator:()=>A,Struct:()=>wt,TableBatchBuilder:()=>F,Time:()=>T,TimeMillisecond:()=>lt,TimeSecond:()=>ct,Timestamp:()=>b,TimestampMicrosecond:()=>mt,TimestampMillisecond:()=>ht,TimestampNanosecond:()=>dt,TimestampSecond:()=>ut,Uint16:()=>K,Uint32:()=>Q,Uint64:()=>tt,Uint8:()=>Z,Utf8:()=>nt,convertTable:()=>Ht,convertToArrayRow:()=>L,convertToObjectRow:()=>v,deduceMeshField:()=>Tt,deduceMeshSchema:()=>Gt,deduceTableSchema:()=>w,getDataTypeFromArray:()=>Y,getMeshBoundingBox:()=>Jt,getMeshSize:()=>Vt,getTableCell:()=>I,getTableColumnIndex:()=>xt,getTableColumnName:()=>vt,getTableLength:()=>h,getTableNumCols:()=>$,getTableRowAsArray:()=>E,getTableRowAsObject:()=>N,getTableRowShape:()=>kt,getTypeInfo:()=>Xt,isTable:()=>Ut,makeArrayRowIterator:()=>At,makeBatchFromTable:()=>Yt,makeMeshAttributeMetadata:()=>Ot,makeObjectRowIterator:()=>St,makeRowIterator:()=>Lt,makeTableFromBatches:()=>Pt,makeTableFromData:()=>Wt});U(C,ne(Ct(),1));var k=class{schema;options;shape;length=0;rows=null;cursor=0;_headers=[];constructor(t,r){if(this.options=r,this.schema=t,!Array.isArray(t)){this._headers=[];for(let s in t)this._headers[t[s].index]=t[s].name}}rowCount(){return this.length}addArrayRow(t,r){Number.isFinite(r)&&(this.cursor=r),this.shape="array-row-table",this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,r){Number.isFinite(r)&&(this.cursor=r),this.shape="object-row-table",this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;return t?(t=t.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}};function v(e,t){if(!e)throw new Error("null row");let r={};if(t)for(let s=0;s<t.length;s++)r[t[s]]=e[s];else for(let s=0;s<e.length;s++){let a=`column-${s}`;r[a]=e[s]}return r}function L(e,t){if(!e)throw new Error("null row");if(t){let r=new Array(t.length);for(let s=0;s<t.length;s++)r[s]=e[t[s]];return r}return Object.values(e)}function Dt(e){let t=[];for(let r=0;r<e.length;r++){let s=`column-${r}`;t.push(s)}return t}function _t(e){return Object.keys(e)}var Mt=100,A=class{schema;options;length=0;objectRows=null;arrayRows=null;cursor=0;_headers=null;constructor(t,r){if(this.options=r,this.schema=t,t){this._headers=[];for(let s in t)this._headers[t[s].index]=t[s].name}}rowCount(){return this.length}addArrayRow(t,r){switch(Number.isFinite(r)&&(this.cursor=r),this._headers||=Dt(t),this.options.shape){case"object-row-table":let s=v(t,this._headers);this.addObjectRow(s,r);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(Mt),this.arrayRows[this.length]=t,this.length++;break}}addObjectRow(t,r){switch(Number.isFinite(r)&&(this.cursor=r),this._headers||=_t(t),this.options.shape){case"array-row-table":let s=L(t,this._headers);this.addArrayRow(s,r);break;case"object-row-table":this.objectRows=this.objectRows||new Array(Mt),this.objectRows[this.length]=t,this.length++;break}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}};var S=class{schema;length=0;allocated=0;columns={};constructor(t,r){this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let r=0;for(let s in this.columns)this.columns[s][this.length]=t[r++];this.length++}addObjectRow(t){this._reallocateColumns();for(let r in t)this.columns[r][this.length]=t[r];this.length++}getBatch(){this._pruneColumns();let t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(let s in this.schema){let a=this.schema[s];t[a.name]=this.columns[a.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(let t in this.schema){let r=this.schema[t],s=r.type||Float32Array,a=this.columns[r.index];if(a&&ArrayBuffer.isView(a)){let u=new s(this.allocated);u.set(a),this.columns[r.index]=u}else a?(a.length=this.allocated,this.columns[r.index]=a):this.columns[r.index]=new s(this.allocated)}}}_pruneColumns(){for(let[t,r]of Object.entries(this.columns))this.columns[t]=r.slice(0,this.length)}};var ie={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},ce="TableBatchBuilder",z=class{schema;options;aggregator=null;batchCount=0;bytesUsed=0;isChunkComplete=!1;lastBatchEmittedMs=Date.now();totalLength=0;totalBytes=0;rowBytes=0;constructor(t,r){this.schema=t,this.options={...ie,...r}}limitReached(){return!!(Boolean(this.options?.limit)&&this.totalLength>=this.options.limit||Boolean(this.options?._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){let r=this._getTableBatchType();this.aggregator=new r(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){let r=this._getTableBatchType();this.aggregator=new r(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),typeof t=="string"&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?t.length*8:Object.keys(t).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;t?.bytesUsed&&(this.bytesUsed=t.bytesUsed);let r=this.aggregator.getBatch();return r.count=this.batchCount,r.bytesUsed=this.bytesUsed,Object.assign(r,t),this.batchCount++,this.aggregator=null,r}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return A;case"columnar-table":return S;case"arrow-table":if(!z.ArrowBatch)throw new Error(ce);return z.ArrowBatch;default:return k}}},F=z;Et(F,"ArrowBatch");function Ut(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function h(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let r of Object.values(e.data))return r.length||0;return 0;default:throw new Error("table")}}function $(e){if(e.schema)return e.schema.fields.length;if(h(e)===0)throw new Error("empty table");switch(e.shape){case"array-row-table":return e.data[0].length;case"object-row-table":return Object.keys(e.data[0]).length;case"geojson-table":return Object.keys(e.features[0]).length;case"columnar-table":return Object.keys(e.data).length;case"arrow-table":return e.data.numCols;default:throw new Error("table")}}function I(e,t,r){switch(e.shape){case"array-row-table":let s=xt(e,r);return e.data[t][s];case"object-row-table":return e.data[t][r];case"geojson-table":return e.features[t][r];case"columnar-table":return e.data[r][t];case"arrow-table":let u=e.data,c=u.schema.fields.findIndex(l=>l.name===r);return u.getChildAt(c)?.get(t);default:throw new Error("todo")}}function kt(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.shape;case"geojson-table":return"object-row-table";case"columnar-table":default:throw new Error("Not a row table")}}function xt(e,t){let r=e.schema?.fields.findIndex(s=>s.name===t);if(r===void 0)throw new Error(t);return r}function vt(e,t){let r=e.schema?.fields[t]?.name;if(!r)throw new Error(`${t}`);return r}function N(e,t,r,s){switch(e.shape){case"object-row-table":return s?Object.fromEntries(Object.entries(e.data[t])):e.data[t];case"array-row-table":if(e.schema){let n=r||{};for(let o=0;o<e.schema.fields.length;o++)n[e.schema.fields[o].name]=e.data[t][o];return n}throw new Error("no schema");case"geojson-table":if(e.schema){let n=r||{};for(let o=0;o<e.schema.fields.length;o++)n[e.schema.fields[o].name]=e.features[t][o];return n}throw new Error("no schema");case"columnar-table":if(e.schema){let n=r||{};for(let o=0;o<e.schema.fields.length;o++)n[e.schema.fields[o].name]=e.data[e.schema.fields[o].name][t];return n}else{let n=r||{};for(let[o,g]of Object.entries(e.data))n[o]=g[t];return n}case"arrow-table":let a=e.data,u=r||{},c=a.get(t),l=a.schema;for(let n=0;n<l.fields.length;n++)u[l.fields[n].name]=c?.[l.fields[n].name];return u;default:throw new Error("shape")}}function E(e,t,r,s){switch(e.shape){case"array-row-table":return s?Array.from(e.data[t]):e.data[t];case"object-row-table":if(e.schema){let n=r||[];for(let o=0;o<e.schema.fields.length;o++)n[o]=e.data[t][e.schema.fields[o].name];return n}return Object.values(e.data[t]);case"geojson-table":if(e.schema){let n=r||[];for(let o=0;o<e.schema.fields.length;o++)n[o]=e.features[t][e.schema.fields[o].name];return n}return Object.values(e.features[t]);case"columnar-table":if(e.schema){let n=r||[];for(let o=0;o<e.schema.fields.length;o++)n[o]=e.data[e.schema.fields[o].name][t];return n}else{let n=r||[],o=0;for(let g of Object.values(e.data))n[o]=g[t],o++;return n}case"arrow-table":let a=e.data,u=r||[],c=a.get(t),l=a.schema;for(let n=0;n<l.fields.length;n++)u[n]=c?.[l.fields[n].name];return u;default:throw new Error("shape")}}function*Lt(e,t){switch(t){case"array-row-table":yield*At(e);break;case"object-row-table":yield*St(e);break;default:throw new Error(`Unknown row type ${t}`)}}function*At(e,t=[]){let r=h(e);for(let s=0;s<r;s++)yield E(e,s,t)}function*St(e,t={}){let r=h(e);for(let s=0;s<r;s++)yield N(e,s,t)}var p=class{name;type;nullable;metadata;constructor(t,r,s=!1,a=new Map){this.name=t,this.type=r,this.nullable=s,this.metadata=a}get typeId(){return this.type&&this.type.typeId}clone(){return new p(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${JSON.stringify(this.type)}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${JSON.stringify(this.metadata)}`:""}`}};var d=class{fields;metadata;constructor(t,r=new Map){this.fields=t.map(s=>new p(s.name,s.type,s.nullable,s.metadata)),this.metadata=r instanceof Map?r:new Map(Object.entries(r))}compareTo(t){if(this.metadata!==t.metadata||this.fields.length!==t.fields.length)return!1;for(let r=0;r<this.fields.length;++r)if(!this.fields[r].compareTo(t.fields[r]))return!1;return!0}select(...t){let r=Object.create(null);for(let a of t)r[a]=!0;let s=this.fields.filter(a=>r[a.name]);return new d(s,this.metadata)}selectAt(...t){let r=t.map(s=>this.fields[s]).filter(Boolean);return new d(r,this.metadata)}assign(t){let r,s=this.metadata;if(t instanceof d){let c=t;r=c.fields,s=zt(zt(new Map,this.metadata),c.metadata)}else r=t;let a=Object.create(null);for(let c of this.fields)a[c.name]=c;for(let c of r)a[c.name]=c;let u=Object.values(a);return new d(u,s)}};function zt(e,t){return new Map([...e||new Map,...t||new Map])}function W(e,t="float32"){return e instanceof Date?"date-millisecond":e instanceof Number?t:typeof e=="string"?"utf8":(e===null||e==="undefined","null")}function Y(e){let t=It(e);return t!=="null"?{type:t,nullable:!1}:e.length>0?(t=W(e[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function It(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function $t(e,t){if(!t)switch(e){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;default:break}return Array}function w(e){switch(e.shape){case"array-row-table":case"object-row-table":return ue(e.data);case"columnar-table":return le(e.data);case"arrow-table":default:throw new Error("Deduce schema")}}function le(e){let t=[];for(let[r,s]of Object.entries(e)){let a=he(s,r);t.push(a)}return{fields:t,metadata:{}}}function ue(e){if(!e.length)throw new Error("deduce from empty table");let t=[],r=e[0];for(let[s,a]of Object.entries(r))t.push(me(a,s));return{fields:t,metadata:{}}}function he(e,t){if(ArrayBuffer.isView(e)){let r=Y(e);return{name:t,type:r.type||"null",nullable:r.nullable}}if(Array.isArray(e)&&e.length>0){let r=e[0],s=W(r);return{name:t,type:s,nullable:!0}}throw new Error("empty table")}function me(e,t){let r=W(e);return{name:t,type:r,nullable:!0}}var jt=class{table;columnName;constructor(t,r){this.table=t,this.columnName=r}get(t){return I(this.table,t,this.columnName)}toArray(){switch(this.table.shape){case"arrow-table":return this.table.data.getChild(this.columnName)?.toArray();case"columnar-table":return this.table.data[this.columnName];default:throw new Error(this.table.shape)}}},P=class{schema;table;constructor(t){let r=t.schema||w(t);this.schema=new d(r.fields,r.metadata),this.table={...t,schema:r}}get data(){return this.table.shape==="geojson-table"?this.table.features:this.table.data}get numCols(){return $(this.table)}get length(){return h(this.table)}getChild(t){return new jt(this.table,t)}};function Wt(e){let t;switch(de(e)){case"array-row-table":t={shape:"array-row-table",data:e};break;case"object-row-table":t={shape:"object-row-table",data:e};break;case"columnar-table":t={shape:"columnar-table",data:e};break;default:throw new Error("table")}let r=w(t);return{...t,schema:r}}function de(e){if(Array.isArray(e)){if(e.length===0)throw new Error("cannot deduce type of empty table");let t=e[0];if(Array.isArray(t))return"array-row-table";if(t&&typeof t=="object")return"object-row-table"}if(e&&typeof e=="object")return"columnar-table";throw new Error("invalid table")}function Yt(e){return{...e,length:h(e),batchType:"data"}}async function Pt(e){let t,r,s,a=null,u;for await(let c of e)switch(a=a||c.shape,u=u||c.schema,c.shape){case"array-row-table":t=t||[];for(let l=0;l<h(c);l++){let n=c.data[l];t.push(n)}break;case"object-row-table":r=r||[];for(let l=0;l<h(c);l++){let n=c.data[l];r.push(n)}break;case"geojson-table":s=s||[];for(let l=0;l<h(c);l++){let n=c.features[l];s.push(n)}break;case"columnar-table":case"arrow-table":default:throw new Error("shape")}if(!a)return null;switch(a){case"array-row-table":return{shape:"array-row-table",data:t,schema:u};case"object-row-table":return{shape:"object-row-table",data:r,schema:u};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:s,schema:u};default:return null}}function qt(e,t){let r=$t(e.type,e.nullable);return new r(t)}function Ht(e,t){switch(t){case"object-row-table":return we(e);case"array-row-table":return ge(e);case"columnar-table":return pe(e);case"arrow-table":return fe(e);default:throw new Error(t)}}function fe(e){let t=globalThis.__loaders?._makeArrowTable;if(!t)throw new Error("");return t(e)}function pe(e){let t=e.schema||w(e),r=e.schema?.fields||[];if(e.shape==="columnar-table")return{...e,schema:t};let s=h(e),a={};for(let u of r){let c=qt(u,s);a[u.name]=c;for(let l=0;l<s;l++)c[l]=I(e,l,u.name)}return{shape:"columnar-table",schema:t,data:a}}function ge(e){if(e.shape==="array-row-table")return e;let t=h(e),r=new Array(t);for(let s=0;s<t;s++)r[s]=E(e,s);return{shape:"array-row-table",schema:e.schema,data:r}}function we(e){if(e.shape==="object-row-table")return e;let t=h(e),r=new Array(t);for(let s=0;s<t;s++)r[s]=N(e,s);return{shape:"object-row-table",schema:e.schema,data:r}}function Vt(e){let t=0;for(let r in e){let s=e[r];ArrayBuffer.isView(s)&&(t+=s.byteLength*s.BYTES_PER_ELEMENT)}return t}function Jt(e){let t=1/0,r=1/0,s=1/0,a=-1/0,u=-1/0,c=-1/0,l=e.POSITION?e.POSITION.value:[],n=l&&l.length;for(let o=0;o<n;o+=3){let g=l[o],D=l[o+1],_=l[o+2];t=g<t?g:t,r=D<r?D:r,s=_<s?_:s,a=g>a?g:a,u=D>u?D:u,c=_>c?_:c}return[[t,r,s],[a,u,c]]}function Gt(e,t={}){return{fields:be(e),metadata:t}}function Tt(e,t,r){let s=It(t.value),a=r||Ot(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:s}]},nullable:!1,metadata:a}}function be(e){let t=[];for(let r in e){let s=e[r];t.push(Tt(r,s))}return t}function Ot(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}var i;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(i||(i={}));var m=class{static isNull(t){return t&&t.typeId===i.Null}static isInt(t){return t&&t.typeId===i.Int}static isFloat(t){return t&&t.typeId===i.Float}static isBinary(t){return t&&t.typeId===i.Binary}static isUtf8(t){return t&&t.typeId===i.Utf8}static isBool(t){return t&&t.typeId===i.Bool}static isDecimal(t){return t&&t.typeId===i.Decimal}static isDate(t){return t&&t.typeId===i.Date}static isTime(t){return t&&t.typeId===i.Time}static isTimestamp(t){return t&&t.typeId===i.Timestamp}static isInterval(t){return t&&t.typeId===i.Interval}static isList(t){return t&&t.typeId===i.List}static isStruct(t){return t&&t.typeId===i.Struct}static isUnion(t){return t&&t.typeId===i.Union}static isFixedSizeBinary(t){return t&&t.typeId===i.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===i.FixedSizeList}static isMap(t){return t&&t.typeId===i.Map}static isDictionary(t){return t&&t.typeId===i.Dictionary}get typeId(){return i.NONE}compareTo(t){return this===t}},q=class extends m{get typeId(){return i.Null}get[Symbol.toStringTag](){return"Null"}toString(){return"Null"}},H=class extends m{get typeId(){return i.Bool}get[Symbol.toStringTag](){return"Bool"}toString(){return"Bool"}},f=class extends m{isSigned;bitWidth;constructor(t,r){super(),this.isSigned=t,this.bitWidth=r}get typeId(){return i.Int}get[Symbol.toStringTag](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}},V=class extends f{constructor(){super(!0,8)}},J=class extends f{constructor(){super(!0,16)}},G=class extends f{constructor(){super(!0,32)}},X=class extends f{constructor(){super(!0,64)}},Z=class extends f{constructor(){super(!1,8)}},K=class extends f{constructor(){super(!1,16)}},Q=class extends f{constructor(){super(!1,32)}},tt=class extends f{constructor(){super(!1,64)}},Rt={HALF:16,SINGLE:32,DOUBLE:64},x=class extends m{precision;constructor(t){super(),this.precision=t}get typeId(){return i.Float}get[Symbol.toStringTag](){return"Float"}toString(){return`Float${this.precision}`}},et=class extends x{constructor(){super(Rt.HALF)}},rt=class extends x{constructor(){super(Rt.SINGLE)}},st=class extends x{constructor(){super(Rt.DOUBLE)}},at=class extends m{constructor(){super()}get typeId(){return i.Binary}toString(){return"Binary"}get[Symbol.toStringTag](){return"Binary"}},nt=class extends m{get typeId(){return i.Utf8}get[Symbol.toStringTag](){return"Utf8"}toString(){return"Utf8"}},Ft={DAY:0,MILLISECOND:1},j=class extends m{unit;constructor(t){super(),this.unit=t}get typeId(){return i.Date}get[Symbol.toStringTag](){return"Date"}toString(){return`Date${(this.unit+1)*32}<${Ft[this.unit]}>`}},ot=class extends j{constructor(){super(Ft.DAY)}},it=class extends j{constructor(){super(Ft.MILLISECOND)}},y={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9},T=class extends m{unit;bitWidth;constructor(t,r){super(),this.unit=t,this.bitWidth=r}get typeId(){return i.Time}toString(){return`Time${this.bitWidth}<${y[this.unit]}>`}get[Symbol.toStringTag](){return"Time"}},ct=class extends T{constructor(){super(y.SECOND,32)}},lt=class extends T{constructor(){super(y.MILLISECOND,32)}},b=class extends m{unit;timezone;constructor(t,r=null){super(),this.unit=t,this.timezone=r}get typeId(){return i.Timestamp}get[Symbol.toStringTag](){return"Timestamp"}toString(){return`Timestamp<${y[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}},ut=class extends b{constructor(t=null){super(y.SECOND,t)}},ht=class extends b{constructor(t=null){super(y.MILLISECOND,t)}},mt=class extends b{constructor(t=null){super(y.MICROSECOND,t)}},dt=class extends b{constructor(t=null){super(y.NANOSECOND,t)}},Nt={DAY_TIME:0,YEAR_MONTH:1},O=class extends m{unit;constructor(t){super(),this.unit=t}get typeId(){return i.Interval}get[Symbol.toStringTag](){return"Interval"}toString(){return`Interval<${Nt[this.unit]}>`}},ft=class extends O{constructor(){super(Nt.DAY_TIME)}},pt=class extends O{constructor(){super(Nt.YEAR_MONTH)}},gt=class extends m{listSize;children;constructor(t,r){super(),this.listSize=t,this.children=[r]}get typeId(){return i.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Symbol.toStringTag](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`}},wt=class extends m{children;constructor(t){super(),this.children=t}get typeId(){return i.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${JSON.stringify(t.type)}`).join(", ")}}>`}get[Symbol.toStringTag](){return"Struct"}};function Xt(e){return{typeId:e.typeId,ArrayType:e.ArrayType,typeName:e.toString(),typeEnumName:ye(e.typeId),precision:e.precision}}var bt=null;function ye(e){if(!bt){bt={};for(let t in i)bt[i[t]]=t}return bt[e]}var yt=class extends Array{enqueue(t){return this.push(t)}dequeue(){return this.shift()}},B=class{_values;_settlers;_closed;constructor(){this._values=new yt,this._settlers=new yt,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.dequeue();t instanceof Error?r.reject(t):r.resolve({value:t})}else this._values.enqueue(t)}next(){if(this._values.length>0){let t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((t,r)=>{this._settlers.enqueue({resolve:t,reject:r})})}};return oe(C);})();
return __exports__;
});

@@ -11,2 +11,6 @@ // loaders.gl

export class ArrowLikeField {
name;
type;
nullable;
metadata;
constructor(name, type, nullable = false, metadata = new Map()) {

@@ -31,4 +35,4 @@ this.name = name;

toString() {
return `${this.type}${this.nullable ? ', nullable' : ''}${this.metadata ? `, metadata: ${this.metadata}` : ''}`;
return `${JSON.stringify(this.type)}${this.nullable ? ', nullable' : ''}${this.metadata ? `, metadata: ${JSON.stringify(this.metadata)}` : ''}`;
}
}

@@ -6,2 +6,4 @@ // loaders.gl

export class ArrowLikeSchema {
fields;
metadata;
constructor(fields, metadata = new Map()) {

@@ -8,0 +10,0 @@ // checkNames(fields);

@@ -15,2 +15,4 @@ // loaders.gl

class ArrowLikeVector {
table;
columnName;
constructor(table, columnName) {

@@ -40,2 +42,4 @@ this.table = table;

export class ArrowLikeTable {
schema;
table;
constructor(table) {

@@ -42,0 +46,0 @@ const schema = table.schema || deduceTableSchema(table);

@@ -105,2 +105,4 @@ // loaders.gl

export class Int extends DataType {
isSigned;
bitWidth;
constructor(isSigned, bitWidth) {

@@ -182,2 +184,3 @@ super();

export class Float extends DataType {
precision;
constructor(precision) {

@@ -259,2 +262,3 @@ super();

export class Date extends DataType {
unit;
constructor(unit) {

@@ -294,2 +298,4 @@ super();

export class Time extends DataType {
unit;
bitWidth;
constructor(unit, bitWidth) {

@@ -323,2 +329,4 @@ super();

export class Timestamp extends DataType {
unit;
timezone;
constructor(unit, timezone = null) {

@@ -367,2 +375,3 @@ super();

export class Interval extends DataType {
unit;
constructor(unit) {

@@ -396,2 +405,4 @@ super();

export class FixedSizeList extends DataType {
listSize;
children;
constructor(listSize, child) {

@@ -418,6 +429,7 @@ super();

toString() {
return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
return `FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`;
}
}
export class Struct extends DataType {
children;
constructor(children) {

@@ -431,3 +443,5 @@ super();

toString() {
return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(', ')}}>`;
return `Struct<{${this.children
.map((f) => `${f.name}:${JSON.stringify(f.type)}`)
.join(', ')}}>`;
}

@@ -434,0 +448,0 @@ get [Symbol.toStringTag]() {

@@ -6,7 +6,10 @@ // loaders.gl

export class BaseTableBatchAggregator {
schema;
options;
shape;
length = 0;
rows = null;
cursor = 0;
_headers = [];
constructor(schema, options) {
this.length = 0;
this.rows = null;
this.cursor = 0;
this._headers = [];
this.options = options;

@@ -13,0 +16,0 @@ this.schema = schema;

@@ -6,6 +6,7 @@ // loaders.gl

export class ColumnarTableBatchAggregator {
schema;
length = 0;
allocated = 0;
columns = {};
constructor(schema, options) {
this.length = 0;
this.allocated = 0;
this.columns = {};
this.schema = schema;

@@ -12,0 +13,0 @@ this._reallocateColumns();

@@ -7,8 +7,10 @@ // loaders.gl

export class RowTableBatchAggregator {
schema;
options;
length = 0;
objectRows = null;
arrayRows = null;
cursor = 0;
_headers = null;
constructor(schema, options) {
this.length = 0;
this.objectRows = null;
this.arrayRows = null;
this.cursor = 0;
this._headers = null;
this.options = options;

@@ -33,3 +35,3 @@ this.schema = schema;

// TODO - infer schema at a higher level, instead of hacking headers here?
this._headers || (this._headers = inferHeadersFromArrayRow(row));
this._headers ||= inferHeadersFromArrayRow(row);
// eslint-disable-next-line default-case

@@ -53,3 +55,3 @@ switch (this.options.shape) {

// TODO - infer schema at a higher level, instead of hacking headers here?
this._headers || (this._headers = inferHeadersFromObjectRow(row));
this._headers ||= inferHeadersFromObjectRow(row);
// eslint-disable-next-line default-case

@@ -56,0 +58,0 @@ switch (this.options.shape) {

@@ -17,11 +17,14 @@ // loaders.gl

export class TableBatchBuilder {
schema;
options;
aggregator = null;
batchCount = 0;
bytesUsed = 0;
isChunkComplete = false;
lastBatchEmittedMs = Date.now();
totalLength = 0;
totalBytes = 0;
rowBytes = 0;
static ArrowBatch;
constructor(schema, options) {
this.aggregator = null;
this.batchCount = 0;
this.bytesUsed = 0;
this.isChunkComplete = false;
this.lastBatchEmittedMs = Date.now();
this.totalLength = 0;
this.totalBytes = 0;
this.rowBytes = 0;
this.schema = schema;

@@ -28,0 +31,0 @@ this.options = { ...DEFAULT_OPTIONS, ...options };

@@ -14,2 +14,5 @@ // From https://github.com/rauschma/async-iter-demo/tree/master/src under MIT license

export default class AsyncQueue {
_values;
_settlers;
_closed;
constructor() {

@@ -16,0 +19,0 @@ // enqueues > dequeues

{
"name": "@loaders.gl/schema",
"version": "4.2.0-alpha.5",
"version": "4.2.0-alpha.6",
"description": "Table format APIs for JSON, CSV, etc...",

@@ -49,3 +49,3 @@ "license": "MIT",

},
"gitHead": "32d95a81971f104e4dfeb88ab57065f05321a76a"
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
}

@@ -49,6 +49,6 @@ // loaders.gl

toString(): string {
return `${this.type}${this.nullable ? ', nullable' : ''}${
this.metadata ? `, metadata: ${this.metadata}` : ''
return `${JSON.stringify(this.type)}${this.nullable ? ', nullable' : ''}${
this.metadata ? `, metadata: ${JSON.stringify(this.metadata)}` : ''
}`;
}
}

@@ -479,3 +479,3 @@ // loaders.gl

toString(): string {
return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
return `FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`;
}

@@ -496,3 +496,5 @@ }

public toString() {
return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(', ')}}>`;
return `Struct<{${this.children
.map((f) => `${f.name}:${JSON.stringify(f.type)}`)
.join(', ')}}>`;
}

@@ -499,0 +501,0 @@ get [Symbol.toStringTag](): string {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc