@denimlabs/media-validation-engine
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -14,2 +14,3 @@ "use strict"; | ||
exports.isVideoInstagramStoriesValid = isVideoInstagramStoriesValid; | ||
exports.isVideoInstagramFeedValid = isVideoInstagramFeedValid; | ||
exports.isVideoAudienceNetworkNativeBannerAndInterstitalValid = isVideoAudienceNetworkNativeBannerAndInterstitalValid; | ||
@@ -197,5 +198,27 @@ exports.isVideoAudienceNetworkInStreamValid = isVideoAudienceNetworkInStreamValid; | ||
function isVideoAudienceNetworkNativeBannerAndInterstitalValid(_ref9) { | ||
function isVideoInstagramFeedValid(_ref9) { | ||
var lengthInSeconds = _ref9.lengthInSeconds, | ||
fileSizeInBytes = _ref9.fileSizeInBytes; | ||
var minLength = 1; | ||
var maxLength = 120; | ||
var maxFileSize = (0, _utils.gbToBytes)(4); | ||
if (lengthInSeconds < minLength) { | ||
return false; | ||
} | ||
if (lengthInSeconds > maxLength) { | ||
return false; | ||
} | ||
if (fileSizeInBytes > maxFileSize) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
function isVideoAudienceNetworkNativeBannerAndInterstitalValid(_ref10) { | ||
var lengthInSeconds = _ref10.lengthInSeconds, | ||
fileSizeInBytes = _ref10.fileSizeInBytes; | ||
var minLength = 10; | ||
@@ -220,5 +243,5 @@ var maxLength = 121; | ||
function isVideoAudienceNetworkInStreamValid(_ref10) { | ||
var lengthInSeconds = _ref10.lengthInSeconds, | ||
fileSizeInBytes = _ref10.fileSizeInBytes; | ||
function isVideoAudienceNetworkInStreamValid(_ref11) { | ||
var lengthInSeconds = _ref11.lengthInSeconds, | ||
fileSizeInBytes = _ref11.fileSizeInBytes; | ||
var minLength = 5; | ||
@@ -243,5 +266,5 @@ var maxLength = 30; | ||
function isVideoMessengerInboxValid(_ref11) { | ||
var lengthInSeconds = _ref11.lengthInSeconds, | ||
fileSizeInBytes = _ref11.fileSizeInBytes; | ||
function isVideoMessengerInboxValid(_ref12) { | ||
var lengthInSeconds = _ref12.lengthInSeconds, | ||
fileSizeInBytes = _ref12.fileSizeInBytes; | ||
var minLength = 1; | ||
@@ -248,0 +271,0 @@ var maxLength = (0, _utils.minutesToSeconds)(240); |
{ | ||
"name": "@denimlabs/media-validation-engine", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "run validation rules against various ad network placements. Specific to facebook, instagram, messenger, single image, carousel images, and video formats.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -45,2 +45,3 @@ import { | ||
isVideoInstagramStoriesValid, | ||
isVideoInstagramFeedValid, | ||
isVideoAudienceNetworkNativeBannerAndInterstitalValid, | ||
@@ -47,0 +48,0 @@ isVideoAudienceNetworkInStreamValid, |
@@ -187,2 +187,25 @@ import { minutesToSeconds, gbToBytes } from './utils' | ||
export function isVideoInstagramFeedValid ({ | ||
lengthInSeconds, | ||
fileSizeInBytes, | ||
}) { | ||
const minLength = 1 | ||
const maxLength = 120 | ||
const maxFileSize = gbToBytes(4) | ||
if (lengthInSeconds < minLength) { | ||
return false | ||
} | ||
if (lengthInSeconds > maxLength) { | ||
return false | ||
} | ||
if (fileSizeInBytes > maxFileSize) { | ||
return false | ||
} | ||
return true | ||
} | ||
export function isVideoAudienceNetworkNativeBannerAndInterstitalValid ({ | ||
@@ -189,0 +212,0 @@ lengthInSeconds, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
278691
4026