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 HandlerID = Symbol() | |
export function defineEvent(obj, name) { | |
const handlers = new Set() | |
const fn = function () { | |
for (const handler of handlers) { | |
try { | |
handler() | |
} catch (e) { | |
Promise.reject(e) |
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
/** | |
* some insane hack, just want to avoid using expensive parser. | |
*/ | |
export function getFreeVariables(expr:string, knownSymbols:Record<string,unknown>){ | |
const freeVariables = new Set<string>(); | |
//eslint-disable-next-line | |
const anyThingPrimitive = ()=>{}; |
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 * as React from "react" | |
import { BehaviorSubject } from 'rxjs'; | |
const ERROR_DETAIL = Symbol("errors") | |
const HAS_ERROR = Symbol("has error") | |
const InternalSymbolKeys = [ERROR_DETAIL,HAS_ERROR] | |
enum FieldType { | |
arrayItem, |
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
/** | |
* @file 在内存中打包 zip 文件的类,需要设置 `/var/run/${namespace}` 的权限为777 | |
* @author [email protected] | |
*/ | |
import * as fs from 'fs'; | |
import * as path from 'path'; | |
import * as mkdirp from 'mkdirp'; | |
import * as archiver from 'archiver'; | |
import * as copydir from 'copy-dir'; |
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
#!/bin/bash | |
TEMPDIR=`mktemp -d` | |
ESLINTRC=$TEMPDIR/.eslintrc | |
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'" | |
git show HEAD:.eslintrc > $ESLINTRC | |
echo "### Ensure changes follow our code style... ####" | |
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive |
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
#!/bin/bash | |
TEMPDIR=`mktemp -d` | |
ESLINTRC=$TEMPDIR/.eslintrc | |
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'" | |
git show HEAD:.eslintrc > $ESLINTRC | |
echo "### Ensure changes follow our code style... ####" | |
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive |