Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const merge = require('lodash.merge');
const forEach = require('lodash.foreach');
const path = require('path');
const browsertime = require('browsertime');
const set = require('lodash.set');
const get = require('lodash.get');
const coach = require('webcoach');
const browserScripts = browsertime.browserScripts;
const defaultBrowsertimeOptions = {
statistics: true
};
const iphone6UserAgent =
'Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 ' +
'(KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25';
async function parseUserScripts(scripts) {
if (!Array.isArray(scripts)) scripts = [scripts];
const allUserScripts = {};
for (let script of scripts) {
let myScript = await browserScripts.findAndParseScripts(
path.resolve(script),
'custom'