refactor: encapsulate Drop passthrough in createScope

This commit is contained in:
Yang Jun
2026-07-23 22:37:21 +08:00
parent 78915d1a2e
commit 33e455282d
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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)
}