https://github.com/developit/object-shape
Get a description of a JS object's shape.
https://github.com/developit/object-shape
javascript object performance shape v8
Last synced: 25 days ago
JSON representation
Get a description of a JS object's shape.
- Host: GitHub
- URL: https://github.com/developit/object-shape
- Owner: developit
- Created: 2017-02-05T01:13:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-09T14:58:57.000Z (about 8 years ago)
- Last Synced: 2025-04-10T11:16:09.272Z (about 1 month ago)
- Topics: javascript, object, performance, shape, v8
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 25
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `object-shape`
[](https://www.npmjs.com/package/object-shape)
Returns a String description of a given object's shape.
```js
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]
```