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
type State = { | |
added: boolean; | |
interval: false | ReturnType<typeof setInterval>; | |
inFrame: boolean; | |
callbacks: Array<SetFocusedCallback>; | |
}; | |
type EnrichedHTMLIFrameElement = HTMLIFrameElement & { ___onWindowFocusHandled: boolean }; | |
type SetFocusedCallback = (focused?: boolean) => void; |
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
alias nr="npm run" | |
_npm_scripts() { | |
# check package.json file in current directory | |
if [ ! -f ./package.json ]; then | |
return | |
fi | |
local scripts="$(node -e 'const { scripts } = require(`./package.json`); if (!scripts) process.exit(); let a = Object.entries(scripts); for (let s in scripts) { console.log(s); }' | grep -E ^$2)" | |
local -a toks |