@malloydata/malloy 0.0.330 → 0.0.331

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/api/util.js CHANGED
@@ -88,14 +88,12 @@ function mapData(data, schema) {
88
88
  }
89
89
  else if (field.type.kind === 'number_type') {
90
90
  const subtype = field.type.subtype;
91
- if (subtype === 'bigint') {
92
- const stringValue = (0, row_data_utils_1.rowDataToSerializedBigint)(value);
93
- return { kind: 'big_number_cell', number_value: stringValue, subtype };
94
- }
91
+ const stringValue = subtype === 'bigint' ? (0, row_data_utils_1.rowDataToSerializedBigint)(value) : undefined;
95
92
  return {
96
93
  kind: 'number_cell',
97
94
  number_value: (0, row_data_utils_1.rowDataToNumber)(value),
98
95
  subtype,
96
+ string_value: stringValue,
99
97
  };
100
98
  }
101
99
  else if (field.type.kind === 'string_type') {
@@ -27,9 +27,11 @@ function cellToValue(cell, fieldInfo) {
27
27
  case 'string_cell':
28
28
  return cell.string_value;
29
29
  case 'number_cell':
30
+ // Return BigInt for bigint values (when string_value is present for precision)
31
+ if (cell.string_value !== undefined) {
32
+ return BigInt(cell.string_value);
33
+ }
30
34
  return cell.number_value;
31
- case 'big_number_cell':
32
- return BigInt(cell.number_value);
33
35
  case 'boolean_cell':
34
36
  return cell.boolean_value;
35
37
  case 'date_cell':
@@ -159,9 +159,11 @@ function cellToValue(cell) {
159
159
  case 'string_cell':
160
160
  return cell.string_value;
161
161
  case 'number_cell':
162
+ // Return BigInt for bigint values (when string_value is present)
163
+ if (cell.string_value !== undefined) {
164
+ return BigInt(cell.string_value);
165
+ }
162
166
  return cell.number_value;
163
- case 'big_number_cell':
164
- return BigInt(cell.number_value);
165
167
  case 'boolean_cell':
166
168
  return cell.boolean_value;
167
169
  case 'date_cell':
@@ -276,6 +278,18 @@ function matchCell(cell, fieldInfo, expected, path, dialect, mode) {
276
278
  }
277
279
  // Handle number cells
278
280
  if (cell.kind === 'number_cell') {
281
+ // For bigint values, use string_value for precision
282
+ if (cell.string_value !== undefined) {
283
+ const actual = BigInt(cell.string_value);
284
+ if (looseEqual(actual, expected)) {
285
+ return { pass: true };
286
+ }
287
+ // Also allow matching against string representation of the number
288
+ if (typeof expected === 'string' && expected === cell.string_value) {
289
+ return { pass: true };
290
+ }
291
+ return matchFail(path, expected, actual);
292
+ }
279
293
  let actual = cell.number_value;
280
294
  // Handle simulated booleans (MySQL returns 1/0 for booleans)
281
295
  if (typeof expected === 'boolean' &&
@@ -288,18 +302,6 @@ function matchCell(cell, fieldInfo, expected, path, dialect, mode) {
288
302
  }
289
303
  return matchFail(path, expected, actual);
290
304
  }
291
- // Handle big number cells
292
- if (cell.kind === 'big_number_cell') {
293
- const actual = BigInt(cell.number_value);
294
- if (looseEqual(actual, expected)) {
295
- return { pass: true };
296
- }
297
- // Also allow matching against string representation of the number
298
- if (typeof expected === 'string' && expected === cell.number_value) {
299
- return { pass: true };
300
- }
301
- return matchFail(path, expected, actual);
302
- }
303
305
  // Handle JSON cells
304
306
  if (cell.kind === 'json_cell') {
305
307
  const actual = JSON.parse(cell.json_value);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.330";
1
+ export declare const MALLOY_VERSION = "0.0.331";
package/dist/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MALLOY_VERSION = void 0;
4
4
  // generated with 'generate-version-file' script; do not edit manually
5
- exports.MALLOY_VERSION = '0.0.330';
5
+ exports.MALLOY_VERSION = '0.0.331';
6
6
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.330",
3
+ "version": "0.0.331",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -45,9 +45,9 @@
45
45
  "generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
46
46
  },
47
47
  "dependencies": {
48
- "@malloydata/malloy-filter": "0.0.330",
49
- "@malloydata/malloy-interfaces": "0.0.330",
50
- "@malloydata/malloy-tag": "0.0.330",
48
+ "@malloydata/malloy-filter": "0.0.331",
49
+ "@malloydata/malloy-interfaces": "0.0.331",
50
+ "@malloydata/malloy-tag": "0.0.331",
51
51
  "antlr4ts": "^0.5.0-alpha.4",
52
52
  "assert": "^2.0.0",
53
53
  "jaro-winkler": "^0.2.8",