swell-js 4.0.9 → 4.1.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.
package/dist/api.mjs CHANGED
@@ -7,15 +7,15 @@ import methods$5 from './products.mjs';
7
7
  import methods$6 from './categories.mjs';
8
8
  import methods$7 from './attributes.mjs';
9
9
  import methods$8 from './subscriptions.mjs';
10
- import { d as defaultMethods, z as trimEnd, A as utils, B as trimStart, C as trimBoth, t as toSnake, D as stringifyQuery, E as base64Encode, a as toCamel, F as setOptions } from './index.95daac5a.mjs';
10
+ import { d as defaultMethods, z as trimEnd, A as utils, B as trimStart, C as trimBoth, t as toSnake, D as stringifyQuery, E as base64Encode, a as toCamel, F as setOptions } from './index.f58acfb6.mjs';
11
11
  import methods$9 from './content.mjs';
12
12
  import methods$a from './settings.mjs';
13
13
  import PaymentController from './payment.mjs';
14
14
  import methods$b from './locale.mjs';
15
15
  import methods$c from './currency.mjs';
16
16
  import 'qs';
17
- import './find.fd7de00e.mjs';
18
- import './round.a606b844.mjs';
17
+ import './find.18f1ac6d.mjs';
18
+ import './round.577a8441.mjs';
19
19
  import 'deepmerge';
20
20
  import 'fast-case';
21
21
 
@@ -135,7 +135,7 @@ const options = {
135
135
  };
136
136
 
