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

Method concatProperties

tools/mcpack.js:984–997  ·  view source on GitHub ↗
(object, properties, flag)

Source from the content-addressed store, hash-verified

982// BUILT-INS
983
984 concatProperties(object, properties, flag) {
985 if (properties) {
986 for (let name in properties) {
987 let property = properties[name];
988 if (flag) {
989 if (property instanceof Array)
990 property = property.map(item => this.resolveSource(item));
991 else if (typeof property == "string")
992 property = this.resolveSource(property);
993 }
994 object[name] = this.concatProperty((name in object) ? object[name] : [], property);
995 }
996 }
997 }
998 concatProperty(array, value) {
999 if ((value instanceof Array) || (typeof value == "string"))
1000 return array.concat(value);

Callers 1

getBuiltinsMethod · 0.45

Calls 3

mapMethod · 0.80
resolveSourceMethod · 0.45
concatPropertyMethod · 0.45

Tested by

no test coverage detected