UNPKG
json8-pointer
Version:
latest (1.0.6)
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0
JSON Pointer toolkit for JavaScript
github.com/sonnyp/JSON8/tree/main/packages/pointer
sonnyp/JSON8
json8-pointer
/
lib
/
index.js
12 lines
(9 loc)
•
216 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
"use strict"
;
const
walk =
require
(
"./walk"
);
module
.
exports
=
function
index
(
json
) {
const
idxs =
Object
.
create
(
null
);
walk
(json,
function
(
value, pointer
) { idxs[pointer] = value; });
return
idxs; };