mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 15:00:42 -07:00
feature: variable lookup respects to to_liquid, #81
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
'use strict'
|
||||
const toStr = Object.prototype.toString
|
||||
|
||||
/*
|
||||
@@ -10,12 +11,12 @@ function isString (value) {
|
||||
}
|
||||
|
||||
function stringify (value) {
|
||||
if (value && typeof value.to_liquid === 'function') {
|
||||
return stringify(value.to_liquid())
|
||||
}
|
||||
if (isString(value)) {
|
||||
return value
|
||||
}
|
||||
if (value && typeof value.to_liquid === 'function') {
|
||||
return value.to_liquid()
|
||||
}
|
||||
|
||||
let cache = []
|
||||
return JSON.stringify(value, (key, value) => {
|
||||
|
||||
Reference in New Issue
Block a user