var dotty = require("./lib/index");

var object = {
  a: {
    b: {
      x: "y",
    },
    c: {
      x: "z",
    },
  },
};

console.log(dotty.exists(object, "a.b.x")); // true
console.log(dotty.exists(object, ["a", "b", "x"])); // true
console.log(dotty.exists(object, "a.b.z")); // false
console.log(dotty.exists(object, ["a", "b", "z"])); // false

console.log(dotty.get(object, "a.b.x")); // "y"
console.log(dotty.get(object, ["a", "b", "x"])); // "y"
console.log(dotty.get(object, "a.b.z")); // undefined
console.log(dotty.get(object, ["a", "b", "z"])); // undefine

dotty.put(object, "a.b.hello", "hi");
dotty.put(object, ["a", "c", "yo"], "sup");

console.log(dotty.search(object, "a.b.*"));
console.log(dotty.search(object, ["a", "b", "*"]));
console.log(dotty.search(object, "a.*.x"));
console.log(dotty.search(object, ["a", "*", "x"]));
console.log(dotty.search(object, ["a", "*", /..+/]));

console.log(dotty.remove(object, "a.b.x"));
console.log(dotty.remove(object, "a.b.y"));

console.log(dotty.deepKeys(object));
console.log(dotty.deepKeys(object, {leavesOnly: true}));
console.log(dotty.deepKeys(object, {leavesOnly: true, asStrings: true}));

console.log(object);

@@ -506,16 +506,73 @@
 defined%0A
+console.log(dotty.get(object, %22a.b.z.z%22));  // undefined%0A
 console.
@@ -623,16 +623,17 @@
 undefine
+d
 %0A%0Adotty.
@@ -748,24 +748,39 @@
 , %22a.b.*%22));
+ // %5B%22y%22, %22hi%22%5D
 %0Aconsole.log
@@ -815,24 +815,39 @@
 %22b%22, %22*%22%5D));
+ // %5B%22y%22, %22hi%22%5D
 %0Aconsole.log
@@ -874,24 +874,38 @@
 , %22a.*.x%22));
+ // %5B%22y%22, %22z%22%5D
 %0Aconsole.log
@@ -944,16 +944,31 @@
  %22x%22%5D));
+  // %5B%22y%22, %22z%22%5D
 %0Aconsole
@@ -1013,16 +1013,34 @@
 ..+/%5D));
+  // %5B%22hi%22, %22sup%22%5D
 %0A%0Aconsol
@@ -1163,157 +1163,569 @@
 ));%0A
-console.log(dotty.deepKeys(object, %7BleavesOnly: true%7D));%0Aconsole.log(dotty.deepKeys(object, %7BleavesOnly: true, asStrings: true%7D));%0A%0Aconsole.log(object);
+/**%0A  %5B%0A    %5B 'a' %5D,%0A    %5B 'a', 'b' %5D,%0A    %5B 'a', 'b', 'hello' %5D,%0A    %5B 'a', 'c' %5D,%0A    %5B 'a', 'c', 'x' %5D,%0A    %5B 'a', 'c', 'yo' %5D%0A  %5D%0A */%0A%0Aconsole.log(dotty.deepKeys(object, %7BleavesOnly: true%7D));%0A/**%0A  %5B%0A    %5B 'a', 'b', 'hello' %5D,%0A    %5B 'a', 'c', 'x' %5D,%0A    %5B 'a', 'c', 'yo' %5D%0A  %5D%0A */%0A%0Aconsole.log(dotty.deepKeys(object, %7BleavesOnly: true, asStrings: true%7D));%0A/**%0A  %5B%0A    'a.b.hello',%0A    'a.c.x',%0A    'a.c.yo'%0A  %5D%0A */%0A%0Aconsole.log(object);%0A/**%0A  %7B%0A    a: %7B%0A      b: %7B%0A        hello: %22hi%22%0A      %7D,%0A      c: %7B%0A        x: %22z',%0A        yo: 'sup'%0A      %7D%0A    %7D%0A  %7D%0A */
 %0A

Update examples with expected output