Comparing version 0.0.8 to 0.0.9
0.0.9 / 2013-05-08 | ||
================== | ||
* Safe encodeURIComponent and decodeURIComponent | ||
0.0.8 / 2013-05-06 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -131,2 +131,32 @@ /*! | ||
/** | ||
* Safe encodeURIComponent, won't throw any error. | ||
* If `encodeURIComponent` error happen, just return the original value. | ||
* | ||
* @param {String} text | ||
* @return {String} URL encode string. | ||
*/ | ||
exports.encodeURIComponent = function (text) { | ||
try { | ||
return encodeURIComponent(text); | ||
} catch (e) { | ||
return text; | ||
} | ||
}; | ||
/** | ||
* Safe decodeURIComponent, won't throw any error. | ||
* If `decodeURIComponent` error happen, just return the original value. | ||
* | ||
* @param {String} encodeText | ||
* @return {String} URL decode original string. | ||
*/ | ||
exports.decodeURIComponent = function (encodeText) { | ||
try { | ||
return decodeURIComponent(encodeText); | ||
} catch (e) { | ||
return encodeText; | ||
} | ||
}; | ||
var MONTHS = [ | ||
@@ -133,0 +163,0 @@ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' |
{ | ||
"name": "utility", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "A collection of useful utilities.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -54,2 +54,5 @@ utility [![Build Status](https://secure.travis-ci.org/fengmk2/utility.png)](http://travis-ci.org/fengmk2/utility) | ||
utils.datestruct(); // { YYYYMMDD: 20130416, H: 8 } | ||
// Safe encodeURIComponent and decodeURIComponent | ||
utils.decodeURIComponent(utils.encodeURIComponent('你好, nodejs')).should.equal('你好, nodejs'); | ||
``` | ||
@@ -99,2 +102,16 @@ | ||
## Authors | ||
```bash | ||
$ git summary | ||
project : utility | ||
repo age : 6 months | ||
active : 8 days | ||
commits : 23 | ||
files : 14 | ||
authors : | ||
23 fengmk2 100.0% | ||
``` | ||
## License | ||
@@ -101,0 +118,0 @@ |
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
16593
348
139