@loaders.gl/schema 3.0.9 → 3.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es5/bundle.js +2 -2
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/category/mesh/mesh-utils.js +16 -16
- package/dist/es5/category/mesh/mesh-utils.js.map +1 -1
- package/dist/es5/index.js +46 -46
- package/dist/es5/lib/schema/impl/enum.js +1 -1
- package/dist/es5/lib/schema/impl/field.js +19 -32
- package/dist/es5/lib/schema/impl/field.js.map +1 -1
- package/dist/es5/lib/schema/impl/schema.js +54 -119
- package/dist/es5/lib/schema/impl/schema.js.map +1 -1
- package/dist/es5/lib/schema/impl/type.js +375 -693
- package/dist/es5/lib/schema/impl/type.js.map +1 -1
- package/dist/es5/lib/schema/index.js +36 -36
- package/dist/es5/lib/schema-utils/deduce-table-schema.js +9 -9
- package/dist/es5/lib/schema-utils/deduce-table-schema.js.map +1 -1
- package/dist/es5/lib/schema-utils/get-type-info.js +3 -3
- package/dist/es5/lib/schema-utils/get-type-info.js.map +1 -1
- package/dist/es5/lib/table/base-table-batch-aggregator.js +42 -53
- package/dist/es5/lib/table/base-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/table/columnar-table-batch-aggregator.js +71 -90
- package/dist/es5/lib/table/columnar-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/table/row-table-batch-aggregator.js +59 -70
- package/dist/es5/lib/table/row-table-batch-aggregator.js.map +1 -1
- package/dist/es5/lib/table/table-batch-builder.js +113 -133
- package/dist/es5/lib/table/table-batch-builder.js.map +1 -1
- package/dist/es5/lib/utils/async-queue.js +81 -164
- package/dist/es5/lib/utils/async-queue.js.map +1 -1
- package/dist/es5/lib/utils/row-utils.js +4 -4
- package/dist/es5/lib/utils/row-utils.js.map +1 -1
- package/dist/esm/lib/schema/impl/field.js +1 -1
- package/dist/esm/lib/schema/impl/field.js.map +1 -1
- package/dist/esm/lib/schema/impl/type.js +7 -7
- package/dist/esm/lib/schema/impl/type.js.map +1 -1
- package/package.json +2 -2
package/dist/es5/bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const moduleExports = require('./index');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const _global = typeof window === 'undefined' ? global : window;
|
|
6
6
|
|
|
7
7
|
_global.loaders = _global.loaders || {};
|
|
8
8
|
module.exports = Object.assign(_global.loaders, moduleExports);
|
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","_global","window","global","loaders","module","exports","Object","assign"],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","_global","window","global","loaders","module","exports","Object","assign"],"mappings":";;AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACA,MAAMC,OAAO,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAAzD;;AACAD,OAAO,CAACG,OAAR,GAAkBH,OAAO,CAACG,OAAR,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcP,OAAO,CAACG,OAAtB,EAA+BL,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nconst _global = typeof window === 'undefined' ? global : window;\n_global.loaders = _global.loaders || {};\nmodule.exports = Object.assign(_global.loaders, moduleExports);\n"],"file":"bundle.js"}
|
|
@@ -7,10 +7,10 @@ exports.getMeshSize = getMeshSize;
|
|
|
7
7
|
exports.getMeshBoundingBox = getMeshBoundingBox;
|
|
8
8
|
|
|
9
9
|
function getMeshSize(attributes) {
|
|
10
|
-
|
|
10
|
+
let size = 0;
|
|
11
11
|
|
|
12
|
-
for (
|
|
13
|
-
|
|
12
|
+
for (const attributeName in attributes) {
|
|
13
|
+
const attribute = attributes[attributeName];
|
|
14
14
|
|
|
15
15
|
if (ArrayBuffer.isView(attribute)) {
|
|
16
16
|
size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
|
|
@@ -21,19 +21,19 @@ function getMeshSize(attributes) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function getMeshBoundingBox(attributes) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
let minX = Infinity;
|
|
25
|
+
let minY = Infinity;
|
|
26
|
+
let minZ = Infinity;
|
|
27
|
+
let maxX = -Infinity;
|
|
28
|
+
let maxY = -Infinity;
|
|
29
|
+
let maxZ = -Infinity;
|
|
30
|
+
const positions = attributes.POSITION ? attributes.POSITION.value : [];
|
|
31
|
+
const len = positions && positions.length;
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i < len; i += 3) {
|
|
34
|
+
const x = positions[i];
|
|
35
|
+
const y = positions[i + 1];
|
|
36
|
+
const z = positions[i + 2];
|
|
37
37
|
minX = x < minX ? x : minX;
|
|
38
38
|
minY = y < minY ? y : minY;
|
|
39
39
|
minZ = z < minZ ? z : minZ;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/category/mesh/mesh-utils.ts"],"names":["getMeshSize","attributes","size","attributeName","attribute","ArrayBuffer","isView","byteLength","BYTES_PER_ELEMENT","getMeshBoundingBox","minX","Infinity","minY","minZ","maxX","maxY","maxZ","positions","POSITION","value","len","length","i","x","y","z"],"mappings":";;;;;;;;AAwBO,SAASA,WAAT,CAAqBC,UAArB,EAAsD;AAC3D,MAAIC,IAAI,GAAG,CAAX;;AACA,OAAK,
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/mesh-utils.ts"],"names":["getMeshSize","attributes","size","attributeName","attribute","ArrayBuffer","isView","byteLength","BYTES_PER_ELEMENT","getMeshBoundingBox","minX","Infinity","minY","minZ","maxX","maxY","maxZ","positions","POSITION","value","len","length","i","x","y","z"],"mappings":";;;;;;;;AAwBO,SAASA,WAAT,CAAqBC,UAArB,EAAsD;AAC3D,MAAIC,IAAI,GAAG,CAAX;;AACA,OAAK,MAAMC,aAAX,IAA4BF,UAA5B,EAAwC;AACtC,UAAMG,SAAS,GAAGH,UAAU,CAACE,aAAD,CAA5B;;AACA,QAAIE,WAAW,CAACC,MAAZ,CAAmBF,SAAnB,CAAJ,EAAmC;AAEjCF,MAAAA,IAAI,IAAIE,SAAS,CAACG,UAAV,GAAuBH,SAAS,CAACI,iBAAzC;AACD;AACF;;AACD,SAAON,IAAP;AACD;;AAQM,SAASO,kBAAT,CAA4BR,UAA5B,EAAiE;AACtE,MAAIS,IAAI,GAAGC,QAAX;AACA,MAAIC,IAAI,GAAGD,QAAX;AACA,MAAIE,IAAI,GAAGF,QAAX;AACA,MAAIG,IAAI,GAAG,CAACH,QAAZ;AACA,MAAII,IAAI,GAAG,CAACJ,QAAZ;AACA,MAAIK,IAAI,GAAG,CAACL,QAAZ;AAEA,QAAMM,SAAS,GAAGhB,UAAU,CAACiB,QAAX,GAAsBjB,UAAU,CAACiB,QAAX,CAAoBC,KAA1C,GAAkD,EAApE;AACA,QAAMC,GAAG,GAAGH,SAAS,IAAIA,SAAS,CAACI,MAAnC;;AAEA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,GAApB,EAAyBE,CAAC,IAAI,CAA9B,EAAiC;AAC/B,UAAMC,CAAC,GAAGN,SAAS,CAACK,CAAD,CAAnB;AACA,UAAME,CAAC,GAAGP,SAAS,CAACK,CAAC,GAAG,CAAL,CAAnB;AACA,UAAMG,CAAC,GAAGR,SAAS,CAACK,CAAC,GAAG,CAAL,CAAnB;AAEAZ,IAAAA,IAAI,GAAGa,CAAC,GAAGb,IAAJ,GAAWa,CAAX,GAAeb,IAAtB;AACAE,IAAAA,IAAI,GAAGY,CAAC,GAAGZ,IAAJ,GAAWY,CAAX,GAAeZ,IAAtB;AACAC,IAAAA,IAAI,GAAGY,CAAC,GAAGZ,IAAJ,GAAWY,CAAX,GAAeZ,IAAtB;AAEAC,IAAAA,IAAI,GAAGS,CAAC,GAAGT,IAAJ,GAAWS,CAAX,GAAeT,IAAtB;AACAC,IAAAA,IAAI,GAAGS,CAAC,GAAGT,IAAJ,GAAWS,CAAX,GAAeT,IAAtB;AACAC,IAAAA,IAAI,GAAGS,CAAC,GAAGT,IAAJ,GAAWS,CAAX,GAAeT,IAAtB;AACD;;AACD,SAAO,CACL,CAACN,IAAD,EAAOE,IAAP,EAAaC,IAAb,CADK,EAEL,CAACC,IAAD,EAAOC,IAAP,EAAaC,IAAb,CAFK,CAAP;AAID","sourcesContent":["// Mesh category utilities\n// TODO - move to mesh category module, or to math.gl/geometry module\nimport {TypedArray} from '../../types';\n\ntype Attribute = {\n size?: number;\n type?: number;\n normalized?: boolean;\n value: TypedArray;\n};\n\ntype TypedArrays = {[key: string]: TypedArray};\nexport type Attributes = {[key: string]: Attribute};\n\n/**\n * Holds an axis aligned bounding box\n * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)\n */\ntype BoundingBox = [[number, number, number], [number, number, number]];\n\n/**\n * Get number of vertices in mesh\n * @param attributes\n */\nexport function getMeshSize(attributes: TypedArrays): number {\n let size = 0;\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n if (ArrayBuffer.isView(attribute)) {\n // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT\n size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;\n }\n }\n return size;\n}\n\n/**\n * Get the (axis aligned) bounding box of a mesh\n * @param attributes\n * @returns array of two vectors representing the axis aligned bounding box\n */\n// eslint-disable-next-line complexity\nexport function getMeshBoundingBox(attributes: Attributes): BoundingBox {\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n\n const positions = attributes.POSITION ? attributes.POSITION.value : [];\n const len = positions && positions.length;\n\n for (let i = 0; i < len; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n minZ = z < minZ ? z : minZ;\n\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n maxZ = z > maxZ ? z : maxZ;\n }\n return [\n [minX, minY, minZ],\n [maxX, maxY, maxZ]\n ];\n}\n"],"file":"mesh-utils.js"}
|
package/dist/es5/index.js
CHANGED
|
@@ -7,277 +7,277 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
Object.defineProperty(exports, "TableBatchBuilder", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function
|
|
10
|
+
get: function () {
|
|
11
11
|
return _tableBatchBuilder.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "RowTableBatchAggregator", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function
|
|
16
|
+
get: function () {
|
|
17
17
|
return _rowTableBatchAggregator.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "ColumnarTableBatchAggregator", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function
|
|
22
|
+
get: function () {
|
|
23
23
|
return _columnarTableBatchAggregator.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "convertToObjectRow", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function
|
|
28
|
+
get: function () {
|
|
29
29
|
return _rowUtils.convertToObjectRow;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "convertToArrayRow", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function
|
|
34
|
+
get: function () {
|
|
35
35
|
return _rowUtils.convertToArrayRow;
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "getMeshSize", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function
|
|
40
|
+
get: function () {
|
|
41
41
|
return _meshUtils.getMeshSize;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "getMeshBoundingBox", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function
|
|
46
|
+
get: function () {
|
|
47
47
|
return _meshUtils.getMeshBoundingBox;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "Schema", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function
|
|
52
|
+
get: function () {
|
|
53
53
|
return _schema.Schema;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "Field", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function
|
|
58
|
+
get: function () {
|
|
59
59
|
return _schema.Field;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "DataType", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function
|
|
64
|
+
get: function () {
|
|
65
65
|
return _schema.DataType;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "Null", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function
|
|
70
|
+
get: function () {
|
|
71
71
|
return _schema.Null;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "Binary", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function
|
|
76
|
+
get: function () {
|
|
77
77
|
return _schema.Binary;
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "Bool", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function
|
|
82
|
+
get: function () {
|
|
83
83
|
return _schema.Bool;
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
Object.defineProperty(exports, "Int", {
|
|
87
87
|
enumerable: true,
|
|
88
|
-
get: function
|
|
88
|
+
get: function () {
|
|
89
89
|
return _schema.Int;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "Int8", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function
|
|
94
|
+
get: function () {
|
|
95
95
|
return _schema.Int8;
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
Object.defineProperty(exports, "Int16", {
|
|
99
99
|
enumerable: true,
|
|
100
|
-
get: function
|
|
100
|
+
get: function () {
|
|
101
101
|
return _schema.Int16;
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "Int32", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function
|
|
106
|
+
get: function () {
|
|
107
107
|
return _schema.Int32;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "Int64", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function
|
|
112
|
+
get: function () {
|
|
113
113
|
return _schema.Int64;
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "Uint8", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function
|
|
118
|
+
get: function () {
|
|
119
119
|
return _schema.Uint8;
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "Uint16", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function
|
|
124
|
+
get: function () {
|
|
125
125
|
return _schema.Uint16;
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "Uint32", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function
|
|
130
|
+
get: function () {
|
|
131
131
|
return _schema.Uint32;
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "Uint64", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function
|
|
136
|
+
get: function () {
|
|
137
137
|
return _schema.Uint64;
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "Float", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function
|
|
142
|
+
get: function () {
|
|
143
143
|
return _schema.Float;
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "Float16", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function
|
|
148
|
+
get: function () {
|
|
149
149
|
return _schema.Float16;
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "Float32", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function
|
|
154
|
+
get: function () {
|
|
155
155
|
return _schema.Float32;
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "Float64", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function
|
|
160
|
+
get: function () {
|
|
161
161
|
return _schema.Float64;
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "Utf8", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function
|
|
166
|
+
get: function () {
|
|
167
167
|
return _schema.Utf8;
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "Date", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function
|
|
172
|
+
get: function () {
|
|
173
173
|
return _schema.Date;
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "DateDay", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function
|
|
178
|
+
get: function () {
|
|
179
179
|
return _schema.DateDay;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "DateMillisecond", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function
|
|
184
|
+
get: function () {
|
|
185
185
|
return _schema.DateMillisecond;
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
Object.defineProperty(exports, "Time", {
|
|
189
189
|
enumerable: true,
|
|
190
|
-
get: function
|
|
190
|
+
get: function () {
|
|
191
191
|
return _schema.Time;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "TimeMillisecond", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function
|
|
196
|
+
get: function () {
|
|
197
197
|
return _schema.TimeMillisecond;
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
Object.defineProperty(exports, "TimeSecond", {
|
|
201
201
|
enumerable: true,
|
|
202
|
-
get: function
|
|
202
|
+
get: function () {
|
|
203
203
|
return _schema.TimeSecond;
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "Timestamp", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function
|
|
208
|
+
get: function () {
|
|
209
209
|
return _schema.Timestamp;
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
Object.defineProperty(exports, "TimestampSecond", {
|
|
213
213
|
enumerable: true,
|
|
214
|
-
get: function
|
|
214
|
+
get: function () {
|
|
215
215
|
return _schema.TimestampSecond;
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "TimestampMillisecond", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function
|
|
220
|
+
get: function () {
|
|
221
221
|
return _schema.TimestampMillisecond;
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
Object.defineProperty(exports, "TimestampMicrosecond", {
|
|
225
225
|
enumerable: true,
|
|
226
|
-
get: function
|
|
226
|
+
get: function () {
|
|
227
227
|
return _schema.TimestampMicrosecond;
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "TimestampNanosecond", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function
|
|
232
|
+
get: function () {
|
|
233
233
|
return _schema.TimestampNanosecond;
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
Object.defineProperty(exports, "Interval", {
|
|
237
237
|
enumerable: true,
|
|
238
|
-
get: function
|
|
238
|
+
get: function () {
|
|
239
239
|
return _schema.Interval;
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "IntervalDayTime", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function
|
|
244
|
+
get: function () {
|
|
245
245
|
return _schema.IntervalDayTime;
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
248
|
Object.defineProperty(exports, "IntervalYearMonth", {
|
|
249
249
|
enumerable: true,
|
|
250
|
-
get: function
|
|
250
|
+
get: function () {
|
|
251
251
|
return _schema.IntervalYearMonth;
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "FixedSizeList", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function
|
|
256
|
+
get: function () {
|
|
257
257
|
return _schema.FixedSizeList;
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
Object.defineProperty(exports, "deduceTableSchema", {
|
|
261
261
|
enumerable: true,
|
|
262
|
-
get: function
|
|
262
|
+
get: function () {
|
|
263
263
|
return _deduceTableSchema.deduceTableSchema;
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
Object.defineProperty(exports, "getTypeInfo", {
|
|
267
267
|
enumerable: true,
|
|
268
|
-
get: function
|
|
268
|
+
get: function () {
|
|
269
269
|
return _getTypeInfo.getTypeInfo;
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
Object.defineProperty(exports, "getArrowTypeFromTypedArray", {
|
|
273
273
|
enumerable: true,
|
|
274
|
-
get: function
|
|
274
|
+
get: function () {
|
|
275
275
|
return _typeUtils.getArrowTypeFromTypedArray;
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
Object.defineProperty(exports, "AsyncQueue", {
|
|
279
279
|
enumerable: true,
|
|
280
|
-
get: function
|
|
280
|
+
get: function () {
|
|
281
281
|
return _asyncQueue.default;
|
|
282
282
|
}
|
|
283
283
|
});
|
|
@@ -7,17 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var nullable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
19
|
-
var metadata = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new Map();
|
|
20
|
-
(0, _classCallCheck2.default)(this, Field);
|
|
12
|
+
class Field {
|
|
13
|
+
constructor(name, type, nullable = false, metadata = new Map()) {
|
|
21
14
|
(0, _defineProperty2.default)(this, "name", void 0);
|
|
22
15
|
(0, _defineProperty2.default)(this, "type", void 0);
|
|
23
16
|
(0, _defineProperty2.default)(this, "nullable", void 0);
|
|
@@ -28,29 +21,23 @@ var Field = function () {
|
|
|
28
21
|
this.metadata = metadata;
|
|
29
22
|
}
|
|
30
23
|
|
|
31
|
-
(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
value: function toString() {
|
|
49
|
-
return "".concat(this.type).concat(this.nullable ? ', nullable' : '').concat(this.metadata ? ", metadata: ".concat(this.metadata) : '');
|
|
50
|
-
}
|
|
51
|
-
}]);
|
|
52
|
-
return Field;
|
|
53
|
-
}();
|
|
24
|
+
get typeId() {
|
|
25
|
+
return this.type && this.type.typeId;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
clone() {
|
|
29
|
+
return new Field(this.name, this.type, this.nullable, this.metadata);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
compareTo(other) {
|
|
33
|
+
return this.name === other.name && this.type === other.type && this.nullable === other.nullable && this.metadata === other.metadata;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
toString() {
|
|
37
|
+
return "".concat(this.type).concat(this.nullable ? ', nullable' : '').concat(this.metadata ? ", metadata: ".concat(this.metadata) : '');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
54
41
|
|
|
55
42
|
exports.default = Field;
|
|
56
43
|
//# sourceMappingURL=field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/schema/impl/field.ts"],"names":["Field","name","type","nullable","metadata","Map","typeId","other"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/schema/impl/field.ts"],"names":["Field","constructor","name","type","nullable","metadata","Map","typeId","clone","compareTo","other","toString"],"mappings":";;;;;;;;;;;AAQe,MAAMA,KAAN,CAAY;AAMzBC,EAAAA,WAAW,CACTC,IADS,EAETC,IAFS,EAGTC,QAAQ,GAAG,KAHF,EAITC,QAA6B,GAAG,IAAIC,GAAJ,EAJvB,EAKT;AAAA;AAAA;AAAA;AAAA;AACA,SAAKJ,IAAL,GAAYA,IAAZ;AACA,SAAKC,IAAL,GAAYA,IAAZ;AACA,SAAKC,QAAL,GAAgBA,QAAhB;AACA,SAAKC,QAAL,GAAgBA,QAAhB;AACD;;AAES,MAANE,MAAM,GAAW;AACnB,WAAO,KAAKJ,IAAL,IAAa,KAAKA,IAAL,CAAUI,MAA9B;AACD;;AAEDC,EAAAA,KAAK,GAAU;AACb,WAAO,IAAIR,KAAJ,CAAU,KAAKE,IAAf,EAAqB,KAAKC,IAA1B,EAAgC,KAAKC,QAArC,EAA+C,KAAKC,QAApD,CAAP;AACD;;AAEDI,EAAAA,SAAS,CAACC,KAAD,EAAuB;AAC9B,WACE,KAAKR,IAAL,KAAcQ,KAAK,CAACR,IAApB,IACA,KAAKC,IAAL,KAAcO,KAAK,CAACP,IADpB,IAEA,KAAKC,QAAL,KAAkBM,KAAK,CAACN,QAFxB,IAGA,KAAKC,QAAL,KAAkBK,KAAK,CAACL,QAJ1B;AAMD;;AAEDM,EAAAA,QAAQ,GAAW;AACjB,qBAAU,KAAKR,IAAf,SAAsB,KAAKC,QAAL,GAAgB,YAAhB,GAA+B,EAArD,SACE,KAAKC,QAAL,yBAA+B,KAAKA,QAApC,IAAiD,EADnD;AAGD;;AAvCwB","sourcesContent":["import {DataType} from './type';\n\n/**\n * ArrowJS `Field` API-compatible class for row-based tables\n * https://loaders.gl/arrowjs/docs/api-reference/field\n * A field holds name, nullable, and metadata information about a table \"column\"\n * A Schema is essentially a list of fields\n */\nexport default class Field {\n name: string;\n type: DataType;\n nullable: boolean;\n metadata: Map<string, string>;\n\n constructor(\n name: string,\n type: DataType,\n nullable = false,\n metadata: Map<string, string> = new Map()\n ) {\n this.name = name;\n this.type = type;\n this.nullable = nullable;\n this.metadata = metadata;\n }\n\n get typeId(): number {\n return this.type && this.type.typeId;\n }\n\n clone(): Field {\n return new Field(this.name, this.type, this.nullable, this.metadata);\n }\n\n compareTo(other: this): boolean {\n return (\n this.name === other.name &&\n this.type === other.type &&\n this.nullable === other.nullable &&\n this.metadata === other.metadata\n );\n }\n\n toString(): string {\n return `${this.type}${this.nullable ? ', nullable' : ''}${\n this.metadata ? `, metadata: ${this.metadata}` : ''\n }`;\n }\n}\n"],"file":"field.js"}
|