https://github.com/jmakeig/object-describe
Pretty print JavaScript object hierarchy
https://github.com/jmakeig/object-describe
developer-tools javascript marklogic reflection visualization
Last synced: 4 months ago
JSON representation
Pretty print JavaScript object hierarchy
- Host: GitHub
- URL: https://github.com/jmakeig/object-describe
- Owner: jmakeig
- Created: 2017-03-04T02:49:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:08:03.000Z (over 3 years ago)
- Last Synced: 2024-04-14T19:37:11.353Z (about 2 years ago)
- Topics: developer-tools, javascript, marklogic, reflection, visualization
- Language: JavaScript
- Homepage: https://jmakeig.github.io/object-describe/example/
- Size: 2.68 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `describe(obj)`
A way to inspect the entire type hierarchy of an object, including properties inherited (and potentially overridden) from its prototype chain.
Given any object or primitive, the `describe()` function lists the type of object and its value, if it’s a primitive. Then, for each of the original object’s properties, their types and values recursively. Finally, it moves up the prototype chain to capture all of the objec’s inherited properties as well.
`describe()` returns a nested data structure that represents the details of the type hierarchy. The `render` module provides formatters, for example to render the type hierarchy as HTML.
## Set-up
1. `npm install`
1. Configure and deploy mltap (*This isn’t automated yet*)
1. `export MLTAP_USER='tester' && export MLTAP_PASSWORD='********'`
1. `npm run test`
## Development Set-up
### VSCode
### Settings
```json
{
"eslint.enable": true,
"eslint.options": {
"configFile": ".eslintrc.js",
"ext": [
".js",
".sjs"
]
}
}
```
### Tasks
```json
{
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"showOutput": "silent",
"suppressTaskName": true,
"options": {
"env": {
"MLTAP_USER": "tester",
"MLTAP_PASSWORD": "********"
}
},
"tasks": [
{
"taskName": "test",
"args": [
"run",
"test-pretty"
],
"problemMatcher": {
"owner": "javascript",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^\\s+at: (.+) \\((.+):(\\d+):(\\d+)\\)",
"file": 2,
"line": 3,
"column": 4,
"message": 1
}
}
}
]
}
```
© 2017 MarkLogic