Updated the files.

This commit is contained in:
Batuhan Berk Başoğlu 2024-02-08 19:38:41 -05:00
parent 1553e6b971
commit 753967d4f5
23418 changed files with 3784666 additions and 0 deletions

69
my-app/node_modules/webpack/lib/schemes/DataUriPlugin.js generated vendored Executable file
View file

@ -0,0 +1,69 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const NormalModule = require("../NormalModule");
/** @typedef {import("../Compiler")} Compiler */
// data URL scheme: "data:text/javascript;charset=utf-8;base64,some-string"
// http://www.ietf.org/rfc/rfc2397.txt
const URIRegEx = /^data:([^;,]+)?((?:;[^;,]+)*?)(?:;(base64))?,(.*)$/i;
/**
* @param {string} uri data URI
* @returns {Buffer|null} decoded data
*/
const decodeDataURI = uri => {
const match = URIRegEx.exec(uri);
if (!match) return null;
const isBase64 = match[3];
const body = match[4];
if (isBase64) {
return Buffer.from(body, "base64");
}
// CSS allows to use `data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /></svg>`
// so we return original body if we can't `decodeURIComponent`
try {
return Buffer.from(decodeURIComponent(body), "ascii");
} catch (_) {
return Buffer.from(body, "ascii");
}
};
class DataUriPlugin {
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
"DataUriPlugin",
(compilation, { normalModuleFactory }) => {
normalModuleFactory.hooks.resolveForScheme
.for("data")
.tap("DataUriPlugin", resourceData => {
const match = URIRegEx.exec(resourceData.resource);
if (match) {
resourceData.data.mimetype = match[1] || "";
resourceData.data.parameters = match[2] || "";
resourceData.data.encoding = match[3] || false;
resourceData.data.encodedContent = match[4] || "";
}
});
NormalModule.getCompilationHooks(compilation)
.readResourceForScheme.for("data")
.tap("DataUriPlugin", resource => decodeDataURI(resource));
}
);
}
}
module.exports = DataUriPlugin;

49
my-app/node_modules/webpack/lib/schemes/FileUriPlugin.js generated vendored Executable file
View file

@ -0,0 +1,49 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { URL, fileURLToPath } = require("url");
const { NormalModule } = require("..");
/** @typedef {import("../Compiler")} Compiler */
class FileUriPlugin {
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
"FileUriPlugin",
(compilation, { normalModuleFactory }) => {
normalModuleFactory.hooks.resolveForScheme
.for("file")
.tap("FileUriPlugin", resourceData => {
const url = new URL(resourceData.resource);
const path = fileURLToPath(url);
const query = url.search;
const fragment = url.hash;
resourceData.path = path;
resourceData.query = query;
resourceData.fragment = fragment;
resourceData.resource = path + query + fragment;
return true;
});
const hooks = NormalModule.getCompilationHooks(compilation);
hooks.readResource
.for(undefined)
.tapAsync("FileUriPlugin", (loaderContext, callback) => {
const { resourcePath } = loaderContext;
loaderContext.addDependency(resourcePath);
loaderContext.fs.readFile(resourcePath, callback);
});
}
);
}
}
module.exports = FileUriPlugin;

1156
my-app/node_modules/webpack/lib/schemes/HttpUriPlugin.js generated vendored Executable file

File diff suppressed because it is too large Load diff