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

@loaders.gl/schema

Package Overview
Dependencies
Maintainers
7
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 3.3.0-alpha.5 to 3.3.0-alpha.6

1

dist/es5/bundle.js
"use strict";
var moduleExports = require('./index');
globalThis.loaders = globalThis.loaders || {};
module.exports = Object.assign(globalThis.loaders, moduleExports);
//# sourceMappingURL=bundle.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -10,7 +9,4 @@ value: true

exports.convertMeshToColumnarTable = convertMeshToColumnarTable;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _meshToArrowTable = require("./mesh-to-arrow-table");
function convertMesh(mesh, shape, options) {

@@ -20,6 +16,4 @@ switch (shape || 'mesh') {

return mesh;
case 'columnar-table':
return convertMeshToColumnarTable(mesh);
case 'arrow-table':

@@ -30,3 +24,2 @@ return {

};
default:

@@ -39,11 +32,8 @@ throw new Error("Unsupported shape ".concat(options === null || options === void 0 ? void 0 : options.shape));

var columns = {};
for (var _i = 0, _Object$entries = Object.entries(mesh.attributes); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
columnName = _Object$entries$_i[0],
attribute = _Object$entries$_i[1];
columnName = _Object$entries$_i[0],
attribute = _Object$entries$_i[1];
columns[columnName] = attribute.value;
}
return {

@@ -50,0 +40,0 @@ shape: 'columnar-table',

@@ -6,10 +6,7 @@ "use strict";

});
exports.deduceMeshField = deduceMeshField;
exports.deduceMeshSchema = deduceMeshSchema;
exports.deduceMeshField = deduceMeshField;
exports.makeMeshAttributeMetadata = makeMeshAttributeMetadata;
var _schema = require("../../lib/schema/schema");
var _arrowLikeTypeUtils = require("../../lib/arrow/arrow-like-type-utils");
function deduceMeshSchema(attributes, metadata) {

@@ -29,3 +26,2 @@ var fields = deduceMeshFields(attributes);

var fields = [];
for (var attributeName in attributes) {

@@ -35,3 +31,2 @@ var attribute = attributes[attributeName];

}
return fields;

@@ -42,17 +37,13 @@ }

var result = new Map();
if ('byteOffset' in attribute) {
result.set('byteOffset', attribute.byteOffset.toString(10));
}
if ('byteStride' in attribute) {
result.set('byteStride', attribute.byteStride.toString(10));
}
if ('normalized' in attribute) {
result.set('normalized', attribute.normalized.toString());
}
return result;
}
//# sourceMappingURL=deduce-mesh-schema.js.map

@@ -7,20 +7,14 @@ "use strict";

exports.convertMeshToArrowTable = convertMeshToArrowTable;
var _Arrow = require("apache-arrow/Arrow.dom");
var _arrowTypeUtils = require("../../lib/arrow/arrow-type-utils");
var _deduceMeshSchema = require("./deduce-mesh-schema");
function convertMeshToArrowTable(mesh, batchSize) {
var _mesh$schema;
var vectors = [];
var fields = [];
for (var attributeKey in mesh.attributes) {
var attribute = mesh.attributes[attributeKey];
var value = attribute.value,
_attribute$size = attribute.size,
size = _attribute$size === void 0 ? 1 : _attribute$size;
_attribute$size = attribute.size,
size = _attribute$size === void 0 ? 1 : _attribute$size;
var type = (0, _arrowTypeUtils.getArrowType)(value);

@@ -35,3 +29,2 @@ var vector = (0, _arrowTypeUtils.getArrowVector)(value);

}
var schema = new _Arrow.Schema(fields, (mesh === null || mesh === void 0 ? void 0 : (_mesh$schema = mesh.schema) === null || _mesh$schema === void 0 ? void 0 : _mesh$schema.metadata) || new Map());

@@ -38,0 +31,0 @@ var recordBatch = new _Arrow.RecordBatch(schema, vectors[0].length, vectors);

@@ -6,11 +6,9 @@ "use strict";

});
exports.getMeshBoundingBox = getMeshBoundingBox;
exports.getMeshSize = getMeshSize;
exports.getMeshBoundingBox = getMeshBoundingBox;
function getMeshSize(attributes) {
var size = 0;
for (var attributeName in attributes) {
var attribute = attributes[attributeName];
if (ArrayBuffer.isView(attribute)) {

@@ -20,3 +18,2 @@ size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;

}
return size;

@@ -34,3 +31,2 @@ }

var len = positions && positions.length;
for (var i = 0; i < len; i += 3) {

@@ -47,5 +43,4 @@ var x = positions[i];

}
return [[minX, minY, minZ], [maxX, maxY, maxZ]];
}
//# sourceMappingURL=mesh-utils.js.map

