mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
refactor: encapsulate Drop passthrough in createScope
This commit is contained in:
@@ -6,6 +6,7 @@ export interface ScopeObject extends Record<string | number | symbol, any> {
|
||||
|
||||
export type Scope = ScopeObject | Drop
|
||||
|
||||
export function createScope (from?: ScopeObject): ScopeObject {
|
||||
export function createScope (from?: Scope): Scope {
|
||||
if (from instanceof Drop) return from
|
||||
return Object.assign(Object.create(null), from)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user