@prezly/sdk 15.15.0 → 15.16.0

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.
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEFAULT_USER_AGENT = void 0;
7
- const VERSION = "15.14.0";
7
+ const VERSION = "15.15.1-0";
8
8
  const URL = 'https://github.com/prezly/javascript-sdk';
9
9
  const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
10
10
  exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
@@ -1,3 +1,3 @@
1
- const VERSION = "15.14.0";
1
+ const VERSION = "15.15.1-0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
package/dist/http/lib.cjs CHANGED
@@ -10,7 +10,19 @@ var nodeUrl = _interopRequireWildcard(require("url"));
10
10
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
11
11
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- const URL = typeof window === 'undefined' ? nodeUrl.URL : window.URL;
13
+ /**
14
+ * Choose which `URL` class to use based on the environment (Browser / Node.js / Edge)
15
+ */
16
+ function getURLClass() {
17
+ if (typeof window !== 'undefined') {
18
+ return window.URL;
19
+ }
20
+ if (typeof globalThis.EdgeRuntime === 'string') {
21
+ return globalThis.URL;
22
+ }
23
+ return nodeUrl.URL;
24
+ }
25
+ const URL = getURLClass();
14
26
  function parseUrlParams(query) {
15
27
  return _queryString.default.parse(query, {
16
28
  arrayFormat: 'bracket'
package/dist/http/lib.js CHANGED
@@ -1,6 +1,18 @@
1
1
  import queryString from 'query-string';
2
2
  import * as nodeUrl from 'url';
3
- const URL = typeof window === 'undefined' ? nodeUrl.URL : window.URL;
3
+ /**
4
+ * Choose which `URL` class to use based on the environment (Browser / Node.js / Edge)
5
+ */
6
+ function getURLClass() {
7
+ if (typeof window !== 'undefined') {
8
+ return window.URL;
9
+ }
10
+ if (typeof globalThis.EdgeRuntime === 'string') {
11
+ return globalThis.URL;
12
+ }
13
+ return nodeUrl.URL;
14
+ }
15
+ const URL = getURLClass();
4
16
  function parseUrlParams(query) {
5
17
  return queryString.parse(query, {
6
18
  arrayFormat: 'bracket'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "15.15.0",
3
+ "version": "15.16.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",