UNPKG

json8-pointer

Version:
14 lines (11 loc) 279 B
"use strict"; const walk = require("./walk"); module.exports = function index(json) { const dict = Object.create(null); walk(json, function (value, pointer) { if (typeof value !== "object" || value === null) { dict[pointer] = value; } }); return dict; };