MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / filterConfig

Method filterConfig

tools/mcconfig.js:1010–1042  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

1008 }
1009 }
1010 filterConfig(config) {
1011 this.mergeProperties(config, this.config);
1012 if (this.format) {
1013 if ("UNDEFINED" === this.format) {
1014 if (undefined !== config.format) {
1015 for (let property in formatStrings) {
1016 if (formatStrings[property] == config.format) {
1017 this.format = property;
1018 break;
1019 }
1020 }
1021 if ("UNDEFINED" === this.format)
1022 throw new Error(`invalid format: ${config.format}`);
1023 }
1024 else
1025 this.format = "rgb565le";
1026 }
1027 config.format = formatStrings[this.format];
1028
1029 if (undefined === this.rotation) {
1030 if (undefined !== config.rotation) {
1031 if ((0 !== config.rotation) && (90 !== config.rotation) && (180 !== config.rotation) && (270 !== config.rotation))
1032 throw new Error(`invalid rotation: ${config.rotation}`);
1033 this.rotation = config.rotation;
1034 }
1035 else
1036 config.rotation = this.rotation = 0;
1037 }
1038 else
1039 config.rotation = this.rotation;
1040 }
1041 this.config = config;
1042 }
1043 filterZephyrConfig(config) {
1044 if (this.platform == "zephyr")
1045 this.mergeProperties(config, this.zephyrConfig);

Callers 1

runMethod · 0.80

Calls 1

mergePropertiesMethod · 0.80

Tested by

no test coverage detected