From 8ace93096ad0116d3d30790cd6ed3a09266b50eb Mon Sep 17 00:00:00 2001 From: anonymous Date: Wed, 21 Sep 2022 12:46:08 -0400 Subject: add context if not declared --- graffiti.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graffiti.js b/graffiti.js index 7a9c168..1741452 100644 --- a/graffiti.js +++ b/graffiti.js @@ -202,6 +202,11 @@ export default class { throw new Error("_to must be an array") } + // Add an open context if none is declared + if (!object._inContextIf) { + object._inContextIf = [{}] + } + // Pre-generate the object's ID if it does not already exist if (!object._id) object._id = randomString() } -- cgit v1.2.3-70-g09d2