@observablehq/notebook-kit 1.1.0-rc.5 → 1.1.0-rc.7

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/observablehq/notebook-kit.git"
7
7
  },
8
- "version": "1.1.0-rc.5",
8
+ "version": "1.1.0-rc.7",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "test": "vitest",
@@ -47,7 +47,7 @@ function getColumnType(type) {
47
47
  case UBIGINT:
48
48
  case HUGEINT:
49
49
  case UHUGEINT:
50
- return "integer"; // TODO bigint?
50
+ return "bigint";
51
51
  case FLOAT:
52
52
  case DOUBLE:
53
53
  return "number";
@@ -33,7 +33,7 @@ function getColumnSchema(column) {
33
33
  function getColumnType(oid) {
34
34
  switch (oid) {
35
35
  case 20: // int8
36
- return "integer"; // TODO bigint?
36
+ return "bigint";
37
37
  case 21: // int2
38
38
  case 23: // int4
39
39
  case 26: // oid
@@ -54,7 +54,7 @@ function revive({ rows, schema, date, ...meta }) {
54
54
  const value = row[name];
55
55
  if (value == null)
56
56
  continue;
57
- row[name] = BigInt(value);
57
+ row[name] = Number(value); // TODO BigInt?
58
58
  }
59
59
  break;
60
60
  }
@@ -64,7 +64,7 @@ function revive({ rows, schema, date, ...meta }) {
64
64
  const value = row[name];
65
65
  if (value == null)
66
66
  continue;
67
- row[name] = new Date(value);
67
+ row[name] = asDate(value);
68
68
  }
69
69
  break;
70
70
  }
@@ -74,6 +74,9 @@ function revive({ rows, schema, date, ...meta }) {
74
74
  date = new Date(date);
75
75
  return Object.assign(rows, { schema, date }, meta);
76
76
  }
77
+ function asDate(value) {
78
+ return new Date(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(?::\d{2})?$/.test(value) ? value + "Z" : value);
79
+ }
77
80
  DatabaseClient.hash = hash;
78
81
  DatabaseClient.revive = revive;
79
82
  DatabaseClient.prototype = DatabaseClientImpl.prototype; // instanceof
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/observablehq/notebook-kit.git"
7
7
  },
8
- "version": "1.1.0-rc.5",
8
+ "version": "1.1.0-rc.7",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "test": "vitest",