Skip to content

Instantly share code, notes, and snippets.

@kevinold
Forked from gucheen/parseLodash.js
Created June 28, 2017 13:06
Show Gist options
  • Select an option

  • Save kevinold/861976cc1032ae36f0457bd7431efd93 to your computer and use it in GitHub Desktop.

Select an option

Save kevinold/861976cc1032ae36f0457bd7431efd93 to your computer and use it in GitHub Desktop.
Safe JSON.parse with lodash.js
function parseLodash(str){
return _.attempt(JSON.parse.bind(null, str));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment