Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 461 Bytes

File metadata and controls

17 lines (13 loc) · 461 Bytes

object-shape

NPM

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]