@karmaniverous/serify-deserify
    Preparing search index...

    Function serify

    • Serify a value: recursively convert it into a form that JSON.stringify can serialize, and that deserify can restore.

      Type Parameters

      Parameters

      Returns unknown

      The serified value. Serializable primitives are returned as-is; arrays & plain objects are cloned with serified contents; values of supported types are wrapped in a SerifiedValue.

      Error if value (or any value it contains) is not of a serifiable type.

      serify(new Map([['a', 1n]]), defaultOptions);
      // {
      // serifyKey: null,
      // type: 'Map',
      // value: [['a', { serifyKey: null, type: 'BigInt', value: '1' }]],
      // }