@anker-in/shopify-sdk 1.1.1 → 1.1.2-beta.2
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/index.d.mts +215 -215
- package/dist/index.d.ts +215 -215
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1427,7 +1427,7 @@ function isVariantAvailable(variant) {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
function normalizeLineItem(line) {
|
|
1429
1429
|
const { id, merchandise: variant, quantity, discountAllocations, attributes, cost } = line;
|
|
1430
|
-
const price = variant?.price?.amount
|
|
1430
|
+
const price = variant?.price?.amount;
|
|
1431
1431
|
const name = variant?.product?.title || "";
|
|
1432
1432
|
return {
|
|
1433
1433
|
id,
|
|
@@ -1435,8 +1435,8 @@ function normalizeLineItem(line) {
|
|
|
1435
1435
|
quantity,
|
|
1436
1436
|
variantId: String(variant?.id || ""),
|
|
1437
1437
|
productId: String(variant?.product?.id || ""),
|
|
1438
|
-
totalAmount: cost?.totalAmount?.amount
|
|
1439
|
-
subtotalAmount: cost?.subtotalAmount?.amount
|
|
1438
|
+
totalAmount: cost?.totalAmount?.amount,
|
|
1439
|
+
subtotalAmount: cost?.subtotalAmount?.amount,
|
|
1440
1440
|
discountAllocations: discountAllocations?.map((item) => ({
|
|
1441
1441
|
title: item?.title || "",
|
|
1442
1442
|
code: item?.code || "",
|
|
@@ -1446,7 +1446,7 @@ function normalizeLineItem(line) {
|
|
|
1446
1446
|
variant: {
|
|
1447
1447
|
id: String(variant?.id || ""),
|
|
1448
1448
|
price,
|
|
1449
|
-
listPrice: variant?.compareAtPrice?.amount
|
|
1449
|
+
listPrice: variant?.compareAtPrice?.amount,
|
|
1450
1450
|
sku: variant?.sku ?? "",
|
|
1451
1451
|
name: variant?.title || "",
|
|
1452
1452
|
image: variant?.image ? {
|
|
@@ -1460,9 +1460,9 @@ function normalizeLineItem(line) {
|
|
|
1460
1460
|
weight: variant?.weight || 0,
|
|
1461
1461
|
metafields: normalizeMetafields(variant?.metafields)
|
|
1462
1462
|
},
|
|
1463
|
+
amountPerQuantity: cost?.amountPerQuantity?.amount,
|
|
1463
1464
|
product: normalizeProduct(variant?.product),
|
|
1464
1465
|
path: `/${variant?.product?.handle || ""}`,
|
|
1465
|
-
discounts: [],
|
|
1466
1466
|
options: variant?.title === "Default Title" ? [] : variant?.selectedOptions || []
|
|
1467
1467
|
};
|
|
1468
1468
|
}
|