Skip to content

Commit

Permalink
ECMASCRIPT 5 'use strict' cleanup, since we want strict mode
Browse files Browse the repository at this point in the history
for the entire library, we don't need to contextualize 'use strict' to each prototype methods.
  • Loading branch information
yhwh committed Jul 4, 2013
1 parent eb28596 commit b2786df
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/stringbean.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict';

function Stringbean() { }

Expand All @@ -8,7 +9,6 @@ function Stringbean() { }
* @return {String} The filtered string
*/
Stringbean.prototype.escapeHTML = function(s) {
'use strict';
return s.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
Expand All @@ -22,7 +22,6 @@ Stringbean.prototype.escapeHTML = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.unescapeHTML = function(s) {
'use strict';
return s.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
Expand All @@ -36,7 +35,6 @@ Stringbean.prototype.unescapeHTML = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.removeAlpha = function(s) {
'use strict';
return s.replace(/[^A-Za-z ]+/g, "");
};

Expand All @@ -47,7 +45,6 @@ Stringbean.prototype.removeAlpha = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.removeNonAlphanumeric = function(s) {
'use strict';
return s.replace(/[^A-Za-z0-9 ]+/g, "");
};

Expand All @@ -59,7 +56,6 @@ Stringbean.prototype.removeNonAlphanumeric = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.removeNonNumeric = function(s) {
'use strict';
return s.replace(/[^0-9-.]/g, "");
};

Expand All @@ -70,7 +66,6 @@ Stringbean.prototype.removeNonNumeric = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.removeNumeric = function(s) {
'use strict';
return s.replace(/[0-9]/g, "");
};

Expand All @@ -81,7 +76,6 @@ Stringbean.prototype.removeNumeric = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.base64Encode = function(s) {
'use strict';
return new Buffer(s).toString('base64');
};

Expand All @@ -92,7 +86,6 @@ Stringbean.prototype.base64Encode = function(s) {
* @return {String} The filtered string
*/
Stringbean.prototype.base64Decode = function(s) {
'use strict';
return new Buffer(s, 'base64').toString('utf8');
};

Expand All @@ -103,7 +96,6 @@ Stringbean.prototype.base64Decode = function(s) {
* @return {Boolean} true if it is JSON, false if not
*/
Stringbean.prototype.isJSON = function(s) {
'use strict';
try {
JSON.parse(s);
} catch (e) {
Expand Down

0 comments on commit b2786df

Please sign in to comment.