MCPcopy Create free account
hub / github.com/SAP/ui5-builder / addSubModule

Method addSubModule

lib/lbt/resources/ModuleInfo.js:157–173  ·  view source on GitHub ↗

* Adds the given module as a sub module to this module. * * If the module is an instanceof ModuleInfo, its name is added to submodules, * its dependencies become dependencies of this module (if they are not already * included as submodules). If the included module has calculated (dynamic)

( other )

Source from the content-addressed store, hash-verified

155 * @param {string | ModuleInfo} other Module to include into this module
156 */
157 addSubModule( other ) {
158 if ( other instanceof ModuleInfo ) {
159 this.addSubModule( other.name );
160 // accumulate dependencies
161 for ( const dep of Object.keys(other._dependencies ) ) {
162 this._addDependency(dep, other._dependencies[dep]);
163 }
164 // inherit dynamic dependencies
165 if ( other.dynamicDependencies ) {
166 this.dynamicDependencies = true;
167 }
168 } else {
169 this.subModules.push( other );
170 // when a module is added as submodule, it no longer is a dependency
171 delete this._dependencies[other];
172 }
173 }
174
175 isConditionalDependency(dependency) {
176 return this._dependencies[dependency] === CONDITIONAL;

Callers 7

createModuleInfoMethod · 0.95
analyzeMethod · 0.80
onDeclareMethod · 0.80
onDefineMethod · 0.80
onSapUiPredefineMethod · 0.80
ModuleInfo.jsFile · 0.80

Calls 1

_addDependencyMethod · 0.95

Tested by

no test coverage detected