UNPKG

wasmuth

Version:

Practical, functional utilities that fallback on native implementations as much as possible

11 lines (8 loc) 216 B
const test = require("tape"); const {path} = require("../"); test("path", (t) => { const obj = {a: {b: 2}}; t.deepEqual(path(["a", "b"], obj), obj.a.b); t.deepEqual(path("a.b", obj), obj.a.b); t.end(); });