Skip to content

Commit 76635d0

Browse files
authored
Merge pull request #316 from Surg-Dev/fix/defaultvalue-depr
Fix Default Value Errors
2 parents ce0c36e + 79f316e commit 76635d0

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

bin/obj2gltf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const path = require("path");
66
const yargs = require("yargs");
77
const obj2gltf = require("../lib/obj2gltf");
88

9-
const defaultValue = Cesium.defaultValue;
9+
const defaultValue = (a, b) => a ?? b;
1010
const defined = Cesium.defined;
1111

1212
const defaults = obj2gltf.defaults;

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const JasmineSpecReporter = require("jasmine-spec-reporter").SpecReporter;
1010
const path = require("path");
1111
const yargs = require("yargs");
1212

13-
const defaultValue = Cesium.defaultValue;
13+
const defaultValue = (a, b) => a ?? b;
1414
const defined = Cesium.defined;
1515
const argv = yargs.argv;
1616

@@ -119,7 +119,7 @@ function cloc() {
119119
}
120120

121121
function getLicenseDataFromPackage(packageName, override) {
122-
override = defaultValue(override, defaultValue.EMPTY_OBJECT);
122+
override = defaultValue(override, Cesium.Frozen.EMPTY_OBJECT);
123123
const packagePath = path.join("node_modules", packageName, "package.json");
124124

125125
if (!fsExtra.existsSync(packagePath)) {

lib/createGltf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const getBufferPadded = require("./getBufferPadded");
77
const getDefaultMaterial = require("./loadMtl").getDefaultMaterial;
88
const Texture = require("./Texture");
99

10-
const defaultValue = Cesium.defaultValue;
10+
const defaultValue = (a, b) => a ?? b;
1111
const defined = Cesium.defined;
1212
const WebGLConstants = Cesium.WebGLConstants;
1313

lib/loadMtl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Texture = require("./Texture");
1010
const CesiumMath = Cesium.Math;
1111
const clone = Cesium.clone;
1212
const combine = Cesium.combine;
13-
const defaultValue = Cesium.defaultValue;
13+
const defaultValue = (a, b) => a ?? b;
1414
const defined = Cesium.defined;
1515

1616
module.exports = loadMtl;

lib/loadObj.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Axis = Cesium.Axis;
1212
const Cartesian3 = Cesium.Cartesian3;
1313
const ComponentDatatype = Cesium.ComponentDatatype;
1414
const CoplanarPolygonGeometryLibrary = Cesium.CoplanarPolygonGeometryLibrary;
15-
const defaultValue = Cesium.defaultValue;
15+
const defaultValue = (a, b) => a ?? b;
1616
const defined = Cesium.defined;
1717
const PolygonPipeline = Cesium.PolygonPipeline;
1818
const RuntimeError = Cesium.RuntimeError;

lib/loadTexture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const PNG = require("pngjs").PNG;
77
const Promise = require("bluebird");
88
const Texture = require("./Texture");
99

10-
const defaultValue = Cesium.defaultValue;
10+
const defaultValue = (a, b) => a ?? b;
1111
const defined = Cesium.defined;
1212

1313
module.exports = loadTexture;

lib/obj2gltf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const createGltf = require("./createGltf");
66
const loadObj = require("./loadObj");
77
const writeGltf = require("./writeGltf");
88

9-
const defaultValue = Cesium.defaultValue;
9+
const defaultValue = (a, b) => a ?? b;
1010
const defined = Cesium.defined;
1111
const DeveloperError = Cesium.DeveloperError;
1212

@@ -75,7 +75,7 @@ function obj2gltf(objPath, options) {
7575
options.unlit = defaultValue(options.unlit, defaults.unlit);
7676
options.overridingTextures = defaultValue(
7777
options.overridingTextures,
78-
defaultValue.EMPTY_OBJECT,
78+
Cesium.Frozen.EMPTY_OBJECT,
7979
);
8080
options.logger = defaultValue(options.logger, getDefaultLogger());
8181
options.writer = defaultValue(

0 commit comments

Comments
 (0)