Function serialize

  • Parameters

    • value: unknown

      value to serialise

    • Optional seen: Map<object, string>

      cyclic reference guard (Map of object → placeholder)

    • Optional symbols: boolean

    Returns SerializedValue

    Description

    Serialises an arbitrary JavaScript value into the uniform SerializedValue format. Handles primitives, Date, RegExp, Buffer, Error, arrays, and plain objects. Objects with prototype !== Object.prototype are treated as opaque and returned as {t: 'ref'}. When stripRequestEnabled is set, the request key is skipped (Axios HTTP internals).