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 target = { | |
name: 'Alice', | |
age: 30, | |
} | |
const handler = { | |
get: function(target, prop, receiver) { | |
console.log(`Getting property ${prop}`); | |
return Reflect.get(target, prop, receiver); |
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 target = { name: 'Alice', age: 30 }; | |
const handler = { | |
ownKeys: function(target) { | |
console.log('Getting property keys.'); | |
return Reflect.ownKeys(target); | |
} | |
}; | |
const proxy = new Proxy(target, handler); |
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 target = function(a, b) { | |
return a + b; | |
}; | |
const handler = { | |
apply: function(target, thisArg, argumentsList) { | |
console.log(`Called with arguments: ${argumentsList}`); | |
return target.apply(thisArg, argumentsList); | |
} | |
}; |
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 target = { name: 'Alice', age: 30 }; | |
const handler = { | |
deleteProperty: function(target, prop) { | |
console.log(`Deleting property ${prop}.`); | |
delete target[prop]; | |
return 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 target = { name: 'Alice', age: 30 }; | |
const handler = { | |
has: function(target, prop) { | |
console.log(`Checking if property ${prop} is in target.`); | |
return prop in target; | |
} | |
}; | |
const proxy = new Proxy(target, handler); |
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 target = { message: "Hello, World!" }; | |
const handler = { | |
set: function(target, prop, value, receiver) { | |
console.log(`Setting property ${prop} to ${value}.`); | |
target[prop] = value; | |
return 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 target = { message: "Hello, World!" }; | |
const handler = { | |
get: function(target, prop, receiver) { | |
console.log(`Property ${prop} was accessed.`); | |
return Reflect.get(target, prop, receiver); | |
} | |
}; | |
const proxy = new Proxy(target, handler); |
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
import fs from 'fs'; | |
import React from 'react'; | |
import 'jest-styled-components'; | |
// https://gist.github.com/helabenkhalfallah/6616ad01d544e1c1ed64f879c6e5e485 | |
import JestHelper from './JestHelper'; | |
const { | |
getHtmlPageWrapper, | |
getHtmlW3CComplianceMessage, | |
isHtmlW3CCompliant, |
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
// eslint-disable-next-line import/no-extraneous-dependencies | |
import ReactDOMServer from 'react-dom/server'; | |
import HtmlStringPrettifier from './HtmlStringPrettifier'; | |
const isHtmlW3CCompliant = (w3cValidation) => w3cValidation && !w3cValidation.error; | |
const getHtmlW3CComplianceMessage = ({ | |
html, | |
error, | |
}) => { |
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
import { | |
createSignal, | |
createResource, | |
For, | |
Match, | |
Switch, | |
Show, | |
} from "solid-js"; | |
import { render } from "solid-js/web"; |