Skip to content

Commit fc7cb85

Browse files
committed
Clean up
Cleaned the code a bit, removed console logs and comments. Also removed the "hh:mm:ss" format check in getSkipOffsetValue function in vast-maker.js.
1 parent b5ee9c7 commit fc7cb85

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

utils/vast-maker.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ const DEFAULT_AD_LIST = [
8686
*
8787
*/
8888
function VastBuilder(params) {
89-
console.log("VastBuilder params: ", params);
9089
let vastObject = {};
9190
let adList = [];
9291
let vast = null;
@@ -352,16 +351,13 @@ function indexOfSmallest(a) {
352351
return lowest;
353352
}
354353

355-
// Validate that params.skipoffset is a valid VAST skipoffset value ("x%" or "hh:mm:ss").
356354
function getSkipOffsetValue(skipoffset) {
357-
// "hh:mm:ss"
358-
const timeFormatRegex = /^(\d{2}):([0-5][0-9]):([0-5][0-9])$/;
359355
// "x%"
360356
const percentageFormatRegex = /^(100|[1-9]?[0-9])%$/;
361357
// "seconds"
362358
const integerSecondsRegex = /^\d+$/;
363359

364-
if (timeFormatRegex.test(skipoffset) || percentageFormatRegex.test(skipoffset)){
360+
if (percentageFormatRegex.test(skipoffset)){
365361
return skipoffset;
366362
}
367363
// convert seconds to "hh:mm:ss" format

utils/vmap-maker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ function VmapBuilder(params) {
9191

9292
const breakpoints = params.breakpoints ? params.breakpoints.split(",").filter((item) => !isNaN(Number(item))) : [];
9393
if (params.preroll) {
94-
//console.log("PARAMS: ",params.generalVastConfigs);
9594
const preVast = VastBuilder(defaultConfigs);
9695
vmap.attachAdBreak("preroll.ad", "linear", "start", preVast.xml, {
9796
sessionId: GVC.sessionId,

0 commit comments

Comments
 (0)