diff options
| author | Marak Squires <[email protected]> | 2010-05-15 22:13:44 -0400 |
|---|---|---|
| committer | Marak Squires <[email protected]> | 2010-05-15 22:13:44 -0400 |
| commit | e9501fb7069a3acb419409b0e85d3b31b86acf97 (patch) | |
| tree | e47f85df2b1ac911692b8656abf9a6936f1b8af5 /lib/helpers.js | |
| parent | 529dc7392faa95ca711badc80780c521aa0f7f9f (diff) | |
| download | faker-e9501fb7069a3acb419409b0e85d3b31b86acf97.tar.xz faker-e9501fb7069a3acb419409b0e85d3b31b86acf97.zip | |
added usage docs, created unit tests for library and bundled versions in node and browser
Diffstat (limited to 'lib/helpers.js')
| -rw-r--r-- | lib/helpers.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/helpers.js b/lib/helpers.js index ec1fedae..03254c2f 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -45,4 +45,10 @@ Helpers.shuffle = function(o){ // otherwise construct a name space. outside the anonymous function, // "this" will always be "window" in a browser, even in strict mode. this.window = {} -);
\ No newline at end of file +); + +String.prototype.capitalize = function(){ //v1.0 + return this.replace(/\w+/g, function(a){ + return a.charAt(0).toUpperCase() + a.substr(1).toLowerCase(); + }); +}; |
