feat: promise support for drops, working on #65

This commit is contained in:
Jun Yang
2019-03-10 18:05:52 +08:00
parent ad0930f152
commit 4a8088d4e4
25 changed files with 260 additions and 250 deletions
+6 -4
View File
@@ -47,10 +47,12 @@ export default class Value {
}
this.filters.push(new Filter(name, args, this.strictFilters))
}
value (scope: Scope) {
return this.filters.reduce(
(prev, filter) => filter.render(prev, scope),
evalExp(this.initial, scope))
async value (scope: Scope) {
let val = await evalExp(this.initial, scope)
for (let filter of this.filters) {
val = await filter.render(val, scope)
}
return val
}
static tokenize (str: string): Array<'|' | ',' | ':' | string> {
const tokens = []