Before Starting
Install Command Line Tools for macOS:
xcode-select --install
export default new Proxy( | |
Object.entries({ | |
reset: 0, | |
bold: 1, | |
dim: 2, | |
underline: 4, | |
blink: 5, | |
invert: 7, | |
hidden: 8, | |
black: 30, |
( | |
( | |
d, | |
c = d.createElement('b').style, | |
a = c.gap = 0, | |
polyfillList = new WeakMap, | |
ungapful = /^(normal|0px)+$/, | |
polyfillNode = element => { | |
if (polyfillList.has(element)) return | |
polyfillList.set(element, true) |
Install Command Line Tools for macOS:
xcode-select --install
/** Returns a unique identifier tied to the document in the window on which it was created. */ | |
const createObjectUID = (): string => URL.createObjectURL(new Blob()).slice(-5) |
/** Returns a new object with all entries that pass the test implemented by the provided function. */ | |
function filteredObject<T>(object: { [s: string]: T } | ArrayLike<T>, predicate: (value: T, name: string, array: [string, T][]) => unknown): { [s: string]: T } { | |
const newObject = Object.create(Object(object).prototype) | |
const entries = Object.entries(object) | |
for (const [name, value] of entries) { | |
if (predicate(value, name, entries)) { | |
Reflect.set(newObject, name, Reflect.get(object, name)) | |
} | |
} | |
return newObject |
The createFragment
function returns an HTML fragment from a string.
[
{ name: 'Hedral', coat: 'Tuxedo', legs: 4 },
{ name: 'Pillar', coat: 'Ticked Tabby', legs: 3 },
].reduce(
(table, { name, coat, legs }) => {
HTMLSelectorSlotElement = ((internal, filter) => class HTMLSelectorSlotElement extends HTMLElement { | |
constructor() { | |
internal.set(super(), [ | |
this.attachShadow({ mode: 'open' }), | |
document.createElement('slot'), | |
document.createElement('slot'), | |
new MutationObserver(HTMLSelectorSlotElement.prototype.connectedCallback.bind(this)), | |
[] | |
]) | |
} |
Should there be a need to fetch web platform data in NodeJS, here are some dependency-less functions that will return feature data from W3C, CanIUse, and MDN Browser Compatibility Data.
NodeJS includes an http
and https
library which can perform network requests.
const https = require('https')
[ | |
{ | |
"type": "Comment", | |
"value": "\n augmented-ui\n BSD 2-Clause License\n Copyright (c) James0x57, PropJockey, 2019\n", | |
"delimiterStart": "/*", | |
"delimiterEnd": "*/" | |
}, | |
{ | |
"type": "Space", |
This work was moved to https://github.com/csstools/tokenizer