all files / montage/core/converter/ upper-case-converter.js

71.43% Statements 5/7
66.67% Branches 4/6
66.67% Functions 2/3
71.43% Lines 5/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44                                                                             
/**
 * @module montage/core/converter/upper-case-converter
 * @requires montage/core/converter/converter
 */
var Converter = require("./converter").Converter;
 
/**
 * @class UpperCaseConverter
 * @classdesc Converts a string to upper-case.
 */
exports.UpperCaseConverter = Converter.specialize( /** @lends UpperCaseConverter# */ {
 
    _convert: {
        value: function (v) {
            Eif (v && typeof v === 'string') {
                return (v.toUpperCase ? v.toUpperCase() : v);
            }
            return v;
        }
    },
 
    /**
     * Converts the specified string to all upper case letters.
     * @function
     * @param {string} v The string to convert.
     * @returns {string} The converted string.
     */
    convert: {value: function (v) {
        return this._convert(v);
    }},
 
    /**
     * Reverts the specified string.
     * @function
     * @param {string} v The specified string.
     * @returns {string}
     */
    revert: {value: function (v) {
        return this._convert(v);
    }}
 
});