mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
fix: pass drops directly to filters/tags
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user