source: frontend/node_modules/webpack/lib/dependencies/AMDRequireContextDependency.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const makeSerializable = require("../util/makeSerializable");
9const ContextDependency = require("./ContextDependency");
10
11/** @typedef {import("../javascript/JavascriptParser").Range} Range */
12/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
13/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
14/** @typedef {import("./ContextDependency").ContextDependencyOptions} ContextDependencyOptions */
15
16class AMDRequireContextDependency extends ContextDependency {
17 /**
18 * Creates an instance of AMDRequireContextDependency.
19 * @param {ContextDependencyOptions} options options
20 * @param {Range} range range
21 * @param {Range} valueRange value range
22 */
23 constructor(options, range, valueRange) {
24 super(options);
25
26 this.range = range;
27 this.valueRange = valueRange;
28 }
29
30 get type() {
31 return "amd require context";
32 }
33
34 get category() {
35 return "amd";
36 }
37
38 /**
39 * Serializes this instance into the provided serializer context.
40 * @param {ObjectSerializerContext} context context
41 */
42 serialize(context) {
43 const { write } = context;
44
45 write(this.range);
46 write(this.valueRange);
47
48 super.serialize(context);
49 }
50
51 /**
52 * Restores this instance from the provided deserializer context.
53 * @param {ObjectDeserializerContext} context context
54 */
55 deserialize(context) {
56 const { read } = context;
57
58 this.range = read();
59 this.valueRange = read();
60
61 super.deserialize(context);
62 }
63}
64
65makeSerializable(
66 AMDRequireContextDependency,
67 "webpack/lib/dependencies/AMDRequireContextDependency"
68);
69
70AMDRequireContextDependency.Template = require("./ContextDependencyTemplateAsRequireCall");
71
72module.exports = AMDRequireContextDependency;
Note: See TracBrowser for help on using the repository browser.