Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
foo: [1, 2, 3, 4], // eslint-disable-line no-magic-numbers
baz: [
{
qux: "hello",
},
],
};
const pointer = "/baz/0/qux";
const compiled = ooPointer.compile(pointer);
const janlCompiled = jsonpointer.compile(pointer);
const evaluate = jsonpointerjs.get(doc);
const ptr = flitbit.create(pointer);
const suite = benchmark.Suite("pointer");
suite
.add("find", function() {
ooPointer.find(doc, pointer);
})
.add("compiled", function() {
compiled(doc);
})
.add("compile + compiled", function() {
ooPointer.compile(pointer)(doc);
})
.add("janl/node-jsonpointer get", function() {
jsonpointer.get(doc, pointer);
})