@brokerize/client 1.2.0 → 1.2.1

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -90,12 +90,13 @@ export class Brokerize {
90
90
  }
91
91
  }
92
92
  function getGlobalObject() {
93
- let global;
94
- try {
95
- global = Function("return this")();
96
- }
97
- catch (e) {
98
- global = window;
99
- }
100
- return global;
93
+ if (typeof globalThis !== "undefined")
94
+ return globalThis;
95
+ if (typeof self !== "undefined")
96
+ return self;
97
+ if (typeof window !== "undefined")
98
+ return window;
99
+ if (typeof global !== "undefined")
100
+ return global;
101
+ throw new Error("Unable to determine global object");
101
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brokerize/client",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Client for the brokerize.com API",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/brokerize/client-js#readme",