Skip to content
Myr

Added aliases of JSON.encode() and JSON.decode()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 138b047 · Browse files · 3 files+5 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−22 removed

  • other:+5 added−22 removed

3 files+5 added−22 removed

modified:examples/app.js+1 added-1 removed
modified:lib/express/exceptions.js+1 added-1 removed
modified:lib/express/helpers.js+3 added-20 removed
55 unmodified lines
5657// --- Helpers5859/**60 * JSON encode _object_.61 *62 * @param {string} object63 * @return {string}64 * @api public60 * JSON aliases.61 */6267exports.jsonEncode = function(object) {68 return JSON.stringify(object)69}63JSON.encode = JSON.stringify64JSON.decode = JSON.parse6566/**72 * JSON decode _string_.73 *74 * @param {string} string75 * @return {mixed}76 * @api public77 */7879exports.jsonDecode = function(string) {80 return JSON.parse(string)81}8283/**67 * Return the directory name of the given _path_.68 *69 * @param {string} path70 * @return {string}
202 unmodified lines