When running tests in wallaby the setTimeout[util.promisify.custom] property is missing, which causes util.promisify to fail.
Running this gist with the command line npm test will result in a passing test.
| console.log('bookmarklet'); |
| <html> | |
| <head> | |
| <style> | |
| em:before, | |
| em:after{ | |
| content: " "; | |
| display: block; | |
| top:0; | |
| bottom: 0; |
| Array.from(s.split(/\W+/) | |
| .map(a => a.toLowerCase()) | |
| .reduce((p, v) => p.set(v, (p.has(v)?p.get(v):0)+1), new Map()) | |
| .entries() | |
| ) | |
| .sort((a,b) => b[1]-a[1]) | |
| .forEach(a => console.log(`${a[0]}:${a[1]}`)); |
When running tests in wallaby the setTimeout[util.promisify.custom] property is missing, which causes util.promisify to fail.
Running this gist with the command line npm test will result in a passing test.
| function getTermKey(term) { | |
| return term | |
| .normalize('NFD') | |
| .replace(/[\u0300-\u036f]/g, "") | |
| .replace(/[^\w]/g, "") | |
| .toLowerCase() | |
| }; | |
| function getTermsIn(document) { | |
| return document.split(/[\s_():.!?,;]+/) |
| function bitLength(number) { | |
| return Math.floor(Math.log2(number)) + 1; | |
| } | |
| function byteLength(number) { | |
| return Math.ceil(bitLength(number) / 8); | |
| } | |
| function toBytes(number) { | |
| if (!Number.isSafeInteger(number)) { |
| (function(doc) { | |
| const TWO_PI = Math.PI * 2; | |
| const HALF_PI = Math.PI / 2; | |
| const RADIUS_SCALE = 0.05; | |
| const RADIUS_SD = 15; | |
| const POLYGON_SIDES = 5; | |
| const POSITION_SD = 0.04; | |
| const BASE_DEFORMATIONS = 3; | |
| const LAYER_DEFORMATIONS = 3; | |
| const LAYERS = 40; |
| console.log(process.argv.slice(2).map(b=>[...b].reduce((a,b)=>2*a+("."==b?1:2),0)).map(a=>"-etianmsurwdkgohvf-l-pjbxcyzq--54-3---2--+----16=/-----7---8-90"[a]).join('')) |
| (function () { | |
| var interval = setInterval(function () { | |
| var [, xid] = (document.cookie.match(/CN_xi_d=([^;]+)/) || []); | |
| xid = xid || window._4d && window._4d.user && window._4d.user.xid; | |
| if (xid) { | |
| permutive.identify([ | |
| { | |
| id: xid, | |
| tag: 'xid' | |
| } |
| /* | |
| || Compression and decompression using a combination of | |
| || Variable-length Quantity(VLQ) and Delta encoding to encode the "Additional | |
| || Consent" (AC) string required by Google’s Additional Consent Mode technical | |
| || specification https://support.google.com/admanager/answer/9681920?hl=en | |
| || | |
| || vendorIds.compress(input) | |
| || input - A string of "." delimited list if ids in ascending order. | |
| || | |
| || vendorIds.decompress(input) |