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
| // Create Permissions | |
| const copy = require('copyFromWindow'); | |
| const set = require('setInWindow'); | |
| const alias = require('aliasInWindow'); | |
| const queue = require('createQueue'); | |
| const call = require('callInWindow'); | |
| const map = require('makeTableMap'); | |
| const log = require('logToConsole'); | |
| const script = require('injectScript'); |
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
| // Add Permissions | |
| const map = require('makeTableMap'); | |
| const log = require('logToConsole'); | |
| const send = require('injectScript'); | |
| // Get Properties | |
| const props = data.propertyList ? map(data.propertyList, 'name', 'value') : {}; | |
| // Build Url | |
| let url = '//tag.yieldoptimizer.com/ps/ps?t=s'; |
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
| // Add Permissions | |
| const map = require('makeTableMap'); | |
| const log = require('logToConsole'); | |
| const send = require('injectScript'); | |
| // Get Properties | |
| const props = data.propertyList ? map(data.propertyList, 'name', 'value') : {}; | |
| // Build Url | |
| let url = '//beacon.sojern.com/pixel/p/' + data.pixelId + '?f_v=v6_js&p_v=3'; |
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 isBoolean = val => typeof val === 'boolean'; | |
| isBoolean(null); // false | |
| isBoolean(false); // true |
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 isBeforeDate = (dateA, dateB) => dateA < dateB; | |
| isBeforeDate(new Date(2010, 10, 20), new Date(2010, 10, 21)); // true |
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 isArrayLike = obj => obj != null && typeof obj[Symbol.iterator] === 'function'; | |
| isArrayLike(document.querySelectorAll('.className')); // true | |
| isArrayLike('abc'); // true | |
| isArrayLike(null); // false |
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 isAnagram = (str1, str2) => { | |
| const normalize = str => | |
| str | |
| .toLowerCase() | |
| .replace(/[^a-z0-9]/gi, '') | |
| .split('') | |
| .sort() | |
| .join(''); | |
| return normalize(str1) === normalize(str2); | |
| }; |
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 isAfterDate = (dateA, dateB) => dateA > dateB; | |
| isAfterDate(new Date(2010, 10, 21), new Date(2010, 10, 20)); // true |
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 is = (type, val) => ![, null].includes(val) && val.constructor === type; | |
| is(Array, [1]); // true | |
| is(ArrayBuffer, new ArrayBuffer()); // true | |
| is(Map, new Map()); // true | |
| is(RegExp, /./g); // true | |
| is(Set, new Set()); // true | |
| is(WeakMap, new WeakMap()); // true | |
| is(WeakSet, new WeakSet()); // true | |
| is(String, ''); // true |
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 intersectionWith = (a, b, comp) => a.filter(x => b.findIndex(y => comp(x, y)) !== -1); | |
| intersectionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)); // [1.5, 3, 0] |
NewerOlder