@replohq/sdk 1.9.0 → 1.9.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/_vendor/replo-utils/lib/json.mjs +5 -2
- package/_vendor/replo-utils/lib/misc.mjs +3 -2
- package/_vendor/replo-utils/lib/object.mjs +5 -0
- package/_vendor/schemas/contentEntry.mjs +3 -1
- package/_vendor/schemas/contentManifest.mjs +6 -3
- package/_vendor/schemas/money.mjs +3 -2
- package/_vendor/schemas/routing/locale.d.ts +1 -1
- package/_vendor/schemas/routing/locale.mjs +3 -2
- package/_vendor/schemas/routing/rules.mjs +3 -2
- package/analytics/sinks/converge-event-mapper.js +4 -10
- package/cart/buy-now-action.d.ts +0 -2
- package/cart/buy-now-action.js +0 -1
- package/cart/cart-actions.d.ts +1 -5
- package/cart/cart-actions.js +5 -21
- package/cart/cart-loader.d.ts +1 -4
- package/cart/cart-loader.js +2 -5
- package/cart/cart-provider.d.ts +1 -3
- package/cart/cart-provider.js +14 -34
- package/cart/cart-schema.d.ts +0 -3
- package/cart/cart-schema.js +1 -2
- package/cart/cart-types.d.ts +0 -12
- package/cart/gateways/cart-gateway.d.ts +2 -10
- package/cart/gateways/cookie-cart-gateway.d.ts +2 -10
- package/cart/gateways/cookie-cart-gateway.js +1 -8
- package/cart/gateways/resolver-cart-gateway.js +2 -25
- package/cart/hooks/use-buy-now.js +1 -4
- package/chunk-ACQS4AG5.mjs +592 -0
- package/{chunk-VKO7P3ED.mjs → chunk-C37TXOGI.mjs} +3 -10
- package/chunk-EUIVDITZ.mjs +15 -0
- package/{chunk-7OPH5UFQ.mjs → chunk-GZWV5XKV.mjs} +4 -5
- package/chunk-SSBIMQES.mjs +755 -0
- package/chunk-VVB7BEDE.mjs +84 -0
- package/chunk-ZKAX2FW3.mjs +703 -0
- package/gateways/canopy-api.d.ts +0 -6
- package/gateways/canopy-api.js +1 -8
- package/lib/buildMetadata.js +3 -3
- package/loaders/collection-loader-args.d.ts +1 -2
- package/loaders/collection-products-loader-args.d.ts +1 -2
- package/loaders/product-loader-args.d.ts +1 -2
- package/package.json +4 -8
- package/providers/replo-provider.d.ts +1 -5
- package/providers/replo-provider.js +2 -5
- package/_vendor/schemas/generated/storefrontCountryCode.d.ts +0 -10
- package/cart/cart-country-context.d.ts +0 -2
- package/cart/cart-country-context.js +0 -6
- package/chunk-AL3F36PH.mjs +0 -1392
- package/chunk-GV5FY7ZZ.mjs +0 -78
- package/loaders/markets.d.ts +0 -1
- package/loaders/markets.js +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { pickBy_default } from './chunk-ACQS4AG5.mjs';
|
|
2
|
+
import { isString_default, isNumber_default } from './chunk-EUIVDITZ.mjs';
|
|
3
|
+
import { isObject_default } from './chunk-SSBIMQES.mjs';
|
|
4
|
+
|
|
5
|
+
var has = Object.prototype.hasOwnProperty;
|
|
6
|
+
function dequal(foo, bar) {
|
|
7
|
+
var ctor, len;
|
|
8
|
+
if (foo === bar) return true;
|
|
9
|
+
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
10
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
11
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
12
|
+
if (ctor === Array) {
|
|
13
|
+
if ((len = foo.length) === bar.length) {
|
|
14
|
+
while (len-- && dequal(foo[len], bar[len])) ;
|
|
15
|
+
}
|
|
16
|
+
return len === -1;
|
|
17
|
+
}
|
|
18
|
+
if (!ctor || typeof foo === "object") {
|
|
19
|
+
len = 0;
|
|
20
|
+
for (ctor in foo) {
|
|
21
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
22
|
+
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
23
|
+
}
|
|
24
|
+
return Object.keys(bar).length === len;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return foo !== foo && bar !== bar;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function forEachPrimitiveValue({
|
|
31
|
+
target,
|
|
32
|
+
fn,
|
|
33
|
+
valueConversionFunction
|
|
34
|
+
}) {
|
|
35
|
+
if (!target) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
for (const [key, value] of Object.entries(target)) {
|
|
39
|
+
if (isObject_default(value)) {
|
|
40
|
+
const newTarget = valueConversionFunction ? valueConversionFunction(value) : value;
|
|
41
|
+
forEachPrimitiveValue({ target: newTarget, fn });
|
|
42
|
+
}
|
|
43
|
+
if (isString_default(value) || isNumber_default(value)) {
|
|
44
|
+
fn(value, key, target);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function shallowEqual(objA, objB) {
|
|
49
|
+
if (Object.is(objA, objB)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const keysA = Object.keys(objA);
|
|
56
|
+
const keysB = Object.keys(objB);
|
|
57
|
+
if (keysA.length !== keysB.length) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
for (let i = 0; i < keysA.length; i++) {
|
|
61
|
+
const currentKey = keysA[i];
|
|
62
|
+
if (!Object.hasOwnProperty.call(objB, currentKey) ||
|
|
63
|
+
!Object.is(objA[currentKey], objB[currentKey])) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
var deepEqual = dequal;
|
|
70
|
+
function omit(obj, keysToOmit) {
|
|
71
|
+
const result = { ...obj };
|
|
72
|
+
for (const key of keysToOmit) {
|
|
73
|
+
delete result[key];
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
function filterUndefined(data) {
|
|
78
|
+
return pickBy_default(data, (value) => value !== void 0);
|
|
79
|
+
}
|
|
80
|
+
function toNullableIfDefined(value) {
|
|
81
|
+
return value === void 0 ? void 0 : value ?? null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { deepEqual, filterUndefined, forEachPrimitiveValue, omit, shallowEqual, toNullableIfDefined };
|