mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
13 lines
325 B
TypeScript
13 lines
325 B
TypeScript
import { Drop } from '../drop/drop'
|
|
|
|
export interface ScopeObject extends Record<string | number | symbol, any> {
|
|
toLiquid?: () => any;
|
|
}
|
|
|
|
export type Scope = ScopeObject | Drop
|
|
|
|
export function createScope (from?: Scope): Scope {
|
|
if (from instanceof Drop) return from
|
|
return Object.assign(Object.create(null), from)
|
|
}
|