fix: pass drops directly to filters/tags

This commit is contained in:
harttle
2019-05-12 20:03:32 +08:00
parent 4282accaa2
commit bef290923c
15 changed files with 93 additions and 42 deletions
+6
View File
@@ -1,3 +1,5 @@
import { Drop } from '../drop/drop'
const toStr = Object.prototype.toString
/*
@@ -31,6 +33,10 @@ export function stringify (value: any): string {
return String(value)
}
export function toValue (value: any): any {
return value instanceof Drop ? value.valueOf() : value
}
export function toLiquid (value: any): any {
if (isFunction(value.toLiquid)) return toLiquid(value.toLiquid())
return value