Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vtex/delivery-packages

Package Overview
Dependencies
Maintainers
20
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtex/delivery-packages - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

31

dist/index.esm.js

@@ -10,2 +10,3 @@ const {

shippingEstimate: true,
deliveryChannel: true,
};

@@ -95,3 +96,4 @@

if (
criteria.selectedSla && pack.deliveryChannel !== item.deliveryChannel
criteria.deliveryChannel &&
pack.deliveryChannel !== item.deliveryChannel
) {

@@ -135,6 +137,9 @@ return false

slas: item.slas,
pickupFriendlyName: criteria.selectedSla
? item.pickupFriendlyName
: undefined,
seller: criteria.seller ? item.item.seller : undefined,
address: criteria.selectedSla ? item.address : undefined,
selectedSla: criteria.selectedSla ? item.selectedSla : undefined,
deliveryChannel: criteria.selectedSla
deliveryChannel: criteria.deliveryChannel
? item.deliveryChannel

@@ -211,3 +216,10 @@ : undefined,

function getAddress({ itemIndex, logisticsInfo, selectedAddresses }) {
if (logisticsInfo[itemIndex].deliveryChannel === 'pickup-in-point') {
const selectedSla = getSelectedSla({
itemIndex,
logisticsInfo,
});
if (!selectedSla) return null
if (selectedSla.deliveryChannel === 'pickup-in-point') {
return getPickupAddress({ itemIndex, logisticsInfo })

@@ -221,7 +233,14 @@ }

function getLogisticsInfoData({ itemIndex, logisticsInfo }) {
const selectedSla = getSelectedSla({
itemIndex,
logisticsInfo,
});
return {
selectedSla: logisticsInfo[itemIndex].selectedSla,
shippingEstimate: logisticsInfo[itemIndex].shippingEstimate,
shippingEstimateDate: logisticsInfo[itemIndex].shippingEstimateDate,
deliveryChannel: logisticsInfo[itemIndex].deliveryChannel,
shippingEstimate: selectedSla ? selectedSla.shippingEstimate : undefined,
shippingEstimateDate: selectedSla
? selectedSla.shippingEstimateDate
: undefined,
deliveryChannel: logisticsInfo[itemIndex].selectedDeliveryChannel,
deliveryWindow: logisticsInfo[itemIndex].deliveryWindow,

@@ -228,0 +247,0 @@ slas: logisticsInfo[itemIndex].slas,

@@ -12,2 +12,3 @@ 'use strict';

shippingEstimate: true,
deliveryChannel: true,
};

@@ -97,3 +98,4 @@

if (
criteria.selectedSla && pack.deliveryChannel !== item.deliveryChannel
criteria.deliveryChannel &&
pack.deliveryChannel !== item.deliveryChannel
) {

@@ -137,6 +139,9 @@ return false

slas: item.slas,
pickupFriendlyName: criteria.selectedSla
? item.pickupFriendlyName
: undefined,
seller: criteria.seller ? item.item.seller : undefined,
address: criteria.selectedSla ? item.address : undefined,
selectedSla: criteria.selectedSla ? item.selectedSla : undefined,
deliveryChannel: criteria.selectedSla
deliveryChannel: criteria.deliveryChannel
? item.deliveryChannel

@@ -213,3 +218,10 @@ : undefined,

function getAddress({ itemIndex, logisticsInfo, selectedAddresses }) {
if (logisticsInfo[itemIndex].deliveryChannel === 'pickup-in-point') {
const selectedSla = getSelectedSla({
itemIndex,
logisticsInfo,
});
if (!selectedSla) return null
if (selectedSla.deliveryChannel === 'pickup-in-point') {
return getPickupAddress({ itemIndex, logisticsInfo })

@@ -223,7 +235,14 @@ }

function getLogisticsInfoData({ itemIndex, logisticsInfo }) {
const selectedSla = getSelectedSla({
itemIndex,
logisticsInfo,
});
return {
selectedSla: logisticsInfo[itemIndex].selectedSla,
shippingEstimate: logisticsInfo[itemIndex].shippingEstimate,
shippingEstimateDate: logisticsInfo[itemIndex].shippingEstimateDate,
deliveryChannel: logisticsInfo[itemIndex].deliveryChannel,
shippingEstimate: selectedSla ? selectedSla.shippingEstimate : undefined,
shippingEstimateDate: selectedSla
? selectedSla.shippingEstimateDate
: undefined,
deliveryChannel: logisticsInfo[itemIndex].selectedDeliveryChannel,
deliveryWindow: logisticsInfo[itemIndex].deliveryWindow,

@@ -230,0 +249,0 @@ slas: logisticsInfo[itemIndex].slas,

{
"name": "@vtex/delivery-packages",
"version": "2.0.0",
"version": "2.1.0",
"description": "",

@@ -15,5 +15,15 @@ "main": "dist/index.js",

},
"keywords": [],
"author": "Breno Calazans (@klzns)",
"keywords": [
"vtex",
"delivery"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/vtex/delivery-packages.git"
},
"bugs": {
"url": "https://github.com/vtex/delivery-packages/issues"
},
"homepage": "https://github.com/vtex/delivery-packages#readme",
"devDependencies": {

@@ -20,0 +30,0 @@ "babel-core": "6",

@@ -114,3 +114,4 @@ # delivery-packages

seller: true,
shippingEstimate: true
shippingEstimate: true,
deliveryChannel: true
}

@@ -130,2 +131,3 @@ ```

seller: String,
items: [Object],
package: Object,

@@ -148,2 +150,6 @@ selectedSla: String,

#### items
The items of the package.
#### seller

@@ -150,0 +156,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc