mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
perf: use polymophism instead duck test
This commit is contained in:
@@ -48,7 +48,7 @@ export default <ITagImplOptions>{
|
||||
if (isString(collection) && collection.length > 0) {
|
||||
collection = [collection] as string[]
|
||||
} else if (isObject(collection)) {
|
||||
collection = Object.keys(collection).map((key) => [key, collection[key]]) as Array<[string, any]>
|
||||
collection = Object.keys(collection).map((key) => [key, collection[key]])
|
||||
}
|
||||
}
|
||||
if (!isArray(collection) || !collection.length) {
|
||||
|
||||
Reference in New Issue
Block a user