const obj = {
2: 3,
very: {
nested: {
object: {
here: '!'
}
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
// Credit to https://stackoverflow.com/a/49651719 and https://stackoverflow.com/a/60323358 | |
const isProxy = obj => { | |
try { | |
postMessage(obj, window); | |
} catch (error) { | |
return error && error.code === 25; | |
} | |
return 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 t1 = match(2) (_ => [ | |
[ | |
Number, | |
_ => 'number!' | |
], | |
[ | |
_ > 3, | |
_ => _ + 3 | |
], | |
[ |
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
export default strRegExp => { | |
const flags = strRegExp.replace(/.*\/([gimy]*)$/, '$1'); | |
const pattern = strRegExp.replace(new RegExp('^/(.*?)/'+flags+'$'), '$1'); | |
return new RegExp(pattern, flags); | |
} |
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
@media-unit: rem; | |
.with-unit(@v) { @r: ~'@{v}@{media-unit}'; } | |
@all: { | |
@value: 0; | |
@with-unit: auto; | |
width: auto; | |
media: ~'screen and (min-width: @{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
import AbortablePromise from './abortablePromise'; | |
export default function abortableFetch(input?: string | Request, init?: RequestInit) { | |
const signal = init ? init.signal : input ? input['signal'] : undefined; | |
const abortController = signal ? undefined : new AbortController(); | |
const promise = new AbortablePromise<Response>(fetch.apply(arguments), abortController); | |
if (signal) { | |
promise.signal = signal; |
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
- Ensure any install or build dependencies are removed before the end of the layer when doing a