A parser for Doge Serialized Object Notation. Page says, there are no parsers yet. Well, it has now.
Last active
August 29, 2015 14:02
-
-
Save subzey/cbce2557da78f4fe900e to your computer and use it in GitHub Desktop.
DSON shim
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
var DSON = DSON || { | |
parse: function(v) { | |
return JSON.parse(v.replace(/"(\\"|[^"])*"|[a-z]+/gi, function(v) { | |
return { | |
such: '{', | |
wow: '}', | |
is: ':', | |
so: '[', | |
many: ']', | |
next: ',', | |
very: 'e', | |
notfalse: !0, | |
nottrue: [!1], | |
nullish: null | |
}[v.toLowerCase()] || v; | |
})); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment