@loaders.gl/bson 4.0.0-alpha.22 → 4.0.0-alpha.24

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bson-loader.d.ts","sourceRoot":"","sources":["../src/bson-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAO/D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAMF,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAY1F,CAAC"}
1
+ {"version":3,"file":"bson-loader.d.ts","sourceRoot":"","sources":["../src/bson-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAO/D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAc1F,CAAC"}
package/dist/dist.min.js CHANGED
@@ -5752,21 +5752,18 @@
5752
5752
 
5753
5753
  // src/bson-loader.ts
5754
5754
  async function parse(arrayBuffer, options) {
5755
- const bsonOptions = { ...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson };
5755
+ const bsonOptions = { ...BSONLoader.options.bson, ...options?.bson };
5756
5756
  return parseBSONSync(arrayBuffer, bsonOptions);
5757
5757
  }
5758
5758
  function parseSync(arrayBuffer, options) {
5759
- const bsonOptions = { ...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson };
5759
+ const bsonOptions = { ...BSONLoader.options.bson, ...options?.bson };
5760
5760
  return parseBSONSync(arrayBuffer, bsonOptions);
5761
5761
  }
5762
- var VERSION, DEFAULT_BSON_LOADER_OPTIONS, BSONLoader;
5762
+ var VERSION, BSONLoader;
5763
5763
  var init_bson_loader = __esm({
5764
5764
  "src/bson-loader.ts"() {
5765
5765
  init_parse_bson();
5766
5766
  VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
5767
- DEFAULT_BSON_LOADER_OPTIONS = {
5768
- bson: {}
5769
- };
5770
5767
  BSONLoader = {
5771
5768
  name: "BSON",
5772
5769
  id: "bson",
@@ -5778,7 +5775,9 @@
5778
5775
  binary: true,
5779
5776
  parse,
5780
5777
  parseSync,
5781
- options: DEFAULT_BSON_LOADER_OPTIONS
5778
+ options: {
5779
+ bson: {}
5780
+ }
5782
5781
  };
5783
5782
  }
5784
5783
  });
@@ -11,10 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
11
11
  var _parseBson = require("./lib/parsers/parse-bson");
12
12
  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; }
13
13
  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; }
