diff --git a/nix-js/runtime-ts/src/operators.ts b/nix-js/runtime-ts/src/operators.ts index 4f47724..75ab841 100644 --- a/nix-js/runtime-ts/src/operators.ts +++ b/nix-js/runtime-ts/src/operators.ts @@ -270,6 +270,12 @@ export const op = { update: (a: NixValue, b: NixValue): NixAttrs => { const mapA = forceAttrs(a); const mapB = forceAttrs(b); + if (mapA.size === 0) { + return mapB; + } + if (mapB.size === 0) { + return mapA; + } const result: NixAttrs = new Map(mapA); for (const [k, v] of mapB) { result.set(k, v);