This repository was archived by the owner on Feb 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ React.render(
25
25
Make sure to include ` json-inspector.css ` in your stylesheet. Feel free to
26
26
override or amend default styles, for instance, when using a dark background.
27
27
28
+ ### Run the example
29
+
30
+ ``` bash
31
+ cd /path/to/project
32
+ npm install
33
+ npm run watch
34
+ ```
35
+
36
+ Then, visit http://localhost/path/to/project/example
37
+
28
38
### Properties
29
39
30
40
#### props.data
Original file line number Diff line number Diff line change 1
1
var React = require ( 'react' ) ;
2
2
var D = React . DOM ;
3
3
4
+ var md5omatic = require ( 'md5-o-matic' ) ;
5
+
4
6
var uid = require ( './uid' ) ;
5
7
var type = require ( './type' ) ;
6
8
@@ -213,7 +215,8 @@ function items(count) {
213
215
function getLeafKey ( key , value ) {
214
216
if ( isPrimitive ( value ) ) {
215
217
// TODO: Sanitize `value` better.
216
- return key + ':' + String ( value ) . replace ( / \s + / g, '_' ) ;
218
+ var hash = md5omatic ( String ( value ) ) ;
219
+ return key + ':' + hash ;
217
220
} else {
218
221
return key + '[' + type ( value ) + ']' ;
219
222
}
Original file line number Diff line number Diff line change 15
15
"license" : " MIT" ,
16
16
"dependencies" : {
17
17
"debounce" : " 1.0.0" ,
18
+ "md5-o-matic" : " ^0.1.1" ,
18
19
"object-assign" : " 2.0.0"
19
20
},
20
21
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments