Skip to content

Commit

Permalink
Merge pull request #8 from rkusa/master
Browse files Browse the repository at this point in the history
Fix escape() for non-strings
  • Loading branch information
Manuel Stofer committed Jul 24, 2014
2 parents 4b01010 + fdaaa8c commit fa7db3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ api.has = function has (obj, pointer) {
* @returns {string}
*/
api.escape = function escape (str) {
return str.replace(/~/g, '~0').replace(/\//g, '~1');
return str.toString().replace(/~/g, '~0').replace(/\//g, '~1');
};

/**
Expand Down

0 comments on commit fa7db3a

Please sign in to comment.