Run the benchmark:
$ npm i benchmark
# Run the AsyncLocalStorage benchmark
$ node async-local-storage.js ASL
ASL x 15,551 ops/sec ±3.30% (79 runs sampled)
npx lint-staged |
type RecursiveRequired<T> = Required<{ | |
[P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P]; | |
}>; | |
type ExampleType = { | |
a?: number; | |
b: number; | |
c?: { | |
d?: { | |
e?: number; |
/** private type, not exported */ | |
declare type NonObject = undefined | null | boolean | string | number | Function; | |
/** | |
* This type allows you to mark an object with | |
* optional properties as required. | |
*/ | |
export declare type Complete<T> = { | |
[K in keyof T]-?: T[K]; | |
} | |
/** |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
/** | |
* @author Boggddan <github.com/boggddan> | |
* Запускается в браузерах которые не поддерживают свойство background-blend-mode. | |
* Полифил применяется к тегам помеченым атрибутом `data-background-blend-mode` в свойтвах которого нужно передать режим смешивания. | |
* Поддерживается: normal, multiply, lighten, screen, darken. (протестировано в IE 11) | |
* @example: <div data-background-blend-mode="multiply"></div> | |
*/ | |
/* Element.prepend polyfill for IE 11 */ | |
function prependPolyfill() { |
const delay = (time) => { | |
return new Promise(resolve => setTimeout(resolve, time)); | |
}; | |
const serviceFactory = (timeout) => { | |
return async () => { | |
await delay(timeout); | |
return timeout; | |
}; | |
}; |