object-shape

Get a description of a JS object's shape.

Downloads
18
Stars
25
Committers
1

object-shape

Returns a String description of a given object's shape.

import shape from 'object-shape';

shape('hello')        // string
shape(2)              // number
shape(undefined)      // undefined
shape(null)           // [Null]
shape({ a:1, b:2 })   // [Object a,b]
shape(/reg/i)         // [RegExp]
shape(new Foo())      // [Foo a,b,c]