14
- var VERSION = typeof "4.0.0-alpha.22" !== 'undefined' ? "4.0.0-alpha.22" : 'latest';
15
- var DEFAULT_BSON_LOADER_OPTIONS = {
16
- bson: {}
17
- };
14
+ var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
18
15
  var BSONLoader = {
19
16
  name: 'BSON',
20
17
  id: 'bson',
@@ -26,7 +23,9 @@ var BSONLoader = {
26
23
  binary: true,
27
24
  parse: parse,
28
25
  parseSync: parseSync,
29
- options: DEFAULT_BSON_LOADER_OPTIONS
26
+ options: {
27
+ bson: {}
28
+ }
30
29
  };
31
30
  exports.BSONLoader = BSONLoader;
32
31
  function parse(_x, _x2) {
@@ -38,7 +37,7 @@ function _parse() {
38
37
  return _regenerator.default.wrap(function _callee$(_context) {
39
38
  while (1) switch (_context.prev = _context.next) {
40
39
  case 0:
41
- bsonOptions = _objectSpread(_objectSpread({}, DEFAULT_BSON_LOADER_OPTIONS.bson), options === null || options === void 0 ? void 0 : options.bson);
40
+ bsonOptions = _objectSpread(_objectSpread({}, BSONLoader.options.bson), options === null || options === void 0 ? void 0 : options.bson);
42
41
  return _context.abrupt("return", (0, _parseBson.parseBSONSync)(arrayBuffer, bsonOptions));
43
42
  case 2:
44
43
  case "end":
@@ -49,7 +48,7 @@ function _parse() {
49
48
  return _parse.apply(this, arguments);
50
49
  }
51
50
  function parseSync(arrayBuffer, options) {
52
- var bsonOptions = _objectSpread(_objectSpread({}, DEFAULT_BSON_LOADER_OPTIONS.bson), options === null || options === void 0 ? void 0 : options.bson);
51
+ var bsonOptions = _objectSpread(_objectSpread({}, BSONLoader.options.bson), options === null || options === void 0 ? void 0 : options.bson);
53
52
  return (0, _parseBson.parseBSONSync)(arrayBuffer, bsonOptions);
54
53
  }
55
54
  //# sourceMappingURL=bson-loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bson-loader.js","names":["_parseBson","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","VERSION","DEFAULT_BSON_LOADER_OPTIONS","bson","BSONLoader","name","id","module","version","extensions","mimeTypes","category","binary","parse","parseSync","options","exports","_x","_x2","_parse","_asyncToGenerator2","_regenerator","mark","_callee","arrayBuffer","bsonOptions","wrap","_callee$","_context","prev","next","abrupt","parseBSONSync","stop"],"sources":["../../src/bson-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseBSONOptions} from './lib/parsers/parse-bson';\nimport {parseBSONSync} from './lib/parsers/parse-bson';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param bsonpaths -\n */\nexport type BSONLoaderOptions = LoaderOptions & {\n bson?: ParseBSONOptions;\n};\n\nconst DEFAULT_BSON_LOADER_OPTIONS = {\n bson: {}\n};\n\nexport const BSONLoader: LoaderWithParser<Record<string, unknown>, never, BSONLoaderOptions> = {\n name: 'BSON',\n id: 'bson',\n module: 'bson',\n version: VERSION,\n extensions: ['bson'],\n mimeTypes: ['application/bson'],\n category: 'json',\n binary: true,\n parse,\n parseSync,\n options: DEFAULT_BSON_LOADER_OPTIONS\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\n\nfunction parseSync(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\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APA,OAAO,uBAAPA,OAAO,CAAEZ,IAAI,CAAC;EAC3E,OAAO,IAAA6B,wBAAa,EAACR,WAAW,EAAEC,WAAW,CAAC;AAChD"}
1
+ {"version":3,"file":"bson-loader.js","names":["_parseBson","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","VERSION","BSONLoader","name","id","module","version","extensions","mimeTypes","category","binary","parse","parseSync","options","bson","exports","_x","_x2","_parse","_asyncToGenerator2","_regenerator","mark","_callee","arrayBuffer","bsonOptions","wrap","_callee$","_context","prev","next","abrupt","parseBSONSync","stop"],"sources":["../../src/bson-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseBSONOptions} from './lib/parsers/parse-bson';\nimport {parseBSONSync} from './lib/parsers/parse-bson';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param bsonpaths -\n */\nexport type BSONLoaderOptions = LoaderOptions & {\n bson?: ParseBSONOptions;\n};\n\nexport const BSONLoader: LoaderWithParser<Record<string, unknown>, never, BSONLoaderOptions> = {\n name: 'BSON',\n id: 'bson',\n module: 'bson',\n version: VERSION,\n extensions: ['bson'],\n mimeTypes: ['application/bson'],\n category: 'json',\n binary: true,\n parse,\n parseSync,\n options: {\n bson: {}\n }\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...BSONLoader.options.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\n\nfunction parseSync(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...BSONL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ACW,OAAO,CAACC,IAAI,GAAKD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,IAAI,CAAC;EAClE,OAAO,IAAAiB,wBAAa,EAACR,WAAW,EAAEC,WAAW,CAAC;AAChD"}
@@ -8,7 +8,7 @@ exports.BSONWriter = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _encodeBson = require("./lib/encoders/encode-bson");
11
- var VERSION = typeof "4.0.0-alpha.22" !== 'undefined' ? "4.0.0-alpha.22" : 'latest';
11
+ var VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
12
12
  var BSONWriter = {
13
13
  name: 'BSON',
14
14
  id: 'bson',
@@ -1,8 +1,5 @@
1
1
  import { parseBSONSync } from './lib/parsers/parse-bson';
2
- const VERSION = typeof "4.0.0-alpha.22" !== 'undefined' ? "4.0.0-alpha.22" : 'latest';
3
- const DEFAULT_BSON_LOADER_OPTIONS = {
4
- bson: {}
5
- };
2
+ const VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
6
3
  export const BSONLoader = {
7
4
  name: 'BSON',
8
5
  id: 'bson',
@@ -14,18 +11,20 @@ export const BSONLoader = {
14
11
  binary: true,
15
12
  parse,
16
13
  parseSync,
17
- options: DEFAULT_BSON_LOADER_OPTIONS
14
+ options: {
15
+ bson: {}
16
+ }
18
17
  };
19
18
  async function parse(arrayBuffer, options) {
20
19
  const bsonOptions = {
21
- ...DEFAULT_BSON_LOADER_OPTIONS.bson,
20
+ ...BSONLoader.options.bson,
22
21
  ...(options === null || options === void 0 ? void 0 : options.bson)
23
22
  };
24
23
  return parseBSONSync(arrayBuffer, bsonOptions);
25
24
  }
26
25
  function parseSync(arrayBuffer, options) {
27
26
  const bsonOptions = {
28
- ...DEFAULT_BSON_LOADER_OPTIONS.bson,
27
+ ...BSONLoader.options.bson,
29
28
  ...(options === null || options === void 0 ? void 0 : options.bson)
30
29
  };
31
30
  return parseBSONSync(arrayBuffer, bsonOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"bson-loader.js","names":["parseBSONSync","VERSION","DEFAULT_BSON_LOADER_OPTIONS","bson","BSONLoader","name","id","module","version","extensions","mimeTypes","category","binary","parse","parseSync","options","arrayBuffer","bsonOptions"],"sources":["../../src/bson-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseBSONOptions} from './lib/parsers/parse-bson';\nimport {parseBSONSync} from './lib/parsers/parse-bson';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param bsonpaths -\n */\nexport type BSONLoaderOptions = LoaderOptions & {\n bson?: ParseBSONOptions;\n};\n\nconst DEFAULT_BSON_LOADER_OPTIONS = {\n bson: {}\n};\n\nexport const BSONLoader: LoaderWithParser<Record<string, unknown>, never, BSONLoaderOptions> = {\n name: 'BSON',\n id: 'bson',\n module: 'bson',\n version: VERSION,\n extensions: ['bson'],\n mimeTypes: ['application/bson'],\n category: 'json',\n binary: true,\n parse,\n parseSync,\n options: DEFAULT_BSON_LOADER_OPTIONS\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\n\nfunction parseSync(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\n"],"mappings":"AAGA,SAAQA,aAAa,QAAO,0BAA0B;AAItD,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAU3E,MAAMC,2BAA2B,GAAG;EAClCC,IAAI,EAAE,CAAC;AACT,CAAC;AAED,OAAO,MAAMC,UAA+E,GAAG;EAC7FC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEP,OAAO;EAChBQ,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,QAAQ,EAAE,MAAM;EAChBC,MAAM,EAAE,IAAI;EACZC,KAAK;EACLC,SAAS;EACTC,OAAO,EAAEb;AACX,CAAC;AAED,eAAeW,KAAKA,CAACG,WAAwB,EAAED,OAA2B,EAAE;EAC1E,MAAME,WAAW,GAAG;IAAC,GAAGf,2BAA2B,CAACC,IAAI;IAAE,IAAGY,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEZ,IAAI;EAAA,CAAC;EAC3E,OAAOH,aAAa,CAACgB,WAAW,EAAEC,WAAW,CAAC;AAChD;AAEA,SAASH,SAASA,CAACE,WAAwB,EAAED,OAA2B,EAAE;EACxE,MAAME,WAAW,GAAG;IAAC,GAAGf,2BAA2B,CAACC,IAAI;IAAE,IAAGY,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEZ,IAAI;EAAA,CAAC;EAC3E,OAAOH,aAAa,CAACgB,WAAW,EAAEC,WAAW,CAAC;AAChD"}
1
+ {"version":3,"file":"bson-loader.js","names":["parseBSONSync","VERSION","BSONLoader","name","id","module","version","extensions","mimeTypes","category","binary","parse","parseSync","options","bson","arrayBuffer","bsonOptions"],"sources":["../../src/bson-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseBSONOptions} from './lib/parsers/parse-bson';\nimport {parseBSONSync} from './lib/parsers/parse-bson';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param bsonpaths -\n */\nexport type BSONLoaderOptions = LoaderOptions & {\n bson?: ParseBSONOptions;\n};\n\nexport const BSONLoader: LoaderWithParser<Record<string, unknown>, never, BSONLoaderOptions> = {\n name: 'BSON',\n id: 'bson',\n module: 'bson',\n version: VERSION,\n extensions: ['bson'],\n mimeTypes: ['application/bson'],\n category: 'json',\n binary: true,\n parse,\n parseSync,\n options: {\n bson: {}\n }\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...BSONLoader.options.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\n\nfunction parseSync(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {\n const bsonOptions = {...BSONLoader.options.bson, ...options?.bson};\n return parseBSONSync(arrayBuffer, bsonOptions);\n}\n"],"mappings":"AAGA,SAAQA,aAAa,QAAO,0BAA0B;AAItD,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAU3E,OAAO,MAAMC,UAA+E,GAAG;EAC7FC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,QAAQ,EAAE,MAAM;EAChBC,MAAM,EAAE,IAAI;EACZC,KAAK;EACLC,SAAS;EACTC,OAAO,EAAE;IACPC,IAAI,EAAE,CAAC;EACT;AACF,CAAC;AAED,eAAeH,KAAKA,CAACI,WAAwB,EAAEF,OAA2B,EAAE;EAC1E,MAAMG,WAAW,GAAG;IAAC,GAAGd,UAAU,CAACW,OAAO,CAACC,IAAI;IAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,IAAI;EAAA,CAAC;EAClE,OAAOd,aAAa,CAACe,WAAW,EAAEC,WAAW,CAAC;AAChD;AAEA,SAASJ,SAASA,CAACG,WAAwB,EAAEF,OAA2B,EAAE;EACxE,MAAMG,WAAW,GAAG;IAAC,GAAGd,UAAU,CAACW,OAAO,CAACC,IAAI;IAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,IAAI;EAAA,CAAC;EAClE,OAAOd,aAAa,CAACe,WAAW,EAAEC,WAAW,CAAC;AAChD"}
@@ -1,5 +1,5 @@
1
1
  import { encodeBSONSync } from './lib/encoders/encode-bson';
2
- const VERSION = typeof "4.0.0-alpha.22" !== 'undefined' ? "4.0.0-alpha.22" : 'latest';
2
+ const VERSION = typeof "4.0.0-alpha.24" !== 'undefined' ? "4.0.0-alpha.24" : 'latest';
3
3
  export const BSONWriter = {
4
4
  name: 'BSON',
5
5
  id: 'bson',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/bson",
3
- "version": "4.0.0-alpha.22",
3
+ "version": "4.0.0-alpha.24",
4
4
  "description": "Framework-independent loader for JSON and streaming JSON formats",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,11 +34,11 @@
34
34
  "build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
35
35
  },
36
36
  "dependencies": {
37
- "@loaders.gl/gis": "4.0.0-alpha.22",
38
- "@loaders.gl/loader-utils": "4.0.0-alpha.22",
39
- "@loaders.gl/schema": "4.0.0-alpha.22",
37
+ "@loaders.gl/gis": "4.0.0-alpha.24",
38
+ "@loaders.gl/loader-utils": "4.0.0-alpha.24",
39
+ "@loaders.gl/schema": "4.0.0-alpha.24",
40
40
  "@types/bson": "4.2.0",
41
41
  "bson": "4.2.0"
42
42
  },
43
- "gitHead": "0da838c506d1275383f2fd3d244d9c72b25397d2"
43
+ "gitHead": "97a8990595c132fb14e3445a8768d9f4cb98ff05"
44
44
  }
@@ -15,10 +15,6 @@ export type BSONLoaderOptions = LoaderOptions & {
15
15
  bson?: ParseBSONOptions;
16
16
  };
17
17
 
18
- const DEFAULT_BSON_LOADER_OPTIONS = {
19
- bson: {}
20
- };
21
-
22
18
  export const BSONLoader: LoaderWithParser<Record<string, unknown>, never, BSONLoaderOptions> = {
23
19
  name: 'BSON',
24
20
  id: 'bson',
@@ -30,15 +26,17 @@ export const BSONLoader: LoaderWithParser<Record<string, unknown>, never, BSONLo
30
26
  binary: true,
31
27
  parse,
32
28
  parseSync,
33
- options: DEFAULT_BSON_LOADER_OPTIONS
29
+ options: {
30
+ bson: {}
31
+ }
34
32
  };
35
33
 
36
34
  async function parse(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {
37
- const bsonOptions = {...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson};
35
+ const bsonOptions = {...BSONLoader.options.bson, ...options?.bson};
38
36
  return parseBSONSync(arrayBuffer, bsonOptions);
39
37
  }
40
38
 
41
39
  function parseSync(arrayBuffer: ArrayBuffer, options?: BSONLoaderOptions) {
42
- const bsonOptions = {...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson};
40
+ const bsonOptions = {...BSONLoader.options.bson, ...options?.bson};
43
41
  return parseBSONSync(arrayBuffer, bsonOptions);
44
42
  }
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BSONLoader = void 0;
4
- const parse_bson_1 = require("./lib/parsers/parse-bson");
5
- // __VERSION__ is injected by babel-plugin-version-inline
6
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
8
- const DEFAULT_BSON_LOADER_OPTIONS = {
9
- bson: {}
10
- };
11
- exports.BSONLoader = {
12
- name: 'BSON',
13
- id: 'bson',
14
- module: 'bson',
15
- version: VERSION,
16
- extensions: ['bson'],
17
- mimeTypes: ['application/bson'],
18
- category: 'json',
19
- binary: true,
20
- parse,
21
- parseSync,
22
- options: DEFAULT_BSON_LOADER_OPTIONS
23
- };
24
- async function parse(arrayBuffer, options) {
25
- const bsonOptions = { ...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson };
26
- return (0, parse_bson_1.parseBSONSync)(arrayBuffer, bsonOptions);
27
- }
28
- function parseSync(arrayBuffer, options) {
29
- const bsonOptions = { ...DEFAULT_BSON_LOADER_OPTIONS.bson, ...options?.bson };
30
- return (0, parse_bson_1.parseBSONSync)(arrayBuffer, bsonOptions);
31
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- // loaders.gl, MIT license
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BSONWriter = void 0;
5
- const encode_bson_1 = require("./lib/encoders/encode-bson");
6
- // __VERSION__ is injected by babel-plugin-version-inline
7
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
8
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
9
- exports.BSONWriter = {
10
- name: 'BSON',
11
- id: 'bson',
12
- module: 'bson',
13
- version: VERSION,
14
- extensions: ['bson'],
15
- options: {
16
- bson: {}
17
- },
18
- async encode(data, options) {
19
- return (0, encode_bson_1.encodeBSONSync)(data, {}); // options
20
- },
21
- encodeSync(data, options) {
22
- return (0, encode_bson_1.encodeBSONSync)(data, {}); // options
23
- }
24
- };
package/dist/bundle.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- const moduleExports = require('./index');
4
- globalThis.loaders = globalThis.loaders || {};
5
- module.exports = Object.assign(globalThis.loaders, moduleExports);
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- // loaders.gl, MIT license
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BSONWriter = exports.BSONLoader = void 0;
5
- var bson_loader_1 = require("./bson-loader");
6
- Object.defineProperty(exports, "BSONLoader", { enumerable: true, get: function () { return bson_loader_1.BSONLoader; } });
7
- var bson_writer_1 = require("./bson-writer");
8
- Object.defineProperty(exports, "BSONWriter", { enumerable: true, get: function () { return bson_writer_1.BSONWriter; } });
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // loaders.gl, MIT license
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.encodeBSONSync = void 0;
5
- const bson_1 = require("bson");
6
- function encodeBSONSync(value, options) {
7
- const uint8Array = (0, bson_1.serialize)(value);
8
- // TODO - make sure the uint8array occupies the entire buffer.
9
- return uint8Array.buffer;
10
- }
11
- exports.encodeBSONSync = encodeBSONSync;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // loaders.gl, MIT license
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.parseBSONSync = void 0;
5
- const bson_1 = require("bson");
6
- function parseBSONSync(value, options) {
7
- const parsedData = (0, bson_1.deserialize)(new Uint8Array(value), options);
8
- return parsedData;
9
- }
10
- exports.parseBSONSync = parseBSONSync;