Skip to content

Commit 7e43af4

Browse files
authored
Update __createChild.js
1 parent 9b836f3 commit 7e43af4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Typings/Scene/Resources/__createChild.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ const yaml = require('js-yaml');
33

44

55
Scene.newF("__createChild", function(name, settings) {
6+
7+
// removing whitespace so it doesn't die
8+
settings = settings.map( setting => setting.filter( miniSetting => {
9+
return miniSetting.replace(/(\r\n|\n|\r)/gm, "").replace(/\s/, "").length > 1
10+
}));
11+
12+
// actually loading the stuff
613
let thing = settings.filter( s => s[0].includes(name))[0];
714
let stuff = yaml.load(thing.join("\n"));
15+
16+
// returning the stuff typed
817
return new this.parent[name](stuff[name]);
918
});

0 commit comments

Comments
 (0)