This file contains 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
/** | |
* Detects if an adblocker exists | |
* | |
* @example | |
* adblockerDetectAsync() | |
* .then(() => console.log('Detected adblocker:', hasAdblocker)) | |
* .catch((err) => console.error('[adblockerDetectAsync]', err)); | |
* | |
* @returns {Promise<boolean>} Returns a Returns a {@link Promise|Promise} that resolves with either true, if an adblocker exists; otherwise, false | |
*/ |
This file contains 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
// Found similar article URL: https://humanwhocodes.com/blog/2009/08/11/timed-array-processing-in-javascript/ | |
function createProcessingQueue(onHandleItem, onHandleTimeout, timeout = 50) { | |
const state = { | |
queue: [], | |
timerId: 0, | |
} | |
const api = { | |
push(...args) { |
This file contains 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
// NOTE: The following is a non-spec compliant Promise implementation | |
// Utils | |
const asyncRun = createAsyncRunner() | |
const isFunction = fn => typeof fn === 'function' | |
const isObject = obj => Object(obj) === obj | |
const noop = () => {} | |
const STATE_PENDING = 'pending' |
This file contains 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
// For Quokka, as localStorage is not available in Node.js | |
const localStorage = { | |
getItem(name) { | |
return localStorage[name]; | |
}, | |
setItem(name, value) { | |
localStorage[name] = value; | |
}, | |
}; |
This file contains 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
<script> | |
window.addEventListener('error', (event) => { | |
const { message, filename, lineno, colno, error } = event; | |
console.log('Captured uncaught error:', message, filename, lineno, colno, error.stack); | |
}); | |
setTimeout(() => { | |
try { | |
throw new Error('An unexpected error occurred (2)'); | |
} catch (ex) { |
This file contains 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
// Guard a function, with optional zone information. | |
// Note: Any function which is guarded inside an already guarded function | |
// and does not provide any zone information, will inherit from the outer | |
// guarded function | |
const defaultName = '<root>'; | |
guard._zone = { | |
name: defaultName, | |
// Hidden property, due to being prefixed with "$" |
This file contains 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
// https://github.com/angular/zone.js/blob/2b3779d39a8f1930f59911c0d7e9e827f0fb5bc9/zone.js | |
// https://github.com/angular/zone.js/blob/d40a9376a825c702335d03e4122be8518e636791/zone.js | |
// https://github.com/angular/zone.js/blob/bee8a60d918fd6d737f8f525cb8d886f69bf06af/lib/zone.ts | |
// https://github.com/angular/zone.js/blob/3ad2445da420da2ede9cdb28c62986e86694a6fe/lib/core.ts | |
var Zone = (function Zone() { | |
// https://domenic.github.io/zones/#sec-zone-constructor | |
function Zone(parent, zoneSpec) { | |
zoneSpec = zoneSpec !== undefined ? zoneSpec : {}; |
This file contains 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
https://github.com/Microsoft/monaco-editor | |
https://github.com/fczbkk/css-selector-generator | |
https://github.com/ericclemmons/unique-selector | |
https://github.com/bertyhell/cheerio-get-css-selector/blob/master/src/get-unique-selector.js | |
https://github.com/rollup/rollupjs.org/blob/f717def625241f4f70810fdc4b07cc0d6ed80b44/universal/routes/Repl/index.html | |
https://preactjs.com/ |
This file contains 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
/* eslint-disable */ | |
var app = { | |
utils: { | |
isArray() { | |
return Array.isArray | |
}, | |
each(arr, fn) { | |
return arr.forEach(fn); | |
}, |
This file contains 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 parse5 = require('parse5'); | |
const document = parse5.parse(` | |
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1 "j"="k">My First Heading</h1> | |
<script>var x = 1 | |
console.log('') |
NewerOlder