Library API
    Preparing search index...

    Function asObject

    • Recursively copies enumerable properties of an object into a new object. Returns the original value if it is not an object or is nullish.

      Type Parameters

      • T

      Parameters

      • Optionalobj: Record<PropertyKey, any>

        The object to copy

      Returns T

      A new object with the copied properties

      const copy = asObject({ a: 1 });