137
137
  const api = {
138
- version: '4.0.9',
138
+ version: '4.1.1',
139
139
  options,
140
140
  request,
141
141
 
@@ -1,8 +1,8 @@
1
- import { d as defaultMethods } from './index.95daac5a.mjs';
1
+ import { d as defaultMethods } from './index.f58acfb6.mjs';
2
2
  import cacheApi from './cache.mjs';
3
3
  import 'qs';
4
- import './find.fd7de00e.mjs';
5
- import './round.a606b844.mjs';
4
+ import './find.18f1ac6d.mjs';
5
+ import './round.577a8441.mjs';
6
6
  import 'deepmerge';
7
7
  import 'fast-case';
8
8
 
package/dist/cache.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { s as set, m as merge, a as toCamel, h as toCamelPath, j as getOptions } from './index.95daac5a.mjs';
2
- import { g as get } from './find.fd7de00e.mjs';
1
+ import { s as set, m as merge, a as toCamel, h as toCamelPath, j as getOptions } from './index.f58acfb6.mjs';
2
+ import { g as get } from './find.18f1ac6d.mjs';
3
3
  import 'qs';
4
- import './round.a606b844.mjs';
4
+ import './round.577a8441.mjs';
5
5
  import 'deepmerge';
6
6
  import 'fast-case';
7
7
 
package/dist/card.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { t as toSnake, v as vaultRequest } from './index.95daac5a.mjs';
1
+ import { t as toSnake, v as vaultRequest } from './index.f58acfb6.mjs';
2
2
  import 'qs';
3
- import './find.fd7de00e.mjs';
4
- import './round.a606b844.mjs';
3
+ import './find.18f1ac6d.mjs';
4
+ import './round.577a8441.mjs';
5
5
  import 'deepmerge';
6
6
  import 'fast-case';
7
7
 
package/dist/cart.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import 'qs';
2
- import { c as cloneDeep } from './index.95daac5a.mjs';
2
+ import { c as cloneDeep } from './index.f58acfb6.mjs';
3
3
  import 'deepmerge';
4
4
  import 'fast-case';
5
5
  import { cleanProductOptions } from './products.mjs';
6
- import './find.fd7de00e.mjs';
7
- import './round.a606b844.mjs';
6
+ import './find.18f1ac6d.mjs';
7
+ import './round.577a8441.mjs';
8
8
  import './cache.mjs';
9
9
  import './attributes.mjs';
10
10
 
@@ -1,8 +1,8 @@
1
- import { d as defaultMethods } from './index.95daac5a.mjs';
1
+ import { d as defaultMethods } from './index.f58acfb6.mjs';
2
2
  import cacheApi from './cache.mjs';
3
3
  import 'qs';
4
- import './find.fd7de00e.mjs';
5
- import './round.a606b844.mjs';
4
+ import './find.18f1ac6d.mjs';
5
+ import './round.577a8441.mjs';
6
6
  import 'deepmerge';
7
7
  import 'fast-case';
8
8
 
package/dist/content.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import cacheApi from './cache.mjs';
2
- import './index.95daac5a.mjs';
2
+ import './index.f58acfb6.mjs';
3
3
  import 'qs';
4
- import './find.fd7de00e.mjs';
5
- import './round.a606b844.mjs';
4
+ import './find.18f1ac6d.mjs';
5
+ import './round.577a8441.mjs';
6
6
  import 'deepmerge';
7
7
  import 'fast-case';
8
8
 
package/dist/cookie.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { i as isServer } from './index.95daac5a.mjs';
1
+ import { i as isServer } from './index.f58acfb6.mjs';
2
2
  import 'qs';
3
- import './find.fd7de00e.mjs';
4
- import './round.a606b844.mjs';
3
+ import './find.18f1ac6d.mjs';
4
+ import './round.577a8441.mjs';
5
5
  import 'deepmerge';
6
6
  import 'fast-case';
7
7
 
package/dist/currency.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'qs';
2
- import { f as find, g as get } from './find.fd7de00e.mjs';
3
- import { r as round } from './round.a606b844.mjs';
2
+ import { f as find, g as get } from './find.18f1ac6d.mjs';
3
+ import { r as round } from './round.577a8441.mjs';
4
4
  import 'deepmerge';
5
5
  import 'fast-case';
6
6
 
@@ -1,9 +1,5 @@
1
- const global$1 = (typeof global !== "undefined" ? global :
2
- typeof self !== "undefined" ? self :
3
- typeof window !== "undefined" ? window : {});
4
-
5
1
  /** Detect free variable `global` from Node.js. */
6
- var freeGlobal = typeof global$1 == 'object' && global$1 && global$1.Object === Object && global$1;
2
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
7
3
 
8
4
  const freeGlobal$1 = freeGlobal;
9
5
 
@@ -1,6 +1,6 @@
1
1
  import { stringify } from 'qs';
2
- import { c as getNative, e as eq, i as isObject$1, d as castPath, h as toKey, j as isIndex, k as baseFindIndex, S as Set, s as setToArray, l as SetCache, m as cacheHas, n as baseGet, o as hasIn, p as Symbol$1, q as isArray, u as isArguments, v as arrayPush, w as identity, x as keys, y as isPrototype, z as isArrayLike, A as arrayLikeKeys, r as root, B as getSymbols, C as overArg, D as stubArray, E as baseGetAllKeys, U as Uint8Array, F as isObjectLike, G as getTag, H as nodeUtil, I as baseUnary, J as isBuffer, K as Stack, L as getAllKeys, b as toString, M as baseIsEqual, N as isTypedArray, O as baseKeys, f as find, P as findIndex, g as get, t as toNumber } from './find.fd7de00e.mjs';
3
- import { r as round } from './round.a606b844.mjs';
2
+ import { c as getNative, e as eq, i as isObject$1, d as castPath, h as toKey, j as isIndex, k as baseFindIndex, S as Set, s as setToArray, l as SetCache, m as cacheHas, n as baseGet, o as hasIn, p as Symbol$1, q as isArray, u as isArguments, v as arrayPush, w as identity, x as keys, y as isPrototype, z as isArrayLike, A as arrayLikeKeys, r as root, B as getSymbols, C as overArg, D as stubArray, E as baseGetAllKeys, U as Uint8Array, F as isObjectLike, G as getTag, H as nodeUtil, I as baseUnary, J as isBuffer, K as Stack, L as getAllKeys, b as toString, M as baseIsEqual, N as isTypedArray, O as baseKeys, f as find, P as findIndex, g as get, t as toNumber } from './find.18f1ac6d.mjs';
3
+ import { r as round } from './round.577a8441.mjs';
4
4
  import deepmerge from 'deepmerge';
5
5
  import { camelize, decamelize, camelizeKeys, decamelizeKeys } from 'fast-case';
6
6
 
@@ -1475,32 +1475,41 @@ const LOADING_SCRIPTS = {};
1475
1475
 
1476
1476
  let options = {};
1477
1477
 
1478
- function merge(x, y, _opt = {}) {
1478
+ function arrayMerge(target, source, options) {
1479
+ const destination = target.slice();
1480
+ source.forEach((item, index) => {
1481
+ if (typeof destination[index] === 'undefined') {
1482
+ destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);
1483
+ } else if (options.isMergeableObject(item)) {
1484
+ destination[index] = merge(target[index], item, options);
1485
+ } else if (target.indexOf(item) === -1) {
1486
+ destination.push(item);
1487
+ }
1488
+ });
1489
+ return destination;
1490
+ }
1491
+
1492
+ /**
1493
+ * @template T
1494
+ * @param {Partial<T>} x
1495
+ * @param {Partial<T>} y
1496
+ * @param {deepmerge.Options} [opt]
1497
+ * @returns {T}
1498
+ */
1499
+ function merge(x, y, opt) {
1479
1500
  if (!y || typeof y !== 'object') {
1480
1501
  return x;
1481
1502
  }
1503
+
1482
1504
  if (!x || typeof x !== 'object') {
1483
1505
  return x;
1484
1506
  }
1485
- function arrayMerge(target, source, options) {
1486
- const destination = target.slice();
1487
- source.forEach((item, index) => {
1488
- if (typeof destination[index] === 'undefined') {
1489
- destination[index] = options.cloneUnlessOtherwiseSpecified(
1490
- item,
1491
- options,
1492
- );
1493
- } else if (options.isMergeableObject(item)) {
1494
- destination[index] = merge(target[index], item, options);
1495
- } else if (target.indexOf(item) === -1) {
1496
- destination.push(item);
1497
- }
1498
- });
1499
- return destination;
1507
+
1508
+ if (!opt) {
1509
+ opt = { arrayMerge };
1500
1510
  }
1501
- return deepmerge(x, y, {
1502
- arrayMerge,
1503
- });
1511
+
1512
+ return deepmerge(x, y, opt);
1504
1513
  }
1505
1514
 
1506
1515
  function setOptions(optns) {
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  export { default } from './api.mjs';
2
2
  import './card.mjs';
3
- import './index.95daac5a.mjs';
3
+ import './index.f58acfb6.mjs';
4
4
  import 'qs';
5
- import './find.fd7de00e.mjs';
6
- import './round.a606b844.mjs';
5
+ import './find.18f1ac6d.mjs';
6
+ import './round.577a8441.mjs';
7
7
  import 'deepmerge';
8
8
  import 'fast-case';
9
9
  import './cookie.mjs';
package/dist/locale.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import 'qs';
2
- import { f as find } from './find.fd7de00e.mjs';
2
+ import { f as find } from './find.18f1ac6d.mjs';
3
3
  import 'deepmerge';
4
4
  import 'fast-case';
5
5
 
package/dist/payment.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import methods from './cart.mjs';
2
2
  import methods$1 from './settings.mjs';
3
- import { b as isObject, k as isFunction, l as loadScript, c as cloneDeep, t as toSnake, v as vaultRequest, p as pick, n as toLower, o as isEmpty, r as reduce, q as isLiveMode, w as map, x as getLocationParams, y as removeUrlParams, a as toCamel } from './index.95daac5a.mjs';
4
- import { g as get, t as toNumber } from './find.fd7de00e.mjs';
3
+ import { b as isObject, k as isFunction, l as loadScript, c as cloneDeep, t as toSnake, v as vaultRequest, p as pick, n as toLower, o as isEmpty, r as reduce, q as isLiveMode, w as map, x as getLocationParams, y as removeUrlParams, a as toCamel } from './index.f58acfb6.mjs';
4
+ import { g as get, t as toNumber } from './find.18f1ac6d.mjs';
5
5
  import 'qs';
6
6
  import 'deepmerge';
7
7
  import 'fast-case';
8
8
  import './products.mjs';
9
9
  import './cache.mjs';
10
- import './round.a606b844.mjs';
10
+ import './round.577a8441.mjs';
11
11
  import './attributes.mjs';
12
12
 
13
13
  const SCRIPT_HANDLERS = {
package/dist/products.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { d as defaultMethods, r as reduce, t as toSnake, a as toCamel, f as snakeCase, u as uniq, g as isEqual } from './index.95daac5a.mjs';
1
+ import { d as defaultMethods, r as reduce, t as toSnake, a as toCamel, f as snakeCase, u as uniq, g as isEqual } from './index.f58acfb6.mjs';
2
2
  import cacheApi from './cache.mjs';
3
3
  import methods$1 from './attributes.mjs';
4
- import { g as get, f as find } from './find.fd7de00e.mjs';
4
+ import { g as get, f as find } from './find.18f1ac6d.mjs';
5
5
  import 'qs';
6
- import './round.a606b844.mjs';
6
+ import './round.577a8441.mjs';
7
7
  import 'deepmerge';
8
8
  import 'fast-case';
9
9
 
@@ -1,4 +1,4 @@
1
- import { r as root, t as toNumber, a as toInteger, b as toString } from './find.fd7de00e.mjs';
1
+ import { r as root, t as toNumber, a as toInteger, b as toString } from './find.18f1ac6d.mjs';
2
2
 
3
3
  /* Built-in method references for those with the same name as other `lodash` methods. */
4
4
  var nativeIsFinite = root.isFinite,
package/dist/settings.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { s as set, a as toCamel, m as merge, c as cloneDeep, b as isObject, e as camelCase } from './index.95daac5a.mjs';
2
- import { g as get, f as find } from './find.fd7de00e.mjs';
1
+ import { s as set, a as toCamel, m as merge, c as cloneDeep, b as isObject, e as camelCase } from './index.f58acfb6.mjs';
2
+ import { g as get, f as find } from './find.18f1ac6d.mjs';
3
3
  import 'qs';
4
- import './round.a606b844.mjs';
4
+ import './round.577a8441.mjs';
5
5
  import 'deepmerge';
6
6
  import 'fast-case';
7
7
 
@@ -1,10 +1,10 @@
1
1
  import { cleanProductOptions } from './products.mjs';
2
- import { d as defaultMethods } from './index.95daac5a.mjs';
2
+ import { d as defaultMethods } from './index.f58acfb6.mjs';
3
3
  import cacheApi from './cache.mjs';
4
4
  import './attributes.mjs';
5
- import './find.fd7de00e.mjs';
5
+ import './find.18f1ac6d.mjs';
6
6
  import 'qs';
7
- import './round.a606b844.mjs';
7
+ import './round.577a8441.mjs';
8
8
  import 'deepmerge';
9
9
  import 'fast-case';
10
10