This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
standalone:true, | |
src_folders:[ | |
'__nightwatch__/testOrchestration' | |
], | |
output_folder:'reports', | |
custom_assertions_path:'', | |
page_objects_path:'__nightwatch__/pageObjects', | |
globals_path:'', | |
selenium:{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const deepReplace = (obj: object, keyName: string, replacer: (from: any) => string) => { | |
for (const key in obj) { | |
if (key === keyName) { | |
obj[key] = replacer(obj[key]); | |
} else if (Array.isArray(obj[key])) { | |
(obj[key] as any[]).forEach(member => deepReplace(member, keyName, replacer)); | |
} else if (typeof obj[key] === "object") { | |
deepReplace(obj[key], keyName, replacer); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let funRun = (w1, w2, b) => { | |
let obj = {}; | |
obj.ga1 = w1 * -0.4 + w2 * 0.5 + b; | |
obj.ga2 = w1 * -0.8 + w2 * (-0.2) + b; | |
obj.gb1 = w1 * 0.5 + w2 * 1.2 + b; | |
obj.gb2 = w1 * -0.4 + w2 * 2.5 + b; | |
return obj; | |
} | |
nextIter = (w1, w2, b) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getUrlParams = locationSearch => locationSearch.substring(1).split('&') | |
.reduce((map, obj) => {let [a, b] = obj.split('='); map[a] = b; return map; }, {}); | |
/* | |
Example: | |
const params = getUrlParams(window.location.search); | |
Assuming window.location.search = ?a=b&c=d | |
Then: params = {a: 'b', c: 'd'} | |
*/ |
NewerOlder