unwrap
Unwraps a map-like or array-like value into an object or array.
unwrap(obj)
Recursively unwraps a map-like or list-like object.
import canReflect from "can-reflect";
var map = new DefineMap({foo: "bar"});
canReflect.unwrap(map) //-> {foo: "bar"}
unwrap
is similar to serialize except it does not try to provide JSON.stringify()
-safe
objects. For example, an object with a Date
instance property value will not be expected to
serialize the date instance:
var date = new Date();
var map = new DefineMap({date: date});
canReflect.unwrap(map) //-> {date: date}
Parameters
- obj
{Object}
:A map-like or array-like object.
Returns
{Object}
:
Returns objects and arrays.