@@ -12,9 +12,6 @@ "use strict";

}
function deduceSchemaForColumnarTable(columnarTable) {
var schema = {};
for (var field in columnarTable) {
var column = columnarTable[field];
if (ArrayBuffer.isView(column)) {

@@ -26,15 +23,10 @@ schema[field] = column.constructor;

}
schema[field] = schema[field] || null;
}
return schema;
}
function deduceSchemaForRowTable(rowTable) {
var schema = {};
if (rowTable.length) {
var row = rowTable[0];
for (var field in row) {

@@ -45,6 +37,4 @@ var value = row[field];

}
return schema;
}
function deduceTypeFromValue(value) {

@@ -58,5 +48,4 @@ if (value instanceof Date) {

}
return null;
}
//# sourceMappingURL=deduce-table-schema.js.map

212

dist/es5/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "TableBatchBuilder", {
Object.defineProperty(exports, "AsyncQueue", {
enumerable: true,
get: function get() {
return _tableBatchBuilder.default;
return _asyncQueue.default;
}
});
Object.defineProperty(exports, "RowTableBatchAggregator", {
Object.defineProperty(exports, "Binary", {
enumerable: true,
get: function get() {
return _rowTableBatchAggregator.default;
return _schema.Binary;
}
});
Object.defineProperty(exports, "Bool", {
enumerable: true,
get: function get() {
return _schema.Bool;
}
});
Object.defineProperty(exports, "ColumnarTableBatchAggregator", {

@@ -26,84 +31,84 @@ enumerable: true,

});
Object.defineProperty(exports, "convertToObjectRow", {
Object.defineProperty(exports, "DataType", {
enumerable: true,
get: function get() {
return _rowUtils.convertToObjectRow;
return _schema.DataType;
}
});
Object.defineProperty(exports, "convertToArrayRow", {
Object.defineProperty(exports, "Date", {
enumerable: true,
get: function get() {
return _rowUtils.convertToArrayRow;
return _schema.Date;
}
});
Object.defineProperty(exports, "getMeshSize", {
Object.defineProperty(exports, "DateDay", {
enumerable: true,
get: function get() {
return _meshUtils.getMeshSize;
return _schema.DateDay;
}
});
Object.defineProperty(exports, "getMeshBoundingBox", {
Object.defineProperty(exports, "DateMillisecond", {
enumerable: true,
get: function get() {
return _meshUtils.getMeshBoundingBox;
return _schema.DateMillisecond;
}
});
Object.defineProperty(exports, "deduceMeshSchema", {
Object.defineProperty(exports, "Field", {
enumerable: true,
get: function get() {
return _deduceMeshSchema.deduceMeshSchema;
return _schema.Field;
}
});
Object.defineProperty(exports, "deduceMeshField", {
Object.defineProperty(exports, "FixedSizeList", {
enumerable: true,
get: function get() {
return _deduceMeshSchema.deduceMeshField;
return _schema.FixedSizeList;
}
});
Object.defineProperty(exports, "makeMeshAttributeMetadata", {
Object.defineProperty(exports, "Float", {
enumerable: true,
get: function get() {
return _deduceMeshSchema.makeMeshAttributeMetadata;
return _schema.Float;
}
});
Object.defineProperty(exports, "Schema", {
Object.defineProperty(exports, "Float16", {
enumerable: true,
get: function get() {
return _schema.Schema;
return _schema.Float16;
}
});
Object.defineProperty(exports, "Field", {
Object.defineProperty(exports, "Float32", {
enumerable: true,
get: function get() {
return _schema.Field;
return _schema.Float32;
}
});
Object.defineProperty(exports, "DataType", {
Object.defineProperty(exports, "Float64", {
enumerable: true,
get: function get() {
return _schema.DataType;
return _schema.Float64;
}
});
Object.defineProperty(exports, "Null", {
Object.defineProperty(exports, "Int", {
enumerable: true,
get: function get() {
return _schema.Null;
return _schema.Int;
}
});
Object.defineProperty(exports, "Binary", {
Object.defineProperty(exports, "Int16", {
enumerable: true,
get: function get() {
return _schema.Binary;
return _schema.Int16;
}
});
Object.defineProperty(exports, "Bool", {
Object.defineProperty(exports, "Int32", {
enumerable: true,
get: function get() {
return _schema.Bool;
return _schema.Int32;
}
});
Object.defineProperty(exports, "Int", {
Object.defineProperty(exports, "Int64", {
enumerable: true,
get: function get() {
return _schema.Int;
return _schema.Int64;
}

@@ -117,180 +122,180 @@ });

});
Object.defineProperty(exports, "Int16", {
Object.defineProperty(exports, "Interval", {
enumerable: true,
get: function get() {
return _schema.Int16;
return _schema.Interval;
}
});
Object.defineProperty(exports, "Int32", {
Object.defineProperty(exports, "IntervalDayTime", {
enumerable: true,
get: function get() {
return _schema.Int32;
return _schema.IntervalDayTime;
}
});
Object.defineProperty(exports, "Int64", {
Object.defineProperty(exports, "IntervalYearMonth", {
enumerable: true,
get: function get() {
return _schema.Int64;
return _schema.IntervalYearMonth;
}
});
Object.defineProperty(exports, "Uint8", {
Object.defineProperty(exports, "Null", {
enumerable: true,
get: function get() {
return _schema.Uint8;
return _schema.Null;
}
});
Object.defineProperty(exports, "Uint16", {
Object.defineProperty(exports, "RowTableBatchAggregator", {
enumerable: true,
get: function get() {
return _schema.Uint16;
return _rowTableBatchAggregator.default;
}
});
Object.defineProperty(exports, "Uint32", {
Object.defineProperty(exports, "Schema", {
enumerable: true,
get: function get() {
return _schema.Uint32;
return _schema.Schema;
}
});
Object.defineProperty(exports, "Uint64", {
Object.defineProperty(exports, "Struct", {
enumerable: true,
get: function get() {
return _schema.Uint64;
return _schema.Struct;
}
});
Object.defineProperty(exports, "Float", {
Object.defineProperty(exports, "TableBatchBuilder", {
enumerable: true,
get: function get() {
return _schema.Float;
return _tableBatchBuilder.default;
}
});
Object.defineProperty(exports, "Float16", {
Object.defineProperty(exports, "Time", {
enumerable: true,
get: function get() {
return _schema.Float16;
return _schema.Time;
}
});
Object.defineProperty(exports, "Float32", {
Object.defineProperty(exports, "TimeMillisecond", {
enumerable: true,
get: function get() {
return _schema.Float32;
return _schema.TimeMillisecond;
}
});
Object.defineProperty(exports, "Float64", {
Object.defineProperty(exports, "TimeSecond", {
enumerable: true,
get: function get() {
return _schema.Float64;
return _schema.TimeSecond;
}
});
Object.defineProperty(exports, "Utf8", {
Object.defineProperty(exports, "Timestamp", {
enumerable: true,
get: function get() {
return _schema.Utf8;
return _schema.Timestamp;
}
});
Object.defineProperty(exports, "Date", {
Object.defineProperty(exports, "TimestampMicrosecond", {
enumerable: true,
get: function get() {
return _schema.Date;
return _schema.TimestampMicrosecond;
}
});
Object.defineProperty(exports, "DateDay", {
Object.defineProperty(exports, "TimestampMillisecond", {
enumerable: true,
get: function get() {
return _schema.DateDay;
return _schema.TimestampMillisecond;
}
});
Object.defineProperty(exports, "DateMillisecond", {
Object.defineProperty(exports, "TimestampNanosecond", {
enumerable: true,
get: function get() {
return _schema.DateMillisecond;
return _schema.TimestampNanosecond;
}
});
Object.defineProperty(exports, "Time", {
Object.defineProperty(exports, "TimestampSecond", {
enumerable: true,
get: function get() {
return _schema.Time;
return _schema.TimestampSecond;
}
});
Object.defineProperty(exports, "TimeMillisecond", {
Object.defineProperty(exports, "Uint16", {
enumerable: true,
get: function get() {
return _schema.TimeMillisecond;
return _schema.Uint16;
}
});
Object.defineProperty(exports, "TimeSecond", {
Object.defineProperty(exports, "Uint32", {
enumerable: true,
get: function get() {
return _schema.TimeSecond;
return _schema.Uint32;
}
});
Object.defineProperty(exports, "Timestamp", {
Object.defineProperty(exports, "Uint64", {
enumerable: true,
get: function get() {
return _schema.Timestamp;
return _schema.Uint64;
}
});
Object.defineProperty(exports, "TimestampSecond", {
Object.defineProperty(exports, "Uint8", {
enumerable: true,
get: function get() {
return _schema.TimestampSecond;
return _schema.Uint8;
}
});
Object.defineProperty(exports, "TimestampMillisecond", {
Object.defineProperty(exports, "Utf8", {
enumerable: true,
get: function get() {
return _schema.TimestampMillisecond;
return _schema.Utf8;
}
});
Object.defineProperty(exports, "TimestampMicrosecond", {
Object.defineProperty(exports, "convertToArrayRow", {
enumerable: true,
get: function get() {
return _schema.TimestampMicrosecond;
return _rowUtils.convertToArrayRow;
}
});
Object.defineProperty(exports, "TimestampNanosecond", {
Object.defineProperty(exports, "convertToObjectRow", {
enumerable: true,
get: function get() {
return _schema.TimestampNanosecond;
return _rowUtils.convertToObjectRow;
}
});
Object.defineProperty(exports, "Interval", {
Object.defineProperty(exports, "deduceMeshField", {
enumerable: true,
get: function get() {
return _schema.Interval;
return _deduceMeshSchema.deduceMeshField;
}
});
Object.defineProperty(exports, "IntervalDayTime", {
Object.defineProperty(exports, "deduceMeshSchema", {
enumerable: true,
get: function get() {
return _schema.IntervalDayTime;
return _deduceMeshSchema.deduceMeshSchema;
}
});
Object.defineProperty(exports, "IntervalYearMonth", {
Object.defineProperty(exports, "deduceTypeFromColumn", {
enumerable: true,
get: function get() {
return _schema.IntervalYearMonth;
return _deduceColumnType.deduceTypeFromColumn;
}
});
Object.defineProperty(exports, "FixedSizeList", {
Object.defineProperty(exports, "deduceTypeFromValue", {
enumerable: true,
get: function get() {
return _schema.FixedSizeList;
return _deduceColumnType.deduceTypeFromValue;
}
});
Object.defineProperty(exports, "Struct", {
Object.defineProperty(exports, "getArrowTypeFromTypedArray", {
enumerable: true,
get: function get() {
return _schema.Struct;
return _arrowLikeTypeUtils.getArrowTypeFromTypedArray;
}
});
Object.defineProperty(exports, "deduceTypeFromColumn", {
Object.defineProperty(exports, "getMeshBoundingBox", {
enumerable: true,
get: function get() {
return _deduceColumnType.deduceTypeFromColumn;
return _meshUtils.getMeshBoundingBox;
}
});
Object.defineProperty(exports, "deduceTypeFromValue", {
Object.defineProperty(exports, "getMeshSize", {
enumerable: true,
get: function get() {
return _deduceColumnType.deduceTypeFromValue;
return _meshUtils.getMeshSize;
}

@@ -304,36 +309,19 @@ });

});
Object.defineProperty(exports, "getArrowTypeFromTypedArray", {
Object.defineProperty(exports, "makeMeshAttributeMetadata", {
enumerable: true,
get: function get() {
return _arrowLikeTypeUtils.getArrowTypeFromTypedArray;
return _deduceMeshSchema.makeMeshAttributeMetadata;
}
});
Object.defineProperty(exports, "AsyncQueue", {
enumerable: true,
get: function get() {
return _asyncQueue.default;
}
});
var _tableBatchBuilder = _interopRequireDefault(require("./lib/batches/table-batch-builder"));
var _rowTableBatchAggregator = _interopRequireDefault(require("./lib/batches/row-table-batch-aggregator"));
var _columnarTableBatchAggregator = _interopRequireDefault(require("./lib/batches/columnar-table-batch-aggregator"));
var _rowUtils = require("./lib/utils/row-utils");
var _meshUtils = require("./category/mesh/mesh-utils");
var _deduceMeshSchema = require("./category/mesh/deduce-mesh-schema");
var _schema = require("./lib/schema/schema");
var _deduceColumnType = require("./lib/schema-utils/deduce-column-type");
var _getTypeInfo = require("./lib/arrow/get-type-info");
var _arrowLikeTypeUtils = require("./lib/arrow/arrow-like-type-utils");
var _asyncQueue = _interopRequireDefault(require("./lib/utils/async-queue"));
//# sourceMappingURL=index.js.map

@@ -7,5 +7,3 @@ "use strict";

exports.getArrowTypeFromTypedArray = getArrowTypeFromTypedArray;
var _schema = require("../schema/schema");
function getArrowTypeFromTypedArray(array) {

@@ -15,24 +13,16 @@ switch (array.constructor) {

return new _schema.Int8();
case Uint8Array:
return new _schema.Uint8();
case Int16Array:
return new _schema.Int16();
case Uint16Array:
return new _schema.Uint16();
case Int32Array:
return new _schema.Int32();
case Uint32Array:
return new _schema.Uint32();
case Float32Array:
return new _schema.Float32();
case Float64Array:
return new _schema.Float64();
default:

@@ -39,0 +29,0 @@ throw new Error('array type not supported');

@@ -8,5 +8,3 @@ "use strict";

exports.getArrowVector = getArrowVector;
var _Arrow = require("apache-arrow/Arrow.dom");
function getArrowType(array) {

@@ -16,24 +14,16 @@ switch (array.constructor) {

return new _Arrow.Int8();
case Uint8Array:
return new _Arrow.Uint8();
case Int16Array:
return new _Arrow.Int16();
case Uint16Array:
return new _Arrow.Uint16();
case Int32Array:
return new _Arrow.Int32();
case Uint32Array:
return new _Arrow.Uint32();
case Float32Array:
return new _Arrow.Float32();
case Float64Array:
return new _Arrow.Float64();
default:

@@ -43,3 +33,2 @@ throw new Error('array type not supported');

}
function getArrowVector(array) {

@@ -49,24 +38,16 @@ switch (array.constructor) {

return _Arrow.Int8Vector.from(array);
case Uint8Array:
return _Arrow.Uint8Vector.from(array);
case Int16Array:
return _Arrow.Int16Vector.from(array);
case Uint16Array:
return _Arrow.Uint16Vector.from(array);
case Int32Array:
return _Arrow.Int32Vector.from(array);
case Uint32Array:
return _Arrow.Uint32Vector.from(array);
case Float32Array:
return _Arrow.Float32Vector.from(array);
case Float64Array:
return _Arrow.Float64Vector.from(array);
default:

@@ -73,0 +54,0 @@ throw new Error('array type not supported');

@@ -7,5 +7,3 @@ "use strict";

exports.getTypeInfo = getTypeInfo;
var _schema = require("../schema/schema");
function getTypeInfo(arrowTypeLike) {

@@ -20,9 +18,6 @@ return {

}
var ReverseType = null;
function getTypeKey(typeKey) {
if (!ReverseType) {
ReverseType = {};
for (var _key in _schema.Type) {

@@ -32,5 +27,4 @@ ReverseType[_schema.Type[_key]] = _key;

}
return ReverseType[typeKey];
}
//# sourceMappingURL=get-type-info.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,11 +8,6 @@ value: true

exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var DEFAULT_ROW_COUNT = 100;
var RowTableBatchAggregator = function () {

@@ -33,3 +27,2 @@ function RowTableBatchAggregator(schema, options) {

this._headers = [];
for (var key in schema) {

@@ -40,3 +33,2 @@ this._headers[schema[key].index] = schema[key].name;

}
(0, _createClass2.default)(RowTableBatchAggregator, [{

@@ -53,3 +45,2 @@ key: "rowCount",

}
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);

@@ -65,3 +56,2 @@ this.rows[this.length] = row;

}
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);

@@ -75,7 +65,5 @@ this.rows[this.length] = row;

var rows = this.rows;
if (!rows) {
return null;
}
rows = rows.slice(0, this.length);

@@ -96,4 +84,3 @@ this.rows = null;

}();
exports.default = RowTableBatchAggregator;
//# sourceMappingURL=base-table-batch-aggregator.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,13 +8,7 @@ value: true

exports.default = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var DEFAULT_ROW_COUNT = 100;
var ColumnarTableBatchAggregator = function () {

@@ -29,6 +22,4 @@ function ColumnarTableBatchAggregator(schema, options) {

this.schema = schema;
this._reallocateColumns();
}
(0, _createClass2.default)(ColumnarTableBatchAggregator, [{

@@ -43,9 +34,6 @@ key: "rowCount",

this._reallocateColumns();
var i = 0;
for (var fieldName in this.columns) {
this.columns[fieldName][this.length] = row[i++];
}
this.length++;

@@ -57,7 +45,5 @@ }

this._reallocateColumns();
for (var fieldName in row) {
this.columns[fieldName][this.length] = row[fieldName];
}
this.length++;

@@ -69,3 +55,2 @@ }

this._pruneColumns();
var columns = Array.isArray(this.schema) ? this.columns : {};

@@ -79,3 +64,2 @@

}
this.columns = {};

@@ -91,5 +75,8 @@ var batch = {

}
}, {
key: "_reallocateColumns",
value: function _reallocateColumns() {
value:
function _reallocateColumns() {
if (this.length < this.allocated) {

@@ -101,3 +88,2 @@ return;

this.columns = {};
for (var fieldName in this.schema) {

@@ -107,3 +93,2 @@ var field = this.schema[fieldName];

var oldColumn = this.columns[field.index];
if (oldColumn && ArrayBuffer.isView(oldColumn)) {

@@ -126,5 +111,4 @@ var typedArray = new ArrayType(this.allocated);

var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
_columnName = _Object$entries$_i[0],
column = _Object$entries$_i[1];
_columnName = _Object$entries$_i[0],
column = _Object$entries$_i[1];
this.columns[_columnName] = column.slice(0, this.length);

@@ -136,4 +120,3 @@ }

}();
exports.default = ColumnarTableBatchAggregator;
//# sourceMappingURL=columnar-table-batch-aggregator.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,13 +8,8 @@ value: true

exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _rowUtils = require("../utils/row-utils");
var DEFAULT_ROW_COUNT = 100;
var RowTableBatchAggregator = function () {

@@ -36,3 +30,2 @@ function RowTableBatchAggregator(schema, options) {

this._headers = [];
for (var key in schema) {

@@ -43,3 +36,2 @@ this._headers[schema[key].index] = schema[key].name;

}
(0, _createClass2.default)(RowTableBatchAggregator, [{

@@ -62,3 +54,2 @@ key: "rowCount",

break;
case 'array-row-table':

@@ -83,3 +74,2 @@ this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);

break;
case 'object-row-table':

@@ -96,7 +86,5 @@ this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);

var rows = this.arrayRows || this.objectRows;
if (!rows) {
return null;
}
rows = rows.slice(0, this.length);

@@ -117,4 +105,3 @@ this.arrayRows = null;

}();
exports.default = RowTableBatchAggregator;
//# sourceMappingURL=row-table-batch-aggregator.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,19 +8,10 @@ value: true

exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _baseTableBatchAggregator = _interopRequireDefault(require("./base-table-batch-aggregator"));
var _rowTableBatchAggregator = _interopRequireDefault(require("./row-table-batch-aggregator"));
var _columnarTableBatchAggregator = _interopRequireDefault(require("./columnar-table-batch-aggregator"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var DEFAULT_OPTIONS = {

@@ -52,3 +42,2 @@ shape: 'array-row-table',

}
(0, _createClass2.default)(TableBatchBuilder, [{

@@ -58,24 +47,21 @@ key: "limitReached",

var _this$options, _this$options2;
if (Boolean((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.limit) && this.totalLength >= this.options.limit) {
return true;
}
if (Boolean((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
return true;
}
return false;
}
}, {
key: "addRow",
value: function addRow(row) {
value:
function addRow(row) {
if (this.limitReached()) {
return;
}
this.totalLength++;
this.rowBytes = this.rowBytes || this._estimateRowMB(row);
this.totalBytes += this.rowBytes;
if (Array.isArray(row)) {

@@ -87,35 +73,35 @@ this.addArrayRow(row);

}
}, {
key: "addArrayRow",
value: function addArrayRow(row) {
value:
function addArrayRow(row) {
if (!this.aggregator) {
var TableBatchType = this._getTableBatchType();
this.aggregator = new TableBatchType(this.schema, this.options);
}
this.aggregator.addArrayRow(row);
}
}, {
key: "addObjectRow",
value: function addObjectRow(row) {
value:
function addObjectRow(row) {
if (!this.aggregator) {
var TableBatchType = this._getTableBatchType();
this.aggregator = new TableBatchType(this.schema, this.options);
}
this.aggregator.addObjectRow(row);
}
}, {
key: "chunkComplete",
value: function chunkComplete(chunk) {
value:
function chunkComplete(chunk) {
if (chunk instanceof ArrayBuffer) {
this.bytesUsed += chunk.byteLength;
}
if (typeof chunk === 'string') {
this.bytesUsed += chunk.length;
}
this.isChunkComplete = true;

@@ -133,5 +119,8 @@ }

}
}, {
key: "_estimateRowMB",
value: function _estimateRowMB(row) {
value:
function _estimateRowMB(row) {
return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;

@@ -162,5 +151,7 @@ }

}
}, {
key: "_getBatch",
value: function _getBatch(options) {
value:
function _getBatch(options) {
if (!this.aggregator) {

@@ -173,3 +164,2 @@ return null;

}
var normalizedBatch = this.aggregator.getBatch();

@@ -189,10 +179,7 @@ normalizedBatch.count = this.batchCount;

return _baseTableBatchAggregator.default;
case 'array-row-table':
case 'object-row-table':
return _rowTableBatchAggregator.default;
case 'columnar-table':
return _columnarTableBatchAggregator.default;
case 'arrow-table':

@@ -202,5 +189,3 @@ if (!TableBatchBuilder.ArrowBatch) {

}
return TableBatchBuilder.ArrowBatch;
default:

@@ -213,5 +198,4 @@ throw new Error(ERR_MESSAGE);

}();
exports.default = TableBatchBuilder;
(0, _defineProperty2.default)(TableBatchBuilder, "ArrowBatch", void 0);
//# sourceMappingURL=table-batch-builder.js.map

@@ -17,6 +17,4 @@ "use strict";

}
return null;
}
function deduceTypeFromValue(value) {

@@ -30,5 +28,4 @@ if (value instanceof Date) {

}
return null;
}
//# sourceMappingURL=deduce-column-type.js.map

@@ -9,3 +9,2 @@ "use strict";

exports.Type = Type;
(function (Type) {

@@ -12,0 +11,0 @@ Type[Type["NONE"] = 0] = "NONE";

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,9 +8,5 @@ value: true

exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var Field = function () {

@@ -31,3 +26,2 @@ function Field(name, type) {

}
(0, _createClass2.default)(Field, [{

@@ -56,4 +50,3 @@ key: "typeId",

}();
exports.default = Field;
//# sourceMappingURL=field.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,20 +8,12 @@ value: true

exports.default = void 0;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _assert = require("../../utils/assert");
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var Schema = function () {
var Schema = function () {
function Schema(fields, metadata) {

@@ -40,11 +31,10 @@ (0, _classCallCheck2.default)(this, Schema);

key: "compareTo",
value: function compareTo(other) {
value:
function compareTo(other) {
if (this.metadata !== other.metadata) {
return false;
}
if (this.fields.length !== other.fields.length) {
return false;
}
for (var i = 0; i < this.fields.length; ++i) {

@@ -55,3 +45,2 @@ if (!this.fields[i].compareTo(other.fields[i])) {

}
return true;

@@ -63,7 +52,5 @@ }

var nameMap = Object.create(null);
for (var _len = arguments.length, columnNames = new Array(_len), _key = 0; _key < _len; _key++) {
columnNames[_key] = arguments[_key];
}
for (var _i = 0, _columnNames = columnNames; _i < _columnNames.length; _i++) {

@@ -73,3 +60,2 @@ var name = _columnNames[_i];

}
var selectedFields = this.fields.filter(function (field) {

@@ -84,7 +70,5 @@ return nameMap[field.name];

var _this = this;
for (var _len2 = arguments.length, columnIndices = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
columnIndices[_key2] = arguments[_key2];
}
var selectedFields = columnIndices.map(function (index) {

@@ -100,3 +84,2 @@ return _this.fields[index];

var metadata = this.metadata;
if (schemaOrFields instanceof Schema) {

@@ -111,6 +94,4 @@ var otherSchema = schemaOrFields;

var fieldMap = Object.create(null);
var _iterator = _createForOfIteratorHelper(this.fields),
_step;
_step;
try {

@@ -126,6 +107,4 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
var _iterator2 = _createForOfIteratorHelper(fields),
_step2;
_step2;
try {

@@ -141,3 +120,2 @@ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {

}
var mergedFields = Object.values(fieldMap);

@@ -149,19 +127,13 @@ return new Schema(mergedFields, metadata);

}();
exports.default = Schema;
function checkNames(fields) {
var usedNames = {};
var _iterator3 = _createForOfIteratorHelper(fields),
_step3;
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var field = _step3.value;
if (usedNames[field.name]) {
console.warn('Schema: duplicated field name', field.name, field);
}
usedNames[field.name] = true;

@@ -175,3 +147,2 @@ }

}
function mergeMaps(m1, m2) {

@@ -178,0 +149,0 @@ return new Map([].concat((0, _toConsumableArray2.default)(m1 || new Map()), (0, _toConsumableArray2.default)(m2 || new Map())));

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimestampSecond = exports.TimestampNanosecond = exports.TimestampMillisecond = exports.TimestampMicrosecond = exports.Timestamp = exports.TimeSecond = exports.TimeMillisecond = exports.Time = exports.Struct = exports.Null = exports.IntervalYearMonth = exports.IntervalDayTime = exports.Interval = exports.Int8 = exports.Int64 = exports.Int32 = exports.Int16 = exports.Int = exports.Float64 = exports.Float32 = exports.Float16 = exports.Float = exports.FixedSizeList = exports.DateMillisecond = exports.DateDay = exports.Date = exports.DataType = exports.Bool = exports.Binary = void 0;
Object.defineProperty(exports, "Type", {

@@ -14,26 +14,14 @@ enumerable: true,

});
exports.Struct = exports.FixedSizeList = exports.IntervalYearMonth = exports.IntervalDayTime = exports.Interval = exports.TimestampNanosecond = exports.TimestampMicrosecond = exports.TimestampMillisecond = exports.TimestampSecond = exports.Timestamp = exports.TimeMillisecond = exports.TimeSecond = exports.Time = exports.DateMillisecond = exports.DateDay = exports.Date = exports.Utf8 = exports.Binary = exports.Float64 = exports.Float32 = exports.Float16 = exports.Float = exports.Uint64 = exports.Uint32 = exports.Uint16 = exports.Uint8 = exports.Int64 = exports.Int32 = exports.Int16 = exports.Int8 = exports.Int = exports.Bool = exports.Null = exports.DataType = void 0;
exports.Utf8 = exports.Uint8 = exports.Uint64 = exports.Uint32 = exports.Uint16 = void 0;
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _enum = require("./enum");
var _Symbol$toStringTag, _Symbol$toStringTag2, _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag5, _Symbol$toStringTag6, _Symbol$toStringTag7, _Symbol$toStringTag8;
var _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag7, _Symbol$toStringTag8, _Symbol$toStringTag9, _Symbol$toStringTag10, _Symbol$toStringTag11, _Symbol$toStringTag12;
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var DataType = function () {

@@ -43,3 +31,2 @@ function DataType() {

}
(0, _createClass2.default)(DataType, [{

@@ -50,5 +37,8 @@ key: "typeId",

}
}, {
key: "compareTo",
value: function compareTo(other) {
value:
function compareTo(other) {
return this === other;

@@ -149,10 +139,6 @@ }

}();
exports.DataType = DataType;
var Null = function (_DataType) {
var Null = function (_DataType, _Symbol$toStringTag) {
(0, _inherits2.default)(Null, _DataType);
var _super = _createSuper(Null);
function Null() {

@@ -162,3 +148,2 @@ (0, _classCallCheck2.default)(this, Null);

}
(0, _createClass2.default)(Null, [{

@@ -170,3 +155,3 @@ key: "typeId",

}, {
key: Symbol.toStringTag,
key: _Symbol$toStringTag,
get: function get() {

@@ -182,11 +167,7 @@ return 'Null';

return Null;
}(DataType);
}(DataType, Symbol.toStringTag);
exports.Null = Null;
var Bool = function (_DataType2) {
var Bool = function (_DataType2, _Symbol$toStringTag2) {
(0, _inherits2.default)(Bool, _DataType2);
var _super2 = _createSuper(Bool);
function Bool() {

@@ -196,3 +177,2 @@ (0, _classCallCheck2.default)(this, Bool);

}
(0, _createClass2.default)(Bool, [{

@@ -204,4 +184,5 @@ key: "typeId",

}, {
key: Symbol.toStringTag,
get: function get() {
key: _Symbol$toStringTag2,
get:
function get() {
return 'Bool';

@@ -216,15 +197,10 @@ }

return Bool;
}(DataType);
}(DataType, Symbol.toStringTag);
exports.Bool = Bool;
_Symbol$toStringTag = Symbol.toStringTag;
_Symbol$toStringTag3 = Symbol.toStringTag;
var Int = function (_DataType3) {
(0, _inherits2.default)(Int, _DataType3);
var _super3 = _createSuper(Int);
function Int(isSigned, bitWidth) {
var _this;
(0, _classCallCheck2.default)(this, Int);

@@ -238,3 +214,2 @@ _this = _super3.call(this);

}
(0, _createClass2.default)(Int, [{

@@ -246,4 +221,5 @@ key: "typeId",

}, {
key: _Symbol$toStringTag,
get: function get() {
key: _Symbol$toStringTag3,
get:
function get() {
return 'Int';

@@ -259,10 +235,6 @@ }

}(DataType);
exports.Int = Int;
var Int8 = function (_Int) {
(0, _inherits2.default)(Int8, _Int);
var _super4 = _createSuper(Int8);
function Int8() {

@@ -272,13 +244,8 @@ (0, _classCallCheck2.default)(this, Int8);

}
return Int8;
return (0, _createClass2.default)(Int8);
}(Int);
exports.Int8 = Int8;
var Int16 = function (_Int2) {
(0, _inherits2.default)(Int16, _Int2);
var _super5 = _createSuper(Int16);
function Int16() {

@@ -288,13 +255,8 @@ (0, _classCallCheck2.default)(this, Int16);

}
return Int16;
return (0, _createClass2.default)(Int16);
}(Int);
exports.Int16 = Int16;
var Int32 = function (_Int3) {
(0, _inherits2.default)(Int32, _Int3);
var _super6 = _createSuper(Int32);
function Int32() {

@@ -304,13 +266,8 @@ (0, _classCallCheck2.default)(this, Int32);

}
return Int32;
return (0, _createClass2.default)(Int32);
}(Int);
exports.Int32 = Int32;
var Int64 = function (_Int4) {
(0, _inherits2.default)(Int64, _Int4);
var _super7 = _createSuper(Int64);
function Int64() {

@@ -320,13 +277,8 @@ (0, _classCallCheck2.default)(this, Int64);

}
return Int64;
return (0, _createClass2.default)(Int64);
}(Int);
exports.Int64 = Int64;
var Uint8 = function (_Int5) {
(0, _inherits2.default)(Uint8, _Int5);
var _super8 = _createSuper(Uint8);
function Uint8() {

@@ -336,13 +288,8 @@ (0, _classCallCheck2.default)(this, Uint8);

}
return Uint8;
return (0, _createClass2.default)(Uint8);
}(Int);
exports.Uint8 = Uint8;
var Uint16 = function (_Int6) {
(0, _inherits2.default)(Uint16, _Int6);
var _super9 = _createSuper(Uint16);
function Uint16() {

@@ -352,13 +299,8 @@ (0, _classCallCheck2.default)(this, Uint16);

}
return Uint16;
return (0, _createClass2.default)(Uint16);
}(Int);
exports.Uint16 = Uint16;
var Uint32 = function (_Int7) {
(0, _inherits2.default)(Uint32, _Int7);
var _super10 = _createSuper(Uint32);
function Uint32() {

@@ -368,13 +310,8 @@ (0, _classCallCheck2.default)(this, Uint32);

}
return Uint32;
return (0, _createClass2.default)(Uint32);
}(Int);
exports.Uint32 = Uint32;
var Uint64 = function (_Int8) {
(0, _inherits2.default)(Uint64, _Int8);
var _super11 = _createSuper(Uint64);
function Uint64() {

@@ -384,7 +321,6 @@ (0, _classCallCheck2.default)(this, Uint64);

}
return Uint64;
return (0, _createClass2.default)(Uint64);
}(Int);
exports.Uint64 = Uint64;
exports.Uint64 = Uint64;
var Precision = {

@@ -395,12 +331,8 @@ HALF: 16,

};
_Symbol$toStringTag2 = Symbol.toStringTag;
_Symbol$toStringTag4 = Symbol.toStringTag;
var Float = function (_DataType4) {
(0, _inherits2.default)(Float, _DataType4);
var _super12 = _createSuper(Float);
function Float(precision) {
var _this2;
(0, _classCallCheck2.default)(this, Float);

@@ -412,3 +344,2 @@ _this2 = _super12.call(this);

}
(0, _createClass2.default)(Float, [{

@@ -420,4 +351,5 @@ key: "typeId",

}, {
key: _Symbol$toStringTag2,
get: function get() {
key: _Symbol$toStringTag4,
get:
function get() {
return 'Float';

@@ -433,10 +365,6 @@ }

}(DataType);
exports.Float = Float;
var Float16 = function (_Float) {
(0, _inherits2.default)(Float16, _Float);
var _super13 = _createSuper(Float16);
function Float16() {

@@ -446,13 +374,8 @@ (0, _classCallCheck2.default)(this, Float16);

}
return Float16;
return (0, _createClass2.default)(Float16);
}(Float);
exports.Float16 = Float16;
var Float32 = function (_Float2) {
(0, _inherits2.default)(Float32, _Float2);
var _super14 = _createSuper(Float32);
function Float32() {

@@ -462,13 +385,8 @@ (0, _classCallCheck2.default)(this, Float32);

}
return Float32;
return (0, _createClass2.default)(Float32);
}(Float);
exports.Float32 = Float32;
var Float64 = function (_Float3) {
(0, _inherits2.default)(Float64, _Float3);
var _super15 = _createSuper(Float64);
function Float64() {

@@ -478,13 +396,8 @@ (0, _classCallCheck2.default)(this, Float64);

}
return Float64;
return (0, _createClass2.default)(Float64);
}(Float);
exports.Float64 = Float64;
var Binary = function (_DataType5) {
var Binary = function (_DataType5, _Symbol$toStringTag5) {
(0, _inherits2.default)(Binary, _DataType5);
var _super16 = _createSuper(Binary);
function Binary() {

@@ -494,3 +407,2 @@ (0, _classCallCheck2.default)(this, Binary);

}
(0, _createClass2.default)(Binary, [{

@@ -507,3 +419,3 @@ key: "typeId",

}, {
key: Symbol.toStringTag,
key: _Symbol$toStringTag5,
get: function get() {

@@ -514,11 +426,7 @@ return 'Binary';

return Binary;
}(DataType);
}(DataType, Symbol.toStringTag);
exports.Binary = Binary;
var Utf8 = function (_DataType6) {
var Utf8 = function (_DataType6, _Symbol$toStringTag6) {
(0, _inherits2.default)(Utf8, _DataType6);
var _super17 = _createSuper(Utf8);
function Utf8() {

@@ -528,3 +436,2 @@ (0, _classCallCheck2.default)(this, Utf8);

}
(0, _createClass2.default)(Utf8, [{

@@ -536,4 +443,5 @@ key: "typeId",

}, {
key: Symbol.toStringTag,
get: function get() {
key: _Symbol$toStringTag6,
get:
function get() {
return 'Utf8';

@@ -548,5 +456,5 @@ }

return Utf8;
}(DataType);
}(DataType, Symbol.toStringTag);
exports.Utf8 = Utf8;
exports.Utf8 = Utf8;
var DateUnit = {

@@ -556,12 +464,8 @@ DAY: 0,

};
_Symbol$toStringTag3 = Symbol.toStringTag;
_Symbol$toStringTag7 = Symbol.toStringTag;
var Date = function (_DataType7) {
(0, _inherits2.default)(Date, _DataType7);
var _super18 = _createSuper(Date);
function Date(unit) {
var _this3;
(0, _classCallCheck2.default)(this, Date);

@@ -573,3 +477,2 @@ _this3 = _super18.call(this);

}
(0, _createClass2.default)(Date, [{

@@ -581,4 +484,5 @@ key: "typeId",

}, {
key: _Symbol$toStringTag3,
get: function get() {
key: _Symbol$toStringTag7,
get:
function get() {
return 'Date';

@@ -594,10 +498,6 @@ }

}(DataType);
exports.Date = Date;
var DateDay = function (_Date) {
(0, _inherits2.default)(DateDay, _Date);
var _super19 = _createSuper(DateDay);
function DateDay() {

@@ -607,13 +507,8 @@ (0, _classCallCheck2.default)(this, DateDay);

}
return DateDay;
return (0, _createClass2.default)(DateDay);
}(Date);
exports.DateDay = DateDay;
var DateMillisecond = function (_Date2) {
(0, _inherits2.default)(DateMillisecond, _Date2);
var _super20 = _createSuper(DateMillisecond);
function DateMillisecond() {

@@ -623,6 +518,4 @@ (0, _classCallCheck2.default)(this, DateMillisecond);

}
return DateMillisecond;
return (0, _createClass2.default)(DateMillisecond);
}(Date);
exports.DateMillisecond = DateMillisecond;

@@ -635,12 +528,8 @@ var TimeUnit = {

};
_Symbol$toStringTag4 = Symbol.toStringTag;
_Symbol$toStringTag8 = Symbol.toStringTag;
var Time = function (_DataType8) {
(0, _inherits2.default)(Time, _DataType8);
var _super21 = _createSuper(Time);
function Time(unit, bitWidth) {
var _this4;
(0, _classCallCheck2.default)(this, Time);

@@ -654,3 +543,2 @@ _this4 = _super21.call(this);

}
(0, _createClass2.default)(Time, [{

@@ -667,3 +555,3 @@ key: "typeId",

}, {
key: _Symbol$toStringTag4,
key: _Symbol$toStringTag8,
get: function get() {

@@ -675,10 +563,6 @@ return 'Time';

}(DataType);
exports.Time = Time;
var TimeSecond = function (_Time) {
(0, _inherits2.default)(TimeSecond, _Time);
var _super22 = _createSuper(TimeSecond);
function TimeSecond() {

@@ -688,13 +572,8 @@ (0, _classCallCheck2.default)(this, TimeSecond);

}
return TimeSecond;
return (0, _createClass2.default)(TimeSecond);
}(Time);
exports.TimeSecond = TimeSecond;
var TimeMillisecond = function (_Time2) {
(0, _inherits2.default)(TimeMillisecond, _Time2);
var _super23 = _createSuper(TimeMillisecond);
function TimeMillisecond() {

@@ -704,17 +583,11 @@ (0, _classCallCheck2.default)(this, TimeMillisecond);

}
return TimeMillisecond;
return (0, _createClass2.default)(TimeMillisecond);
}(Time);
exports.TimeMillisecond = TimeMillisecond;
_Symbol$toStringTag5 = Symbol.toStringTag;
_Symbol$toStringTag9 = Symbol.toStringTag;
var Timestamp = function (_DataType9) {
(0, _inherits2.default)(Timestamp, _DataType9);
var _super24 = _createSuper(Timestamp);
function Timestamp(unit) {
var _this5;
var timezone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

@@ -729,3 +602,2 @@ (0, _classCallCheck2.default)(this, Timestamp);

}
(0, _createClass2.default)(Timestamp, [{

@@ -737,4 +609,5 @@ key: "typeId",

}, {
key: _Symbol$toStringTag5,
get: function get() {
key: _Symbol$toStringTag9,
get:
function get() {
return 'Timestamp';

@@ -750,10 +623,6 @@ }

}(DataType);
exports.Timestamp = Timestamp;
var TimestampSecond = function (_Timestamp) {
(0, _inherits2.default)(TimestampSecond, _Timestamp);
var _super25 = _createSuper(TimestampSecond);
function TimestampSecond() {

@@ -764,13 +633,8 @@ var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

}
return TimestampSecond;
return (0, _createClass2.default)(TimestampSecond);
}(Timestamp);
exports.TimestampSecond = TimestampSecond;
var TimestampMillisecond = function (_Timestamp2) {
(0, _inherits2.default)(TimestampMillisecond, _Timestamp2);
var _super26 = _createSuper(TimestampMillisecond);
function TimestampMillisecond() {

@@ -781,13 +645,8 @@ var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

}
return TimestampMillisecond;
return (0, _createClass2.default)(TimestampMillisecond);
}(Timestamp);
exports.TimestampMillisecond = TimestampMillisecond;
var TimestampMicrosecond = function (_Timestamp3) {
(0, _inherits2.default)(TimestampMicrosecond, _Timestamp3);
var _super27 = _createSuper(TimestampMicrosecond);
function TimestampMicrosecond() {

@@ -798,13 +657,8 @@ var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

}
return TimestampMicrosecond;
return (0, _createClass2.default)(TimestampMicrosecond);
}(Timestamp);
exports.TimestampMicrosecond = TimestampMicrosecond;
var TimestampNanosecond = function (_Timestamp4) {
(0, _inherits2.default)(TimestampNanosecond, _Timestamp4);
var _super28 = _createSuper(TimestampNanosecond);
function TimestampNanosecond() {

@@ -815,6 +669,4 @@ var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

}
return TimestampNanosecond;
return (0, _createClass2.default)(TimestampNanosecond);
}(Timestamp);
exports.TimestampNanosecond = TimestampNanosecond;

@@ -825,12 +677,8 @@ var IntervalUnit = {

};
_Symbol$toStringTag6 = Symbol.toStringTag;
_Symbol$toStringTag10 = Symbol.toStringTag;
var Interval = function (_DataType10) {
(0, _inherits2.default)(Interval, _DataType10);
var _super29 = _createSuper(Interval);
function Interval(unit) {
var _this6;
(0, _classCallCheck2.default)(this, Interval);

@@ -842,3 +690,2 @@ _this6 = _super29.call(this);

}
(0, _createClass2.default)(Interval, [{

@@ -850,4 +697,5 @@ key: "typeId",

}, {
key: _Symbol$toStringTag6,
get: function get() {
key: _Symbol$toStringTag10,
get:
function get() {
return 'Interval';

@@ -863,10 +711,6 @@ }

}(DataType);
exports.Interval = Interval;
var IntervalDayTime = function (_Interval) {
(0, _inherits2.default)(IntervalDayTime, _Interval);
var _super30 = _createSuper(IntervalDayTime);
function IntervalDayTime() {

@@ -876,13 +720,8 @@ (0, _classCallCheck2.default)(this, IntervalDayTime);

}
return IntervalDayTime;
return (0, _createClass2.default)(IntervalDayTime);
}(Interval);
exports.IntervalDayTime = IntervalDayTime;
var IntervalYearMonth = function (_Interval2) {
(0, _inherits2.default)(IntervalYearMonth, _Interval2);
var _super31 = _createSuper(IntervalYearMonth);
function IntervalYearMonth() {

@@ -892,17 +731,11 @@ (0, _classCallCheck2.default)(this, IntervalYearMonth);

}
return IntervalYearMonth;
return (0, _createClass2.default)(IntervalYearMonth);
}(Interval);
exports.IntervalYearMonth = IntervalYearMonth;
_Symbol$toStringTag7 = Symbol.toStringTag;
_Symbol$toStringTag11 = Symbol.toStringTag;
var FixedSizeList = function (_DataType11) {
(0, _inherits2.default)(FixedSizeList, _DataType11);
var _super32 = _createSuper(FixedSizeList);
function FixedSizeList(listSize, child) {
var _this7;
(0, _classCallCheck2.default)(this, FixedSizeList);

@@ -916,3 +749,2 @@ _this7 = _super32.call(this);

}
(0, _createClass2.default)(FixedSizeList, [{

@@ -934,4 +766,5 @@ key: "typeId",

}, {
key: _Symbol$toStringTag7,
get: function get() {
key: _Symbol$toStringTag11,
get:
function get() {
return 'FixedSizeList';

@@ -947,14 +780,9 @@ }

}(DataType);
exports.FixedSizeList = FixedSizeList;
_Symbol$toStringTag8 = Symbol.toStringTag;
_Symbol$toStringTag12 = Symbol.toStringTag;
var Struct = function (_DataType12) {
(0, _inherits2.default)(Struct, _DataType12);
var _super33 = _createSuper(Struct);
function Struct(children) {
var _this8;
(0, _classCallCheck2.default)(this, Struct);

@@ -966,3 +794,2 @@ _this8 = _super33.call(this);

}
(0, _createClass2.default)(Struct, [{

@@ -981,3 +808,3 @@ key: "typeId",

}, {
key: _Symbol$toStringTag8,
key: _Symbol$toStringTag12,
get: function get() {

@@ -989,4 +816,3 @@ return 'Struct';

}(DataType);
exports.Struct = Struct;
//# sourceMappingURL=type.js.map
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Schema", {
Object.defineProperty(exports, "Binary", {
enumerable: true,
get: function get() {
return _schema.default;
return _type.Binary;
}
});
Object.defineProperty(exports, "Field", {
Object.defineProperty(exports, "Bool", {
enumerable: true,
get: function get() {
return _field.default;
return _type.Bool;
}
});
Object.defineProperty(exports, "Type", {
enumerable: true,
get: function get() {
return _type.Type;
}
});
Object.defineProperty(exports, "DataType", {

@@ -32,120 +25,120 @@ enumerable: true,

});
Object.defineProperty(exports, "Null", {
Object.defineProperty(exports, "Date", {
enumerable: true,
get: function get() {
return _type.Null;
return _type.Date;
}
});
Object.defineProperty(exports, "Bool", {
Object.defineProperty(exports, "DateDay", {
enumerable: true,
get: function get() {
return _type.Bool;
return _type.DateDay;
}
});
Object.defineProperty(exports, "Int", {
Object.defineProperty(exports, "DateMillisecond", {
enumerable: true,
get: function get() {
return _type.Int;
return _type.DateMillisecond;
}
});
Object.defineProperty(exports, "Int8", {
Object.defineProperty(exports, "Field", {
enumerable: true,
get: function get() {
return _type.Int8;
return _field.default;
}
});
Object.defineProperty(exports, "Int16", {
Object.defineProperty(exports, "FixedSizeList", {
enumerable: true,
get: function get() {
return _type.Int16;
return _type.FixedSizeList;
}
});
Object.defineProperty(exports, "Int32", {
Object.defineProperty(exports, "Float", {
enumerable: true,
get: function get() {
return _type.Int32;
return _type.Float;
}
});
Object.defineProperty(exports, "Int64", {
Object.defineProperty(exports, "Float16", {
enumerable: true,
get: function get() {
return _type.Int64;
return _type.Float16;
}
});
Object.defineProperty(exports, "Uint8", {
Object.defineProperty(exports, "Float32", {
enumerable: true,
get: function get() {
return _type.Uint8;
return _type.Float32;
}
});
Object.defineProperty(exports, "Uint16", {
Object.defineProperty(exports, "Float64", {
enumerable: true,
get: function get() {
return _type.Uint16;
return _type.Float64;
}
});
Object.defineProperty(exports, "Uint32", {
Object.defineProperty(exports, "Int", {
enumerable: true,
get: function get() {
return _type.Uint32;
return _type.Int;
}
});
Object.defineProperty(exports, "Uint64", {
Object.defineProperty(exports, "Int16", {
enumerable: true,
get: function get() {
return _type.Uint64;
return _type.Int16;
}
});
Object.defineProperty(exports, "Float", {
Object.defineProperty(exports, "Int32", {
enumerable: true,
get: function get() {
return _type.Float;
return _type.Int32;
}
});
Object.defineProperty(exports, "Float16", {
Object.defineProperty(exports, "Int64", {
enumerable: true,
get: function get() {
return _type.Float16;
return _type.Int64;
}
});
Object.defineProperty(exports, "Float32", {
Object.defineProperty(exports, "Int8", {
enumerable: true,
get: function get() {
return _type.Float32;
return _type.Int8;
}
});
Object.defineProperty(exports, "Float64", {
Object.defineProperty(exports, "Interval", {
enumerable: true,
get: function get() {
return _type.Float64;
return _type.Interval;
}
});
Object.defineProperty(exports, "Binary", {
Object.defineProperty(exports, "IntervalDayTime", {
enumerable: true,
get: function get() {
return _type.Binary;
return _type.IntervalDayTime;
}
});
Object.defineProperty(exports, "Utf8", {
Object.defineProperty(exports, "IntervalYearMonth", {
enumerable: true,
get: function get() {
return _type.Utf8;
return _type.IntervalYearMonth;
}
});
Object.defineProperty(exports, "Date", {
Object.defineProperty(exports, "Null", {
enumerable: true,
get: function get() {
return _type.Date;
return _type.Null;
}
});
Object.defineProperty(exports, "DateDay", {
Object.defineProperty(exports, "Schema", {
enumerable: true,
get: function get() {
return _type.DateDay;
return _schema.default;
}
});
Object.defineProperty(exports, "DateMillisecond", {
Object.defineProperty(exports, "Struct", {
enumerable: true,
get: function get() {
return _type.DateMillisecond;
return _type.Struct;
}

@@ -159,12 +152,12 @@ });

});
Object.defineProperty(exports, "TimeSecond", {
Object.defineProperty(exports, "TimeMillisecond", {
enumerable: true,
get: function get() {
return _type.TimeSecond;
return _type.TimeMillisecond;
}
});
Object.defineProperty(exports, "TimeMillisecond", {
Object.defineProperty(exports, "TimeSecond", {
enumerable: true,
get: function get() {
return _type.TimeMillisecond;
return _type.TimeSecond;
}

@@ -178,6 +171,6 @@ });

});
Object.defineProperty(exports, "TimestampSecond", {
Object.defineProperty(exports, "TimestampMicrosecond", {
enumerable: true,
get: function get() {
return _type.TimestampSecond;
return _type.TimestampMicrosecond;
}

@@ -191,50 +184,53 @@ });

});
Object.defineProperty(exports, "TimestampMicrosecond", {
Object.defineProperty(exports, "TimestampNanosecond", {
enumerable: true,
get: function get() {
return _type.TimestampMicrosecond;
return _type.TimestampNanosecond;
}
});
Object.defineProperty(exports, "TimestampNanosecond", {
Object.defineProperty(exports, "TimestampSecond", {
enumerable: true,
get: function get() {
return _type.TimestampNanosecond;
return _type.TimestampSecond;
}
});
Object.defineProperty(exports, "Interval", {
Object.defineProperty(exports, "Type", {
enumerable: true,
get: function get() {
return _type.Interval;
return _type.Type;
}
});
Object.defineProperty(exports, "IntervalDayTime", {
Object.defineProperty(exports, "Uint16", {
enumerable: true,
get: function get() {
return _type.IntervalDayTime;
return _type.Uint16;
}
});
Object.defineProperty(exports, "IntervalYearMonth", {
Object.defineProperty(exports, "Uint32", {
enumerable: true,
get: function get() {
return _type.IntervalYearMonth;
return _type.Uint32;
}
});
Object.defineProperty(exports, "FixedSizeList", {
Object.defineProperty(exports, "Uint64", {
enumerable: true,
get: function get() {
return _type.FixedSizeList;
return _type.Uint64;
}
});
Object.defineProperty(exports, "Struct", {
Object.defineProperty(exports, "Uint8", {
enumerable: true,
get: function get() {
return _type.Struct;
return _type.Uint8;
}
});
Object.defineProperty(exports, "Utf8", {
enumerable: true,
get: function get() {
return _type.Utf8;
}
});
var _schema = _interopRequireDefault(require("./impl/schema"));
var _field = _interopRequireDefault(require("./impl/field"));
var _type = require("./impl/type");
//# sourceMappingURL=schema.js.map

@@ -7,3 +7,2 @@ "use strict";

exports.assert = assert;
function assert(condition, message) {

@@ -10,0 +9,0 @@ if (!condition) {

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.takeAsync = takeAsync;
exports.default = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
var _Symbol$asyncIterator;
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var ArrayQueue = function (_Array) {
(0, _inherits2.default)(ArrayQueue, _Array);
var _super = _createSuper(ArrayQueue);
function ArrayQueue() {

@@ -44,3 +28,2 @@ (0, _classCallCheck2.default)(this, ArrayQueue);

}
(0, _createClass2.default)(ArrayQueue, [{

@@ -59,5 +42,3 @@ key: "enqueue",

}((0, _wrapNativeSuper2.default)(Array));
_Symbol$asyncIterator = Symbol.asyncIterator;
var AsyncQueue = function () {

@@ -73,3 +54,2 @@ function AsyncQueue() {

}
(0, _createClass2.default)(AsyncQueue, [{

@@ -83,3 +63,2 @@ key: "close",

}
this._closed = true;

@@ -98,3 +77,2 @@ }

}
if (this._settlers.length > 0) {

@@ -104,5 +82,3 @@ if (this._values.length > 0) {

}
var settler = this._settlers.dequeue();
if (value instanceof Error) {

@@ -119,14 +95,13 @@ settler.reject(value);

}
}, {
key: "next",
value: function next() {
value:
function next() {
var _this = this;
if (this._values.length > 0) {
var _value = this._values.dequeue();
if (_value instanceof Error) {
return Promise.reject(_value);
}
return Promise.resolve({

@@ -136,3 +111,2 @@ value: _value

}
if (this._closed) {

@@ -142,3 +116,2 @@ if (this._settlers.length > 0) {

}
return Promise.resolve({

@@ -148,3 +121,2 @@ done: true

}
return new Promise(function (resolve, reject) {

@@ -160,19 +132,15 @@ _this._settlers.enqueue({

}();
exports.default = AsyncQueue;
function takeAsync(_x) {
return _takeAsync.apply(this, arguments);
}
function _takeAsync() {
_takeAsync = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(asyncIterable) {
var count,
result,
iterator,
_yield$iterator$next,
_value2,
done,
_args = arguments;
result,
iterator,
_yield$iterator$next,
_value2,
done,
_args = arguments;
return _regenerator.default.wrap(function _callee$(_context) {

@@ -185,3 +153,2 @@ while (1) {

iterator = asyncIterable[Symbol.asyncIterator]();
case 3:

@@ -192,6 +159,4 @@ if (!(result.length < count)) {

}
_context.next = 6;
return iterator.next();
case 6:

@@ -201,3 +166,2 @@ _yield$iterator$next = _context.sent;

done = _yield$iterator$next.done;
if (!done) {

@@ -207,5 +171,3 @@ _context.next = 11;

}
return _context.abrupt("break", 14);
case 11:

@@ -215,6 +177,4 @@ result.push(_value2);

break;
case 14:
return _context.abrupt("return", result);
case 15:

@@ -221,0 +181,0 @@ case "end":

@@ -6,5 +6,4 @@ "use strict";

});
exports.convertToArrayRow = convertToArrayRow;
exports.convertToObjectRow = convertToObjectRow;
exports.convertToArrayRow = convertToArrayRow;
function convertToObjectRow(arrayRow, headers) {

@@ -14,13 +13,9 @@ if (!arrayRow) {

}
if (!headers) {
throw new Error('no headers');
}
var objectRow = {};
for (var i = 0; i < headers.length; i++) {
objectRow[headers[i]] = arrayRow[i];
}
return objectRow;

@@ -33,15 +28,11 @@ }

}
if (!headers) {
throw new Error('no headers');
}
var arrayRow = new Array(headers.length);
for (var i = 0; i < headers.length; i++) {
arrayRow[i] = objectRow[headers[i]];
}
return arrayRow;
}
//# sourceMappingURL=row-utils.js.map

@@ -0,5 +1,5 @@

const moduleExports = require('./index');
globalThis.loaders = globalThis.loaders || {};
module.exports = Object.assign(globalThis.loaders, moduleExports);
//# sourceMappingURL=bundle.js.map

@@ -6,6 +6,4 @@ import { convertMeshToArrowTable } from './mesh-to-arrow-table';

return mesh;
case 'columnar-table':
return convertMeshToColumnarTable(mesh);
case 'arrow-table':

@@ -16,3 +14,2 @@ return {

};
default:

@@ -22,9 +19,8 @@ throw new Error("Unsupported shape ".concat(options === null || options === void 0 ? void 0 : options.shape));

}
export function convertMeshToColumnarTable(mesh) {
const columns = {};
for (const [columnName, attribute] of Object.entries(mesh.attributes)) {
columns[columnName] = attribute.value;
}
return {

@@ -31,0 +27,0 @@ shape: 'columnar-table',

import { Schema, Field, FixedSizeList } from '../../lib/schema/schema';
import { getArrowTypeFromTypedArray } from '../../lib/arrow/arrow-like-type-utils';
export function deduceMeshSchema(attributes, metadata) {

@@ -7,2 +8,3 @@ const fields = deduceMeshFields(attributes);

}
export function deduceMeshField(attributeName, attribute, optionalMetadata) {

@@ -17,3 +19,2 @@ const type = getArrowTypeFromTypedArray(attribute.value);

const fields = [];
for (const attributeName in attributes) {

@@ -23,3 +24,2 @@ const attribute = attributes[attributeName];

}
return fields;

@@ -30,17 +30,13 @@ }

const result = new Map();
if ('byteOffset' in attribute) {
result.set('byteOffset', attribute.byteOffset.toString(10));
}
if ('byteStride' in attribute) {
result.set('byteStride', attribute.byteStride.toString(10));
}
if ('normalized' in attribute) {
result.set('normalized', attribute.normalized.toString());
}
return result;
}
//# sourceMappingURL=deduce-mesh-schema.js.map
import { Table, Schema, RecordBatch, FixedSizeList, Field, Data, FixedSizeListVector } from 'apache-arrow/Arrow.dom';
import { getArrowType, getArrowVector } from '../../lib/arrow/arrow-type-utils';
import { makeMeshAttributeMetadata } from './deduce-mesh-schema';
export function convertMeshToArrowTable(mesh, batchSize) {
var _mesh$schema;
const vectors = [];
const fields = [];
for (const attributeKey in mesh.attributes) {

@@ -25,3 +24,2 @@ const attribute = mesh.attributes[attributeKey];

}
const schema = new Schema(fields, (mesh === null || mesh === void 0 ? void 0 : (_mesh$schema = mesh.schema) === null || _mesh$schema === void 0 ? void 0 : _mesh$schema.metadata) || new Map());

@@ -28,0 +26,0 @@ const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);

@@ -0,7 +1,7 @@

export function getMeshSize(attributes) {
let size = 0;
for (const attributeName in attributes) {
const attribute = attributes[attributeName];
if (ArrayBuffer.isView(attribute)) {

@@ -11,5 +11,5 @@ size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;

}
return size;
}
export function getMeshBoundingBox(attributes) {

@@ -24,3 +24,2 @@ let minX = Infinity;

const len = positions && positions.length;
for (let i = 0; i < len; i += 3) {

@@ -37,5 +36,4 @@ const x = positions[i];

}
return [[minX, minY, minZ], [maxX, maxY, maxZ]];
}
//# sourceMappingURL=mesh-utils.js.map

@@ -0,1 +1,3 @@

export function deduceTableSchema(table, schema) {

@@ -5,9 +7,6 @@ const deducedSchema = Array.isArray(table) ? deduceSchemaForRowTable(table) : deduceSchemaForColumnarTable(table);

}
function deduceSchemaForColumnarTable(columnarTable) {
const schema = {};
for (const field in columnarTable) {
const column = columnarTable[field];
if (ArrayBuffer.isView(column)) {

@@ -19,15 +18,10 @@ schema[field] = column.constructor;

}
schema[field] = schema[field] || null;
}
return schema;
}
function deduceSchemaForRowTable(rowTable) {
const schema = {};
if (rowTable.length) {
const row = rowTable[0];
for (const field in row) {

@@ -38,6 +32,4 @@ const value = row[field];

}
return schema;
}
function deduceTypeFromValue(value) {

@@ -51,5 +43,4 @@ if (value instanceof Date) {

}
return null;
}
//# sourceMappingURL=deduce-table-schema.js.map

@@ -0,1 +1,3 @@

export { default as TableBatchBuilder } from './lib/batches/table-batch-builder';

@@ -5,5 +7,8 @@ export { default as RowTableBatchAggregator } from './lib/batches/row-table-batch-aggregator';

export { convertToObjectRow, convertToArrayRow } from './lib/utils/row-utils';
export { getMeshSize, getMeshBoundingBox } from './category/mesh/mesh-utils';
export { deduceMeshSchema, deduceMeshField, makeMeshAttributeMetadata } from './category/mesh/deduce-mesh-schema';
export { Schema, Field, DataType, Null, Binary, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Date, DateDay, DateMillisecond, Time, TimeMillisecond, TimeSecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './lib/schema/schema';
export { deduceTypeFromColumn, deduceTypeFromValue } from './lib/schema-utils/deduce-column-type';

@@ -10,0 +15,0 @@ export { getTypeInfo } from './lib/arrow/get-type-info';

@@ -6,24 +6,16 @@ import { Float32, Float64, Int16, Int32, Int8, Uint16, Uint32, Uint8 } from '../schema/schema';

return new Int8();
case Uint8Array:
return new Uint8();
case Int16Array:
return new Int16();
case Uint16Array:
return new Uint16();
case Int32Array:
return new Int32();
case Uint32Array:
return new Uint32();
case Float32Array:
return new Float32();
case Float64Array:
return new Float64();
default:

@@ -30,0 +22,0 @@ throw new Error('array type not supported');

@@ -6,24 +6,16 @@ import { Float32, Float64, Int16, Int32, Int8, Uint16, Uint32, Uint8, Int8Vector, Uint8Vector, Int16Vector, Uint16Vector, Int32Vector, Uint32Vector, Float32Vector, Float64Vector } from 'apache-arrow/Arrow.dom';

return new Int8();
case Uint8Array:
return new Uint8();
case Int16Array:
return new Int16();
case Uint16Array:
return new Uint16();
case Int32Array:
return new Int32();
case Uint32Array:
return new Uint32();
case Float32Array:
return new Float32();
case Float64Array:
return new Float64();
default:

@@ -37,24 +29,16 @@ throw new Error('array type not supported');

return Int8Vector.from(array);
case Uint8Array:
return Uint8Vector.from(array);
case Int16Array:
return Int16Vector.from(array);
case Uint16Array:
return Uint16Vector.from(array);
case Int32Array:
return Int32Vector.from(array);
case Uint32Array:
return Uint32Vector.from(array);
case Float32Array:
return Float32Vector.from(array);
case Float64Array:
return Float64Vector.from(array);
default:

@@ -61,0 +45,0 @@ throw new Error('array type not supported');

@@ -12,7 +12,5 @@ import { Type } from '../schema/schema';

let ReverseType = null;
function getTypeKey(typeKey) {
if (!ReverseType) {
ReverseType = {};
for (const key in Type) {

@@ -22,5 +20,4 @@ ReverseType[Type[key]] = key;

}
return ReverseType[typeKey];
}
//# sourceMappingURL=get-type-info.js.map

@@ -6,13 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

_defineProperty(this, "schema", void 0);
_defineProperty(this, "options", void 0);
_defineProperty(this, "length", 0);
_defineProperty(this, "rows", null);
_defineProperty(this, "cursor", 0);
_defineProperty(this, "_headers", []);
this.options = options;

@@ -23,3 +17,2 @@ this.schema = schema;

this._headers = [];
for (const key in schema) {

@@ -30,7 +23,5 @@ this._headers[schema[key].index] = schema[key].name;

}
rowCount() {
return this.length;
}
addArrayRow(row, cursor) {

@@ -40,3 +31,2 @@ if (Number.isFinite(cursor)) {

}
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);

@@ -46,3 +36,2 @@ this.rows[this.length] = row;

}
addObjectRow(row, cursor) {

@@ -52,3 +41,2 @@ if (Number.isFinite(cursor)) {

}
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);

@@ -58,10 +46,7 @@ this.rows[this.length] = row;

}
getBatch() {
let rows = this.rows;
if (!rows) {
return null;
}
rows = rows.slice(0, this.length);

@@ -79,4 +64,3 @@ this.rows = null;

}
}
//# sourceMappingURL=base-table-batch-aggregator.js.map

@@ -6,43 +6,28 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

_defineProperty(this, "schema", void 0);
_defineProperty(this, "length", 0);
_defineProperty(this, "allocated", 0);
_defineProperty(this, "columns", {});
this.schema = schema;
this._reallocateColumns();
}
rowCount() {
return this.length;
}
addArrayRow(row) {
this._reallocateColumns();
let i = 0;
for (const fieldName in this.columns) {
this.columns[fieldName][this.length] = row[i++];
}
this.length++;
}
addObjectRow(row) {
this._reallocateColumns();
for (const fieldName in row) {
this.columns[fieldName][this.length] = row[fieldName];
}
this.length++;
}
getBatch() {
this._pruneColumns();
const columns = Array.isArray(this.schema) ? this.columns : {};

@@ -56,3 +41,2 @@

}
this.columns = {};

@@ -76,3 +60,2 @@ const batch = {

this.columns = {};
for (const fieldName in this.schema) {

@@ -82,3 +65,2 @@ const field = this.schema[fieldName];

const oldColumn = this.columns[field.index];
if (oldColumn && ArrayBuffer.isView(oldColumn)) {

@@ -96,3 +78,2 @@ const typedArray = new ArrayType(this.allocated);

}
_pruneColumns() {

@@ -103,4 +84,3 @@ for (const [columnName, column] of Object.entries(this.columns)) {

}
}
//# sourceMappingURL=columnar-table-batch-aggregator.js.map

@@ -7,15 +7,8 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

_defineProperty(this, "schema", void 0);
_defineProperty(this, "options", void 0);
_defineProperty(this, "length", 0);
_defineProperty(this, "objectRows", null);
_defineProperty(this, "arrayRows", null);
_defineProperty(this, "cursor", 0);
_defineProperty(this, "_headers", []);
this.options = options;

@@ -26,3 +19,2 @@ this.schema = schema;

this._headers = [];
for (const key in schema) {

@@ -33,7 +25,5 @@ this._headers[schema[key].index] = schema[key].name;

}
rowCount() {
return this.length;
}
addArrayRow(row, cursor) {

@@ -49,3 +39,2 @@ if (Number.isFinite(cursor)) {

break;
case 'array-row-table':

@@ -58,3 +47,2 @@ this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);

}
addObjectRow(row, cursor) {

@@ -70,3 +58,2 @@ if (Number.isFinite(cursor)) {

break;
case 'object-row-table':

@@ -79,10 +66,7 @@ this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);

}
getBatch() {
let rows = this.arrayRows || this.objectRows;
if (!rows) {
return null;
}
rows = rows.slice(0, this.length);

@@ -100,4 +84,3 @@ this.arrayRows = null;

}
}
//# sourceMappingURL=row-table-batch-aggregator.js.map

@@ -5,2 +5,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import ColumnarTableBatchAggregator from './columnar-table-batch-aggregator';
const DEFAULT_OPTIONS = {

@@ -14,41 +15,29 @@ shape: 'array-row-table',

const ERR_MESSAGE = 'TableBatchBuilder';
export default class TableBatchBuilder {
constructor(schema, options) {
_defineProperty(this, "schema", void 0);
_defineProperty(this, "options", void 0);
_defineProperty(this, "aggregator", null);
_defineProperty(this, "batchCount", 0);
_defineProperty(this, "bytesUsed", 0);
_defineProperty(this, "isChunkComplete", false);
_defineProperty(this, "lastBatchEmittedMs", Date.now());
_defineProperty(this, "totalLength", 0);
_defineProperty(this, "totalBytes", 0);
_defineProperty(this, "rowBytes", 0);
this.schema = schema;
this.options = { ...DEFAULT_OPTIONS,
this.options = {
...DEFAULT_OPTIONS,
...options
};
}
limitReached() {
var _this$options, _this$options2;
if (Boolean((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.limit) && this.totalLength >= this.options.limit) {
return true;
}
if (Boolean((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
return true;
}
return false;

@@ -61,7 +50,5 @@ }

}
this.totalLength++;
this.rowBytes = this.rowBytes || this._estimateRowMB(row);
this.totalBytes += this.rowBytes;
if (Array.isArray(row)) {

@@ -77,6 +64,4 @@ this.addArrayRow(row);

const TableBatchType = this._getTableBatchType();
this.aggregator = new TableBatchType(this.schema, this.options);
}
this.aggregator.addArrayRow(row);

@@ -88,6 +73,4 @@ }

const TableBatchType = this._getTableBatchType();
this.aggregator = new TableBatchType(this.schema, this.options);
}
this.aggregator.addObjectRow(row);

@@ -100,14 +83,10 @@ }

}
if (typeof chunk === 'string') {
this.bytesUsed += chunk.length;
}
this.isChunkComplete = true;
}
getFullBatch(options) {
return this._isFull() ? this._getBatch(options) : null;
}
getFinalBatch(options) {

@@ -120,3 +99,2 @@ return this._getBatch(options);

}
_isFull() {

@@ -152,3 +130,2 @@ if (!this.aggregator || this.aggregator.rowCount() === 0) {

}
const normalizedBatch = this.aggregator.getBatch();

@@ -162,3 +139,2 @@ normalizedBatch.count = this.batchCount;

}
_getTableBatchType() {

@@ -168,10 +144,7 @@ switch (this.options.shape) {

return BaseTableBatchAggregator;
case 'array-row-table':
case 'object-row-table':
return RowTableBatchAggregator;
case 'columnar-table':
return ColumnarTableBatchAggregator;
case 'arrow-table':

@@ -181,5 +154,3 @@ if (!TableBatchBuilder.ArrowBatch) {

}
return TableBatchBuilder.ArrowBatch;
default:

@@ -189,6 +160,4 @@ throw new Error(ERR_MESSAGE);

}
}
_defineProperty(TableBatchBuilder, "ArrowBatch", void 0);
//# sourceMappingURL=table-batch-builder.js.map

@@ -0,1 +1,3 @@

export function deduceTypeFromColumn(value) {

@@ -9,3 +11,2 @@ if (value instanceof Date) {

}
return null;

@@ -21,5 +22,4 @@ }

}
return null;
}
//# sourceMappingURL=deduce-column-type.js.map

@@ -0,3 +1,4 @@

export let Type;
(function (Type) {

@@ -4,0 +5,0 @@ Type[Type["NONE"] = 0] = "NONE";

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
export default class Field {
constructor(name, type, nullable = false, metadata = new Map()) {
constructor(name, type) {
let nullable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
let metadata = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new Map();
_defineProperty(this, "name", void 0);
_defineProperty(this, "type", void 0);
_defineProperty(this, "nullable", void 0);
_defineProperty(this, "metadata", void 0);
this.name = name;

@@ -17,20 +15,15 @@ this.type = type;

}
get typeId() {
return this.type && this.type.typeId;
}
clone() {
return new Field(this.name, this.type, this.nullable, this.metadata);
}
compareTo(other) {
return this.name === other.name && this.type === other.type && this.nullable === other.nullable && this.metadata === other.metadata;
}
toString() {
return "".concat(this.type).concat(this.nullable ? ', nullable' : '').concat(this.metadata ? ", metadata: ".concat(this.metadata) : '');
}
}
//# sourceMappingURL=field.js.map
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { assert } from '../../utils/assert';
export default class Schema {
constructor(fields, metadata) {
_defineProperty(this, "fields", void 0);
_defineProperty(this, "metadata", void 0);
assert(Array.isArray(fields));

@@ -19,7 +18,5 @@ checkNames(fields);

}
if (this.fields.length !== other.fields.length) {
return false;
}
for (let i = 0; i < this.fields.length; ++i) {

@@ -30,26 +27,25 @@ if (!this.fields[i].compareTo(other.fields[i])) {

}
return true;
}
select(...columnNames) {
select() {
const nameMap = Object.create(null);
for (var _len = arguments.length, columnNames = new Array(_len), _key = 0; _key < _len; _key++) {
columnNames[_key] = arguments[_key];
}
for (const name of columnNames) {
nameMap[name] = true;
}
const selectedFields = this.fields.filter(field => nameMap[field.name]);
return new Schema(selectedFields, this.metadata);
}
selectAt(...columnIndices) {
selectAt() {
for (var _len2 = arguments.length, columnIndices = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
columnIndices[_key2] = arguments[_key2];
}
const selectedFields = columnIndices.map(index => this.fields[index]).filter(Boolean);
return new Schema(selectedFields, this.metadata);
}
assign(schemaOrFields) {
let fields;
let metadata = this.metadata;
if (schemaOrFields instanceof Schema) {

@@ -64,15 +60,11 @@ const otherSchema = schemaOrFields;

const fieldMap = Object.create(null);
for (const field of this.fields) {
fieldMap[field.name] = field;
}
for (const field of fields) {
fieldMap[field.name] = field;
}
const mergedFields = Object.values(fieldMap);
return new Schema(mergedFields, metadata);
}
}

@@ -82,3 +74,2 @@

const usedNames = {};
for (const field of fields) {

@@ -88,7 +79,5 @@ if (usedNames[field.name]) {

}
usedNames[field.name] = true;
}
}
function mergeMaps(m1, m2) {

@@ -95,0 +84,0 @@ return new Map([...(m1 || new Map()), ...(m2 || new Map())]);

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
let _Symbol$toStringTag, _Symbol$toStringTag2, _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag5, _Symbol$toStringTag6, _Symbol$toStringTag7, _Symbol$toStringTag8;

@@ -11,71 +10,53 @@

}
static isInt(x) {
return x && x.typeId === Type.Int;
}
static isFloat(x) {
return x && x.typeId === Type.Float;
}
static isBinary(x) {
return x && x.typeId === Type.Binary;
}
static isUtf8(x) {
return x && x.typeId === Type.Utf8;
}
static isBool(x) {
return x && x.typeId === Type.Bool;
}
static isDecimal(x) {
return x && x.typeId === Type.Decimal;
}
static isDate(x) {
return x && x.typeId === Type.Date;
}
static isTime(x) {
return x && x.typeId === Type.Time;
}
static isTimestamp(x) {
return x && x.typeId === Type.Timestamp;
}
static isInterval(x) {
return x && x.typeId === Type.Interval;
}
static isList(x) {
return x && x.typeId === Type.List;
}
static isStruct(x) {
return x && x.typeId === Type.Struct;
}
static isUnion(x) {
return x && x.typeId === Type.Union;
}
static isFixedSizeBinary(x) {
return x && x.typeId === Type.FixedSizeBinary;
}
static isFixedSizeList(x) {
return x && x.typeId === Type.FixedSizeList;
}
static isMap(x) {
return x && x.typeId === Type.Map;
}
static isDictionary(x) {
return x && x.typeId === Type.Dictionary;
}
get typeId() {

@@ -88,4 +69,4 @@ return Type.NONE;

}
}
}
export class Null extends DataType {

@@ -95,12 +76,10 @@ get typeId() {

}
get [Symbol.toStringTag]() {
return 'Null';
}
toString() {
return 'Null';
}
}
}
export class Bool extends DataType {

@@ -110,37 +89,29 @@ get typeId() {

}
get [Symbol.toStringTag]() {
return 'Bool';
}
toString() {
return 'Bool';
}
}
}
_Symbol$toStringTag = Symbol.toStringTag;
export class Int extends DataType {
constructor(isSigned, bitWidth) {
super();
_defineProperty(this, "isSigned", void 0);
_defineProperty(this, "bitWidth", void 0);
this.isSigned = isSigned;
this.bitWidth = bitWidth;
}
get typeId() {
return Type.Int;
}
get [_Symbol$toStringTag]() {
return 'Int';
}
toString() {
return "".concat(this.isSigned ? 'I' : 'Ui', "nt").concat(this.bitWidth);
}
}

@@ -151,3 +122,2 @@ export class Int8 extends Int {

}
}

@@ -158,3 +128,2 @@ export class Int16 extends Int {

}
}

@@ -165,3 +134,2 @@ export class Int32 extends Int {

}
}

@@ -172,3 +140,2 @@ export class Int64 extends Int {

}
}

@@ -179,3 +146,2 @@ export class Uint8 extends Int {

}
}

@@ -186,3 +152,2 @@ export class Uint16 extends Int {

}
}

@@ -193,3 +158,2 @@ export class Uint32 extends Int {

}
}

@@ -200,4 +164,4 @@ export class Uint64 extends Int {

}
}
}
const Precision = {

@@ -212,20 +176,14 @@ HALF: 16,

super();
_defineProperty(this, "precision", void 0);
this.precision = precision;
}
get typeId() {
return Type.Float;
}
get [_Symbol$toStringTag2]() {
return 'Float';
}
toString() {
return "Float".concat(this.precision);
}
}

@@ -236,3 +194,2 @@ export class Float16 extends Float {

}
}

@@ -243,3 +200,2 @@ export class Float32 extends Float {

}
}

@@ -250,3 +206,2 @@ export class Float64 extends Float {

}
}

@@ -257,16 +212,13 @@ export class Binary extends DataType {

}
get typeId() {
return Type.Binary;
}
toString() {
return 'Binary';
}
get [Symbol.toStringTag]() {
return 'Binary';
}
}
}
export class Utf8 extends DataType {

@@ -276,12 +228,10 @@ get typeId() {

}
get [Symbol.toStringTag]() {
return 'Utf8';
}
toString() {
return 'Utf8';
}
}
}
const DateUnit = {

@@ -295,20 +245,14 @@ DAY: 0,

super();
_defineProperty(this, "unit", void 0);
this.unit = unit;
}
get typeId() {
return Type.Date;
}
get [_Symbol$toStringTag3]() {
return 'Date';
}
toString() {
return "Date".concat((this.unit + 1) * 32, "<").concat(DateUnit[this.unit], ">");
}
}

@@ -319,3 +263,2 @@ export class DateDay extends Date {

}
}

@@ -326,3 +269,2 @@ export class DateMillisecond extends Date {

}
}

@@ -339,24 +281,18 @@ const TimeUnit = {

super();
_defineProperty(this, "unit", void 0);
_defineProperty(this, "bitWidth", void 0);
this.unit = unit;
this.bitWidth = bitWidth;
}
get typeId() {
return Type.Time;
}
toString() {
return "Time".concat(this.bitWidth, "<").concat(TimeUnit[this.unit], ">");
}
get [_Symbol$toStringTag4]() {
return 'Time';
}
}
}
export class TimeSecond extends Time {

@@ -366,3 +302,2 @@ constructor() {

}
}

@@ -373,53 +308,47 @@ export class TimeMillisecond extends Time {

}
}
_Symbol$toStringTag5 = Symbol.toStringTag;
export class Timestamp extends DataType {
constructor(unit, timezone = null) {
constructor(unit) {
let timezone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
super();
_defineProperty(this, "unit", void 0);
_defineProperty(this, "timezone", void 0);
this.unit = unit;
this.timezone = timezone;
}
get typeId() {
return Type.Timestamp;
}
get [_Symbol$toStringTag5]() {
return 'Timestamp';
}
toString() {
return "Timestamp<".concat(TimeUnit[this.unit]).concat(this.timezone ? ", ".concat(this.timezone) : '', ">");
}
}
export class TimestampSecond extends Timestamp {
constructor(timezone = null) {
constructor() {
let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
super(TimeUnit.SECOND, timezone);
}
}
export class TimestampMillisecond extends Timestamp {
constructor(timezone = null) {
constructor() {
let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
super(TimeUnit.MILLISECOND, timezone);
}
}
export class TimestampMicrosecond extends Timestamp {
constructor(timezone = null) {
constructor() {
let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
super(TimeUnit.MICROSECOND, timezone);
}
}
export class TimestampNanosecond extends Timestamp {
constructor(timezone = null) {
constructor() {
let timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
super(TimeUnit.NANOSECOND, timezone);
}
}

@@ -434,20 +363,14 @@ const IntervalUnit = {

super();
_defineProperty(this, "unit", void 0);
this.unit = unit;
}
get typeId() {
return Type.Interval;
}
get [_Symbol$toStringTag6]() {
return 'Interval';
}
toString() {
return "Interval<".concat(IntervalUnit[this.unit], ">");
}
}

@@ -458,3 +381,2 @@ export class IntervalDayTime extends Interval {

}
}

@@ -465,3 +387,2 @@ export class IntervalYearMonth extends Interval {

}
}

@@ -472,31 +393,22 @@ _Symbol$toStringTag7 = Symbol.toStringTag;

super();
_defineProperty(this, "listSize", void 0);
_defineProperty(this, "children", void 0);
this.listSize = listSize;
this.children = [child];
}
get typeId() {
return Type.FixedSizeList;
}
get valueType() {
return this.children[0].type;
}
get valueField() {
return this.children[0];
}
get [_Symbol$toStringTag7]() {
return 'FixedSizeList';
}
toString() {
return "FixedSizeList[".concat(this.listSize, "]<").concat(this.valueType, ">");
}
}

@@ -507,21 +419,15 @@ _Symbol$toStringTag8 = Symbol.toStringTag;

super();
_defineProperty(this, "children", void 0);
this.children = children;
}
get typeId() {
return Type.Struct;
}
toString() {
return "Struct<{".concat(this.children.map(f => "".concat(f.name, ":").concat(f.type)).join(', '), "}>");
}
get [_Symbol$toStringTag8]() {
return 'Struct';
}
}
//# sourceMappingURL=type.js.map

@@ -0,5 +1,7 @@

export { default as Schema } from './impl/schema';
export { default as Field } from './impl/field';
export { Type } from './impl/type';
export { DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Binary, Utf8, Date, DateDay, DateMillisecond, Time, TimeSecond, TimeMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './impl/type';
export { DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Binary, Utf8, Date, DateDay, DateMillisecond, Time, TimeSecond, TimeMillisecond,
Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './impl/type';
//# sourceMappingURL=schema.js.map

@@ -0,1 +1,2 @@

export function assert(condition, message) {

@@ -2,0 +3,0 @@ if (!condition) {

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
let _Symbol$asyncIterator;

@@ -9,9 +8,6 @@

}
dequeue() {
return this.shift();
}
}
_Symbol$asyncIterator = Symbol.asyncIterator;

@@ -21,7 +17,4 @@ export default class AsyncQueue {

_defineProperty(this, "_values", void 0);
_defineProperty(this, "_settlers", void 0);
_defineProperty(this, "_closed", void 0);
this._values = new ArrayQueue();

@@ -31,3 +24,2 @@ this._settlers = new ArrayQueue();

}
close() {

@@ -39,10 +31,7 @@ while (this._settlers.length > 0) {

}
this._closed = true;
}
[_Symbol$asyncIterator]() {
return this;
}
enqueue(value) {

@@ -52,3 +41,2 @@ if (this._closed) {

}
if (this._settlers.length > 0) {

@@ -58,5 +46,3 @@ if (this._values.length > 0) {

}
const settler = this._settlers.dequeue();
if (value instanceof Error) {

@@ -77,7 +63,5 @@ settler.reject(value);

const value = this._values.dequeue();
if (value instanceof Error) {
return Promise.reject(value);
}
return Promise.resolve({

@@ -87,3 +71,2 @@ value

}
if (this._closed) {

@@ -93,3 +76,2 @@ if (this._settlers.length > 0) {

}
return Promise.resolve({

@@ -99,3 +81,2 @@ done: true

}
return new Promise((resolve, reject) => {

@@ -108,8 +89,8 @@ this._settlers.enqueue({

}
}
}
export async function takeAsync(asyncIterable, count = Infinity) {
export async function takeAsync(asyncIterable) {
let count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
const result = [];
const iterator = asyncIterable[Symbol.asyncIterator]();
while (result.length < count) {

@@ -120,12 +101,9 @@ const {

} = await iterator.next();
if (done) {
break;
}
result.push(value);
}
return result;
}
//# sourceMappingURL=async-queue.js.map

@@ -0,1 +1,2 @@

export function convertToObjectRow(arrayRow, headers) {

@@ -5,15 +6,12 @@ if (!arrayRow) {

}
if (!headers) {
throw new Error('no headers');
}
const objectRow = {};
for (let i = 0; i < headers.length; i++) {
objectRow[headers[i]] = arrayRow[i];
}
return objectRow;
}
export function convertToArrayRow(objectRow, headers) {

@@ -23,15 +21,11 @@ if (!objectRow) {

}
if (!headers) {
throw new Error('no headers');
}
const arrayRow = new Array(headers.length);
for (let i = 0; i < headers.length; i++) {
arrayRow[i] = objectRow[headers[i]];
}
return arrayRow;
}
//# sourceMappingURL=row-utils.js.map
{
"name": "@loaders.gl/schema",
"version": "3.3.0-alpha.5",
"version": "3.3.0-alpha.6",
"description": "Table format APIs for JSON, CSV, etc...",

@@ -35,6 +35,5 @@ "license": "MIT",

"dependencies": {
"@types/geojson": "^7946.0.7",
"apache-arrow": "^4.0.0"
"@types/geojson": "^7946.0.7"
},
"gitHead": "d2df3bead97710c45fd2974cd51ecd7d5f7f5ea4"
"gitHead": "718a2998a26883247461ff05f01dcbef8d8c2417"
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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