WXL
4 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
node_modules/webpack/lib/util/makeSerializable.js
@@ -12,15 +12,18 @@
/** @typedef {{ serialize: (context: ObjectSerializerContext) => void, deserialize: (context: ObjectDeserializerContext) => void }} SerializableClass */
/**
 * Defines the serializable class constructor type used by this module.
 * @template {SerializableClass} T
 * @typedef {(new (...params: EXPECTED_ANY[]) => T) & { deserialize?: (context: ObjectDeserializerContext) => T }} SerializableClassConstructor
 */
/**
 * Represents ClassSerializer.
 * @template {SerializableClass} T
 */
class ClassSerializer {
   /**
    * Creates an instance of ClassSerializer.
    * @param {SerializableClassConstructor<T>} Constructor constructor
    */
   constructor(Constructor) {
@@ -28,6 +31,7 @@
   }
   /**
    * Serializes this instance into the provided serializer context.
    * @param {T} obj obj
    * @param {ObjectSerializerContext} context context
    */
@@ -36,6 +40,7 @@
   }
   /**
    * Restores this instance from the provided deserializer context.
    * @param {ObjectDeserializerContext} context context
    * @returns {T} obj
    */
@@ -50,6 +55,7 @@
}
/**
 * Processes the provided constructor.
 * @template {Constructor} T
 * @param {T} Constructor the constructor
 * @param {string} request the request which will be required when deserializing