Last change
on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | /*
|
---|
2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
3 | Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
|
---|
4 | */
|
---|
5 |
|
---|
6 | "use strict";
|
---|
7 |
|
---|
8 | const ModuleFactory = require("../ModuleFactory");
|
---|
9 | const ProvideSharedModule = require("./ProvideSharedModule");
|
---|
10 |
|
---|
11 | /** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
|
---|
12 | /** @typedef {import("../ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
---|
13 | /** @typedef {import("./ProvideSharedDependency")} ProvideSharedDependency */
|
---|
14 |
|
---|
15 | class ProvideSharedModuleFactory extends ModuleFactory {
|
---|
16 | /**
|
---|
17 | * @param {ModuleFactoryCreateData} data data object
|
---|
18 | * @param {function(Error=, ModuleFactoryResult=): void} callback callback
|
---|
19 | * @returns {void}
|
---|
20 | */
|
---|
21 | create(data, callback) {
|
---|
22 | const dep = /** @type {ProvideSharedDependency} */ (data.dependencies[0]);
|
---|
23 | callback(null, {
|
---|
24 | module: new ProvideSharedModule(
|
---|
25 | dep.shareScope,
|
---|
26 | dep.name,
|
---|
27 | dep.version,
|
---|
28 | dep.request,
|
---|
29 | dep.eager
|
---|
30 | )
|
---|
31 | });
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | module.exports = ProvideSharedModuleFactory;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.