Skip to content

Commit

Permalink
Delete old metadafa field when converting to new JSON schema
Browse files Browse the repository at this point in the history
Revision for v0.8.10
  • Loading branch information
StefansArya committed Feb 9, 2023
1 parent 1c363f3 commit 5de2919
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,16 +584,17 @@ Blackprint.Engine = class Engine extends CustomEvent {
console.error("The exported instance (JSON) format was deprecated, please re-export the JSON by importing your JSON to the editor and export it. Your current JSON format may not work after version v1.0. Other engine than JavaScript may also not support the old format.");

let newData = { instance: obj };

let metadata = obj._;
delete obj._;

if(metadata){
newData.moduleJS = metadata.moduleJS;
newData.functions = metadata.functions;
newData.variables = metadata.variables;
newData.events = metadata.events;
newData.environments = metadata.env;
}

return newData;
}

Expand Down

0 comments on commit 5de2919

Please # to comment.