You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/tmp/pntr/node_modules/json-pointer/index.js:143
return str.replace(/~/g, '~0').replace(/\//g, '~1');
^
TypeError: Object 0 has no method 'replace'
at escape (/tmp/pntr/node_modules/json-pointer/index.js:143:16)
at Array.map (native)
at Function.compile (/tmp/pntr/node_modules/json-pointer/index.js:175:28)
at mapObj (/tmp/pntr/node_modules/json-pointer/index.js:101:29)
at /tmp/pntr/node_modules/json-pointer/index.js:96:21
at forEach (/tmp/pntr/node_modules/json-pointer/node_modules/foreach/index.js:12:16)
at mapObj (/tmp/pntr/node_modules/json-pointer/index.js:94:17)
at /tmp/pntr/node_modules/json-pointer/index.js:96:21
at forEach (/tmp/pntr/node_modules/json-pointer/node_modules/foreach/index.js:17:20)
at mapObj (/tmp/pntr/node_modules/json-pointer/index.js:94:17)
The text was updated successfully, but these errors were encountered:
I used the latest version on npm (v0.0.3) and was able to produce the error with the exact same code as above and in your test. But I have just tried it with your latest master branch and the error doesn't occur any more.
The relevant line is index.js:104 in api.dict where the key in converted into a string. In v0.0.3 key wasn't necessarily a string so api.escape couldn't call the replace function in case it was a number.
v0.0.3 on npm:
refTokens.push(key);
on master:
refTokens.push(String(key));
So it seems you have already fixed it but not published to npm yet.
Hey
it seem like json-pointer can't handle arrays inside objects very well. Using the
dict
method, it produces an error when trying to replace array keys.I got the following error:
The text was updated successfully, but these errors were encountered: