Comparing version 1.0.1 to 1.0.2
24
index.js
@@ -61,4 +61,28 @@ (function() { | ||
$$.req = function(req) { | ||
req.paramJson = function(name, defaultValue) { | ||
var value; | ||
value = this.param(name); | ||
if (!value) return defaultValue; | ||
try { | ||
return JSON.parse(value); | ||
} catch (e) { | ||
return defaultValue; | ||
} | ||
}; | ||
req.paramJsonStr = function(name, defaultValue) { | ||
var value; | ||
value = this.param(name); | ||
if (!value) return defaultValue; | ||
try { | ||
return JSON.parse(value); | ||
} catch (e) { | ||
return value; | ||
} | ||
}; | ||
return req; | ||
}; | ||
module.exports = $$; | ||
}).call(this); |
{ | ||
"name": "2dollars", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "write less, do more, save $$ dollars", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3945
6
75