UNPKG

edge-master

Version:
2 lines (1 loc) 214 B
"use strict";export class Task{constructor(e){this.do=e.do,this.when=e.when,this.doThen=e.doThen}async run(e){return this.when?this.when(e)?this.do(e):this.doThen?this.doThen(e):Promise.resolve(e.res):this.do(e)}}