mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
feat: with & for in render tag, closes #195
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { isString, isObject, isArray } from './underscore'
|
||||
|
||||
export function toCollection (val: any) {
|
||||
if (isArray(val)) return val
|
||||
if (isString(val) && val.length > 0) return [val]
|
||||
if (isObject(val)) return Object.keys(val).map((key) => [key, val[key]])
|
||||
return []
|
||||
}
|
||||
Reference in New Issue
Block a user