-
-
Save kevinold/861976cc1032ae36f0457bd7431efd93 to your computer and use it in GitHub Desktop.
Safe JSON.parse with lodash.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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