feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -1,6 +1,6 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Krasnoyarov @alexander-akait
Author Alexander Akait @alexander-akait
*/
"use strict";
@@ -14,13 +14,13 @@ const makeSerializable = require("./util/makeSerializable");
/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {string|undefined} CssLayer */
/** @typedef {string|undefined} Supports */
/** @typedef {string|undefined} Media */
/** @typedef {[CssLayer?, Supports?, Media?]} InheritanceItem */
/** @typedef {string | undefined} CssLayer */
/** @typedef {string | undefined} Supports */
/** @typedef {string | undefined} Media */
/** @typedef {[CssLayer, Supports, Media]} InheritanceItem */
/** @typedef {Array<InheritanceItem>} Inheritance */
/** @typedef {NormalModuleCreateData & { cssLayer: CssLayer|null, supports: Supports|null, media: Media|null, inheritance: Inheritance|null }} CSSModuleCreateData */
/** @typedef {NormalModuleCreateData & { cssLayer: CssLayer, supports: Supports, media: Media, inheritance: Inheritance }} CSSModuleCreateData */
class CssModule extends NormalModule {
/**
@@ -127,30 +127,34 @@ class CssModule extends NormalModule {
static deserialize(context) {
const obj = new CssModule({
// will be deserialized by Module
layer: null,
layer: /** @type {EXPECTED_ANY} */ (null),
type: "",
// will be filled by updateCacheModule
resource: "",
context: "",
request: null,
userRequest: null,
rawRequest: null,
loaders: null,
matchResource: null,
parser: null,
parserOptions: null,
generator: null,
generatorOptions: null,
resolveOptions: null,
cssLayer: null,
supports: null,
media: null,
inheritance: null
request: /** @type {EXPECTED_ANY} */ (null),
userRequest: /** @type {EXPECTED_ANY} */ (null),
rawRequest: /** @type {EXPECTED_ANY} */ (null),
loaders: /** @type {EXPECTED_ANY} */ (null),
matchResource: /** @type {EXPECTED_ANY} */ (null),
parser: /** @type {EXPECTED_ANY} */ (null),
parserOptions: /** @type {EXPECTED_ANY} */ (null),
generator: /** @type {EXPECTED_ANY} */ (null),
generatorOptions: /** @type {EXPECTED_ANY} */ (null),
resolveOptions: /** @type {EXPECTED_ANY} */ (null),
cssLayer: /** @type {EXPECTED_ANY} */ (null),
supports: /** @type {EXPECTED_ANY} */ (null),
media: /** @type {EXPECTED_ANY} */ (null),
inheritance: /** @type {EXPECTED_ANY} */ (null)
});
obj.deserialize(context);
return obj;
}
/**
* @param {ObjectDeserializerContext} context context
* @returns {TODO} Module
*/
deserialize(context) {
const { read } = context;
this.cssLayer = read();