@denimlabs/fb-position-validation
Advanced tools
Comparing version 1.0.5 to 1.0.6
46
index.js
@@ -136,3 +136,6 @@ const AwarenessPlacments = { | ||
isDefined(facebook_positions) && | ||
!(Array.isArray(facebook_positions) && facebook_positions.length === 0) | ||
!( | ||
Array.isArray(facebook_positions) && | ||
(facebook_positions || []).length === 0 | ||
) | ||
) { | ||
@@ -155,3 +158,3 @@ // if facebook_positions are set, make sure they are in the valid list | ||
if ( | ||
device_platforms.length === 0 || | ||
(device_platforms || []).length === 0 || | ||
device_platforms.includes('mobile') | ||
@@ -177,3 +180,6 @@ ) { | ||
if (device_platforms.length > 0 && !device_platforms.includes('mobile')) { | ||
if ( | ||
(device_platforms || []).length > 0 && | ||
!device_platforms.includes('mobile') | ||
) { | ||
throw Error( | ||
@@ -191,3 +197,6 @@ 'when using instant_article you can not select only desktop.' | ||
} | ||
if (device_platforms.length > 0 && !device_platforms.includes('mobile')) { | ||
if ( | ||
(device_platforms || []).length > 0 && | ||
!device_platforms.includes('mobile') | ||
) { | ||
throw Error('when using marketplace you can not select only desktop.') | ||
@@ -200,3 +209,3 @@ } | ||
// VALIDATE Instagram Positions | ||
if (instagram_positions.length > 0) { | ||
if ((instagram_positions || []).length > 0) { | ||
if (!containsOnlyValid(instagram_positions, VALID_INSTAGRAM_POSTIONS)) { | ||
@@ -219,3 +228,3 @@ throw Error( | ||
// VALIDATE Audience Network Positions | ||
if (audience_network_positions.length > 0) { | ||
if ((audience_network_positions || []).length > 0) { | ||
if ( | ||
@@ -234,3 +243,3 @@ !containsOnlyValid( | ||
if (messenger_positions.length > 0) { | ||
if ((messenger_positions || []).length > 0) { | ||
if (!containsOnlyValid(messenger_positions, VALID_MESSENGER_POSITIONS)) { | ||
@@ -245,3 +254,3 @@ throw Error( | ||
if ( | ||
publisher_platforms.length > 0 && | ||
(publisher_platforms || []).length > 0 && | ||
!publisher_platforms.includes('facebook') | ||
@@ -254,3 +263,3 @@ ) { | ||
if ( | ||
facebook_positions.length > 0 && | ||
(facebook_positions || []).length > 0 && | ||
!facebook_positions.includes('feed') | ||
@@ -262,3 +271,6 @@ ) { | ||
if (device_platforms.length > 0 && !device_platforms.includes('mobile')) { | ||
if ( | ||
(device_platforms || []).length > 0 && | ||
!device_platforms.includes('mobile') | ||
) { | ||
throw Error( | ||
@@ -282,3 +294,3 @@ 'when using messenger_positions you can not select only desktop.' | ||
if ( | ||
publisher_platforms.length > 0 && | ||
(publisher_platforms || []).length > 0 && | ||
!publisher_platforms.includes('facebook') | ||
@@ -314,3 +326,3 @@ ) { | ||
if ( | ||
device_platforms.length > 0 && | ||
(device_platforms || []).length > 0 && | ||
!containsOnlyValid(device_platforms, validDevicePlatforms) | ||
@@ -329,3 +341,3 @@ ) { | ||
if ( | ||
publisher_platforms.length > 0 && | ||
(publisher_platforms || []).length > 0 && | ||
!containsOnlyValid(publisher_platforms, validPublisherPlatforms) | ||
@@ -354,3 +366,3 @@ ) { | ||
if (facebook_positions.length > 0) { | ||
if ((facebook_positions || []).length > 0) { | ||
if (!containsOnlyValid(facebook_positions, validFacebookPositions)) { | ||
@@ -361,3 +373,3 @@ throw Error('Invalid facebook_positions for this objective') | ||
if (instagram_positions.length > 0) { | ||
if ((instagram_positions || []).length > 0) { | ||
if (!containsOnlyValid(instagram_positions, validInsagramPositions)) { | ||
@@ -368,3 +380,3 @@ throw Error('Invalid instagram_positions for this objective') | ||
if (audience_network_positions.length > 0) { | ||
if ((audience_network_positions || []).length > 0) { | ||
if ( | ||
@@ -380,3 +392,3 @@ !containsOnlyValid( | ||
if (messenger_positions.length > 0) { | ||
if ((messenger_positions || []).length > 0) { | ||
if (!containsOnlyValid(messenger_positions, validMessengerPositions)) { | ||
@@ -383,0 +395,0 @@ throw Error('Invalid messenger_positions for this objective') |
{ | ||
"name": "@denimlabs/fb-position-validation", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Validate facebook positions against denim campaign objectives.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55896
893