@deck.gl/test-utils 8.6.0-beta.1 → 8.6.3

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,29 +1,21 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.toLowPrecision = toLowPrecision;
9
7
 
10
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
-
12
- function toLowPrecision(input) {
13
- var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
14
-
8
+ function toLowPrecision(input, precision = 11) {
15
9
  if (typeof input === 'number') {
16
10
  input = Number(input.toPrecision(precision));
17
11
  }
18
12
 
19
13
  if (Array.isArray(input)) {
20
- input = input.map(function (item) {
21
- return toLowPrecision(item, precision);
22
- });
14
+ input = input.map(item => toLowPrecision(item, precision));
23
15
  }
24
16
 
25
- if ((0, _typeof2.default)(input) === 'object') {
26
- for (var key in input) {
17
+ if (typeof input === 'object') {
18
+ for (const key in input) {
27
19
  input[key] = toLowPrecision(input[key], precision);
28
20
  }
29
21
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/precision.js"],"names":["toLowPrecision","input","precision","Number","toPrecision","Array","isArray","map","item","key"],"mappings":";;;;;;;;;;;AAOO,SAASA,cAAT,CAAwBC,KAAxB,EAA+C;AAAA,MAAhBC,SAAgB,uEAAJ,EAAI;;AAEpD,MAAI,OAAOD,KAAP,KAAiB,QAArB,EAA+B;AAC7BA,IAAAA,KAAK,GAAGE,MAAM,CAACF,KAAK,CAACG,WAAN,CAAkBF,SAAlB,CAAD,CAAd;AACD;;AACD,MAAIG,KAAK,CAACC,OAAN,CAAcL,KAAd,CAAJ,EAA0B;AACxBA,IAAAA,KAAK,GAAGA,KAAK,CAACM,GAAN,CAAU,UAAAC,IAAI;AAAA,aAAIR,cAAc,CAACQ,IAAD,EAAON,SAAP,CAAlB;AAAA,KAAd,CAAR;AACD;;AACD,MAAI,sBAAOD,KAAP,MAAiB,QAArB,EAA+B;AAC7B,SAAK,IAAMQ,GAAX,IAAkBR,KAAlB,EAAyB;AACvBA,MAAAA,KAAK,CAACQ,GAAD,CAAL,GAAaT,cAAc,CAACC,KAAK,CAACQ,GAAD,CAAN,EAAaP,SAAb,CAA3B;AACD;AACF;;AACD,SAAOD,KAAP;AACD","sourcesContent":["/**\n * Covert all numbers in a deep structure to a given precision, allowing\n * reliable float comparisons. Converts data in-place.\n * @param {mixed} input Input data\n * @param {Number} [precision] Desired precision\n * @return {mixed} Input data, with all numbers converted\n */\nexport function toLowPrecision(input, precision = 11) {\n /* eslint-disable guard-for-in */\n if (typeof input === 'number') {\n input = Number(input.toPrecision(precision));\n }\n if (Array.isArray(input)) {\n input = input.map(item => toLowPrecision(item, precision));\n }\n if (typeof input === 'object') {\n for (const key in input) {\n input[key] = toLowPrecision(input[key], precision);\n }\n }\n return input;\n}\n"],"file":"precision.js"}
1
+ {"version":3,"sources":["../../../src/utils/precision.js"],"names":["toLowPrecision","input","precision","Number","toPrecision","Array","isArray","map","item","key"],"mappings":";;;;;;;AAOO,SAASA,cAAT,CAAwBC,KAAxB,EAA+BC,SAAS,GAAG,EAA3C,EAA+C;AAEpD,MAAI,OAAOD,KAAP,KAAiB,QAArB,EAA+B;AAC7BA,IAAAA,KAAK,GAAGE,MAAM,CAACF,KAAK,CAACG,WAAN,CAAkBF,SAAlB,CAAD,CAAd;AACD;;AACD,MAAIG,KAAK,CAACC,OAAN,CAAcL,KAAd,CAAJ,EAA0B;AACxBA,IAAAA,KAAK,GAAGA,KAAK,CAACM,GAAN,CAAUC,IAAI,IAAIR,cAAc,CAACQ,IAAD,EAAON,SAAP,CAAhC,CAAR;AACD;;AACD,MAAI,OAAOD,KAAP,KAAiB,QAArB,EAA+B;AAC7B,SAAK,MAAMQ,GAAX,IAAkBR,KAAlB,EAAyB;AACvBA,MAAAA,KAAK,CAACQ,GAAD,CAAL,GAAaT,cAAc,CAACC,KAAK,CAACQ,GAAD,CAAN,EAAaP,SAAb,CAA3B;AACD;AACF;;AACD,SAAOD,KAAP;AACD","sourcesContent":["/**\n * Covert all numbers in a deep structure to a given precision, allowing\n * reliable float comparisons. Converts data in-place.\n * @param {mixed} input Input data\n * @param {Number} [precision] Desired precision\n * @return {mixed} Input data, with all numbers converted\n */\nexport function toLowPrecision(input, precision = 11) {\n /* eslint-disable guard-for-in */\n if (typeof input === 'number') {\n input = Number(input.toPrecision(precision));\n }\n if (Array.isArray(input)) {\n input = input.map(item => toLowPrecision(item, precision));\n }\n if (typeof input === 'object') {\n for (const key in input) {\n input[key] = toLowPrecision(input[key], precision);\n }\n }\n return input;\n}\n"],"file":"precision.js"}
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _testUtils = require("@luma.gl/test-utils");
9
9
 
10
- var _global = typeof global !== 'undefined' ? global : window;
10
+ const _global = typeof global !== 'undefined' ? global : window;
11
11
 
12
12
  _global.glContext = _global.glContext || (0, _testUtils.createTestContext)({
13
13
  width: 1,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/setup-gl.js"],"names":["_global","global","window","glContext","width","height","debug"],"mappings":";;;;;;;AAAA;;AAGA,IAAMA,OAAO,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAzD;;AAEAF,OAAO,CAACG,SAAR,GACEH,OAAO,CAACG,SAAR,IACA,kCAAkB;AAChBC,EAAAA,KAAK,EAAE,CADS;AAEhBC,EAAAA,MAAM,EAAE,CAFQ;AAGhBC,EAAAA,KAAK,EAAE;AAHS,CAAlB,CAFF;eAaeN,OAAO,CAACG,S","sourcesContent":["import {createTestContext} from '@luma.gl/test-utils';\n\n/* global window, global*/\nconst _global = typeof global !== 'undefined' ? global : window;\n\n_global.glContext =\n _global.glContext ||\n createTestContext({\n width: 1,\n height: 1,\n debug: true\n // throwOnFailure: false,\n // throwOnError: false\n });\n// // TODO - Seems to be an issue in luma.gl\n// (createContext && createContext(100, 100, {}));\n// // console.log('Context', _global.glContext);\n\nexport default _global.glContext;\n"],"file":"setup-gl.js"}
1
+ {"version":3,"sources":["../../../src/utils/setup-gl.js"],"names":["_global","global","window","glContext","width","height","debug"],"mappings":";;;;;;;AAAA;;AAGA,MAAMA,OAAO,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAAzD;;AAEAF,OAAO,CAACG,SAAR,GACEH,OAAO,CAACG,SAAR,IACA,kCAAkB;AAChBC,EAAAA,KAAK,EAAE,CADS;AAEhBC,EAAAA,MAAM,EAAE,CAFQ;AAGhBC,EAAAA,KAAK,EAAE;AAHS,CAAlB,CAFF;eAaeN,OAAO,CAACG,S","sourcesContent":["import {createTestContext} from '@luma.gl/test-utils';\n\n/* global window, global*/\nconst _global = typeof global !== 'undefined' ? global : window;\n\n_global.glContext =\n _global.glContext ||\n createTestContext({\n width: 1,\n height: 1,\n debug: true\n // throwOnFailure: false,\n // throwOnError: false\n });\n// // TODO - Seems to be an issue in luma.gl\n// (createContext && createContext(100, 100, {}));\n// // console.log('Context', _global.glContext);\n\nexport default _global.glContext;\n"],"file":"setup-gl.js"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/test-utils",
3
3
  "description": "Test utilities for deck.gl layers",
4
4
  "license": "MIT",
5
- "version": "8.6.0-beta.1",
5
+ "version": "8.6.3",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -29,5 +29,5 @@
29
29
  "@probe.gl/test-utils": "^3.4.0"
30
30
  },
31
31
  "scripts": {},
32
- "gitHead": "ce689d7ceb9a732d8b83d959581147b36f416d38"
32
+ "gitHead": "938ee03697eecbaced24c9df637d53ab42375df1"
33
33
  }