@open-discord-bots/framework 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api/main.js CHANGED
@@ -44,7 +44,7 @@ export class ODMain {
44
44
  constructor(managers, project) {
45
45
  this.project = project;
46
46
  this.versions = managers.versions;
47
- this.versions.add(ODVersion.fromString("opendiscord:api", "v0.4.3"));
47
+ this.versions.add(ODVersion.fromString("opendiscord:api", "v0.4.4"));
48
48
  this.versions.add(ODVersion.fromString("opendiscord:livestatus", "v2.0.0"));
49
49
  this.debugfile = managers.debugfile;
50
50
  this.console = managers.console;
@@ -677,7 +677,14 @@ export class ODCliEditConfigInstance {
677
677
  else {
678
678
  localData[enabledProperty] = data;
679
679
  //copy old object checker to new object checker => all options get de-referenced (this is needed for the new object skip keys are temporary)
680
- const newStructure = new api.ODCheckerObjectStructure(subStructure.id, structuredClone(subStructure.options));
680
+ const newStructure = new api.ODCheckerObjectStructure(subStructure.id, { children: [] });
681
+ //copy all options over to the new checker. This can't be done using structuredClone() because of the custom() function
682
+ newStructure.options.children = [...subStructure.options.children];
683
+ newStructure.options.cliInitSkipKeys = [...(subStructure.options.cliInitSkipKeys ?? [])];
684
+ for (const key of Object.keys(subStructure.options)) {
685
+ if (key != "children" && key != "cliInitSkipKeys")
686
+ newStructure.options[key] = subStructure.options[key];
687
+ }
681
688
  //continues to next function
682
689
  await this.renderAdditionConfigObjectStructure(checker, async () => { await this.renderAdditionConfigEnabledObjectStructure(checker, backFn, nextFn, structure, parent, parentIndex, path, localPath); }, nextFn, newStructure, parent, parentIndex, path, localPath, localData);
683
690
  await nextFn(localData);
@@ -700,7 +707,14 @@ export class ODCliEditConfigInstance {
700
707
  const objectTemplate = structure.options.objects[answer.selectedIndex];
701
708
  //copy old object checker to new object checker => all options get de-referenced (this is needed for the new object switch properties which are temporary)
702
709
  const oldStructure = objectTemplate.checker;
703
- const newStructure = new api.ODCheckerObjectStructure(oldStructure.id, structuredClone(oldStructure.options));
710
+ const newStructure = new api.ODCheckerObjectStructure(oldStructure.id, { children: [] });
711
+ //copy all options over to the new checker. This can't be done using structuredClone() because of the custom() function
712
+ newStructure.options.children = [...oldStructure.options.children];
713
+ newStructure.options.cliInitSkipKeys = [...(oldStructure.options.cliInitSkipKeys ?? [])];
714
+ for (const key of Object.keys(oldStructure.options)) {
715
+ if (key != "children" && key != "cliInitSkipKeys")
716
+ newStructure.options[key] = oldStructure.options[key];
717
+ }
704
718
  //add the keys of the object switch properties to the 'cliInitSkipKeys' because they need to be skipped.
705
719
  objectTemplate.properties.map((p) => p.key).forEach((p) => {
706
720
  if (!newStructure.options.cliInitSkipKeys)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@open-discord-bots/framework",
3
3
  "author": "DJj123dj",
4
- "version": "0.4.3",
4
+ "version": "0.4.4",
5
5
  "description": "The core framework of the popular open-source discord bots: Open Ticket & Open Moderation.",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",