code: function compile(patch) {
    var code = "";
    patch.forEach(function(op) {
      var o = "";
      switch (op.op) {
        case "remove":
          o += "delete " + pathToStatement(op.path);
          break;
        case "add":
          o += pathToStatement(op.path) + " = " + JSON.stringify(op.value);
          break;
        case "replace":
          o += pathToStatement(op.path) + " = " + JSON.stringify(op.value);
          break;
        case "move":
          var from = pathToStatement(op.from);
          o += pathToStatement(op.path) + " = " + from + ";\n";
          o += "delete " + from;
          break;
        case "copy":
          o += pathToStatement(op.path) + " = " + from;
          break;
        case "test":
          o +=
            "if (!oo.equal(" +
            pathToStatement(op.path) +
            ", " +
            JSON.stringify(op.value) +
            ") throw new Error()";
          break;
      }
      code += o + ";\n";
    });
    return code;
  }
docs: "compile" lol https://github.com/bruth/jsonpatch-js/blob/master/jsonpatch.coffee#L377