Code coverage report for string/removeNonASCII.js

Statements: 100% (5 / 5)      Branches: 50% (1 / 2)      Functions: 100% (3 / 3)      Lines: 100% (4 / 4)     

All files » string/ » removeNonASCII.js
1 2 3 4 5 6 7 8 9 10 11 12 131             1 1   1    
define(function(){
    /**
    * Remove non-printable ASCII chars
    * @param {string} str
    * @return {string}
    * @version 0.1.1 (2011/08/09)
    */
    function removeNonASCII(str){
        return (str || '').replace(/[^\x20-\x7E]/g, ''); //matches non-printable ASCII chars - http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
    }
    return removeNonASCII;
});