Function serialize

  • Serialize an object preserving literal values

    Parameters

    • input: unknown

      The object to serialize

    Returns string

    Example

    serialize(Infinity) >> '"Infinity"';
    serialize({ a: 1, b: 2 }) >> '{"a": 1, "b": 2}';