Skip to content

Commit

Permalink
patch config initialization in constructor to be able to properly set…
Browse files Browse the repository at this point in the history
… config options
  • Loading branch information
roncodes committed Feb 25, 2022
1 parent 9e7bc81 commit 74290fe
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/@fleetbase/sdk.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/@fleetbase/sdk.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/fleetbase.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/fleetbase.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/fleetbase.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/fleetbase.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/sdk",
"version": "1.2.3",
"version": "1.2.4",
"description": "Fleetbase JS & Node SDK",
"main": "dist/cjs/fleetbase.js",
"module": "dist/esm/fleetbase.js",
Expand Down
6 changes: 3 additions & 3 deletions src/fleetbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export default class Fleetbase {
* @return {Fleetbase} Instance
*/
constructor(publicKey, config = {}, debug = false) {
this.version = config.version || 'v1';
this.version = config.version ?? 'v1';
this.options = {
version: this.version,
host: config.host || 'https://api.fleetbase.io',
namespace: this.version || config.namespace,
host: config.host ?? 'https://api.fleetbase.io',
namespace: config.namespace ?? this.version,
debug,
publicKey,
};
Expand Down

0 comments on commit 74290fe

Please sign in to comment.