Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify get

  • Loading branch information...
commit cc2ea98859556ebf1489f92b77fcf7e0dd390c0f 1 parent 6c8ecbe
@peritus peritus authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 jsonpointer.js
View
5 jsonpointer.js
@@ -39,10 +39,9 @@ var get = function(obj, pointer) {
validate_input(obj, pointer);
if (pointer === "/") {
return obj;
- } else {
- pointer = pointer.split("/").slice(1);
- return traverse(obj, pointer);
}
+ pointer = pointer.split("/").slice(1);
+ return traverse(obj, pointer);
}
var set = function(obj, pointer, value) {
Please sign in to comment.
Something went wrong with that request. Please try again.