summaryrefslogtreecommitdiffstats
path: root/node_modules/webpack/lib/dependencies/DependencyReference.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/webpack/lib/dependencies/DependencyReference.js
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/webpack/lib/dependencies/DependencyReference.js')
-rw-r--r--node_modules/webpack/lib/dependencies/DependencyReference.js64
1 files changed, 0 insertions, 64 deletions
diff --git a/node_modules/webpack/lib/dependencies/DependencyReference.js b/node_modules/webpack/lib/dependencies/DependencyReference.js
deleted file mode 100644
index a8f6afa..0000000
--- a/node_modules/webpack/lib/dependencies/DependencyReference.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Florent Cailhol @ooflorent
-*/
-"use strict";
-
-/** @typedef {import("../Module")} Module */
-
-class DependencyReference {
- // TODO webpack 5: module must be dynamic, you must pass a function returning a module
- // This is needed to remove the hack in ConcatenatedModule
- // The problem is that the `module` in Dependency could be replaced i. e. because of Scope Hoisting
- /**
- *
- * @param {Module} module the referenced module
- * @param {string[] | boolean} importedNames imported named from the module
- * @param {boolean=} weak if this is a weak reference
- * @param {number} order the order information or NaN if don't care
- */
- constructor(module, importedNames, weak = false, order = NaN) {
- // TODO webpack 5: make it a getter
- this.module = module;
- // true: full object
- // false: only sideeffects/no export
- // array of strings: the exports with this names
- this.importedNames = importedNames;
- this.weak = !!weak;
- this.order = order;
- }
-
- /**
- * @param {DependencyReference[]} array an array (will be modified)
- * @returns {DependencyReference[]} the array again
- */
- static sort(array) {
- /** @type {WeakMap<DependencyReference, number>} */
- const originalOrder = new WeakMap();
- let i = 0;
- for (const ref of array) {
- originalOrder.set(ref, i++);
- }
- return array.sort((a, b) => {
- const aOrder = a.order;
- const bOrder = b.order;
- if (isNaN(aOrder)) {
- if (!isNaN(bOrder)) {
- return 1;
- }
- } else {
- if (isNaN(bOrder)) {
- return -1;
- }
- if (aOrder !== bOrder) {
- return aOrder - bOrder;
- }
- }
- const aOrg = originalOrder.get(a);
- const bOrg = originalOrder.get(b);
- return aOrg - bOrg;
- });
- }
-}
-
-module.exports = DependencyReference;