WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/serialization/PlainObjectSerializer.js
@@ -10,21 +10,26 @@
/** @typedef {EXPECTED_FUNCTION} CacheAssoc */
/**
 * Defines the shared type used by this module.
 * @template T
 * @typedef {WeakMap<CacheAssoc, ObjectStructure<T>>}
 */
const cache = new WeakMap();
/**
 * Represents ObjectStructure.
 * @template T
 */
class ObjectStructure {
   constructor() {
      /** @type {undefined | keyof T[]} */
      this.keys = undefined;
      /** @type {undefined | Map<keyof T, ObjectStructure<T>>} */
      this.children = undefined;
   }
   /**
    * Returns keys.
    * @param {keyof T[]} keys keys
    * @returns {keyof T[]} keys
    */
@@ -34,6 +39,7 @@
   }
   /**
    * Returns object structure.
    * @param {keyof T} key key
    * @returns {ObjectStructure<T>} object structure
    */
@@ -48,6 +54,7 @@
}
/**
 * Returns keys.
 * @template T
 * @param {(keyof T)[]} keys keys
 * @param {CacheAssoc} cacheAssoc cache assoc fn
@@ -68,6 +75,7 @@
class PlainObjectSerializer {
   /**
    * Serializes this instance into the provided serializer context.
    * @template {object} T
    * @param {T} obj plain object
    * @param {ObjectSerializerContext} context context
@@ -96,6 +104,7 @@
   }
   /**
    * Restores this instance from the provided deserializer context.
    * @template {object} T
    * @param {ObjectDeserializerContext} context context
    * @returns {T} plain object