Code coverage report for string/unhyphenate.js

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

All files » string/ » unhyphenate.js
1 2 3 4 5 6 7 8 9 10 11 121           1 4   1    
define(function(){
    /**
     * Replaces hyphens with spaces. (only hyphens between word chars)
     * @example unhyphenate('lorem-ipsum-dolor') -> 'lorem ipsum dolor'
     * @version 0.1.0 (2011/08/09)
     */
    function unhyphenate(str){
        return (str || '').replace(/(\w)(-)(\w)/g, '$1 $3'); //convert hyphens between word chars to spaces
    }
    return unhyphenate;
});