diff options
author | theia | 2022-08-03 09:07:59 -0400 |
---|---|---|
committer | theia | 2022-08-03 09:07:59 -0400 |
commit | 99db926be7131afbf0fe90a4366abb591b3db230 (patch) | |
tree | dce501cfd005ba955eaa6a894f590ec2a9e38b60 | |
parent | 3e22139af5b2bb312cfbe6771316be64f433035a (diff) |
add context if not declared
-rw-r--r-- | graffiti.js | 5 |
1 files changed, 5 insertions, 0 deletions
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() } |