source: imaps-frontend/node_modules/webpack/lib/container/ContainerExposedDependency.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
4*/
5
6"use strict";
7
8const ModuleDependency = require("../dependencies/ModuleDependency");
9const makeSerializable = require("../util/makeSerializable");
10
11/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
12/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
13
14class ContainerExposedDependency extends ModuleDependency {
15 /**
16 * @param {string} exposedName public name
17 * @param {string} request request to module
18 */
19 constructor(exposedName, request) {
20 super(request);
21 this.exposedName = exposedName;
22 }
23
24 get type() {
25 return "container exposed";
26 }
27
28 get category() {
29 return "esm";
30 }
31
32 /**
33 * @returns {string | null} an identifier to merge equal requests
34 */
35 getResourceIdentifier() {
36 return `exposed dependency ${this.exposedName}=${this.request}`;
37 }
38
39 /**
40 * @param {ObjectSerializerContext} context context
41 */
42 serialize(context) {
43 context.write(this.exposedName);
44 super.serialize(context);
45 }
46
47 /**
48 * @param {ObjectDeserializerContext} context context
49 */
50 deserialize(context) {
51 this.exposedName = context.read();
52 super.deserialize(context);
53 }
54}
55
56makeSerializable(
57 ContainerExposedDependency,
58 "webpack/lib/container/ContainerExposedDependency"
59);
60
61module.exports = ContainerExposedDependency;
Note: See TracBrowser for help on using the repository browser.