function transform(value, sAction) {
    /*jshint evil:true, -W064*/
    var result;
    switch (sAction) {
        case "array":
            result = Array(value);
            break;
        case "boolean":
            result = Boolean(value);
            break;
        case "empty":
            result = empty(value);
            break;
        case "function":
            result = Function(value);
            break;
        case "integer":
            result = Math.round(Number(value));
            break;
        case "map":
            try {
                result = new Map(value);
            }
            catch (e) {
                result = new Map([[value, value]]);
            }
            break;
        case "number":
            result = Number(value);
            break;
        case "object":
            result = Object(value);
            break;
        case "promise":
        case "resolve":
            result = Promise.resolve(value);
            break;
        case "reject":
            result = Promise.reject(value);
            break;
        case "reverse":
            result = reverse(value);
            break;
        case "set":
            try {
                result = new Set(value);
            }
            catch (e) {
                result = new Set([value]);
            }
            break;
        case "string":
            result = String(value);
            break;
        default:
            result = value;
    }
    return result;
}
/**
 * Transform the given value applying the specified operation.
 * 
 * @param {Any} value
 *      Value to be transformed.
 * @param {String} sAction
 *      Operation that should be applied to transform the value. Can be one of the following:
 *      
 *    * `array` - convert the value to array (using `Array(value)`)
 *    * `boolean` - convert the value to boolean value (using `Boolean(value)`)
 *    * `empty` - empty the value (see {@link module:adam.empty empty})
 *    * `function` - convert the value to function (using `Function(value)`)
 *    * `integer` - try to convert the value to an integer number (using `Math.round(Number(value)`)
 *    * `map` - try to convert the value to Map (using `new Map(value)` or `new Map([[value, value]])`)
 *    * `number` - try to convert the value to number (using `Number(value)`)
 *    * `object` - convert the value to object (using `Object(value)`)
 *    * `promise` or `resolve` - convert the value to resolved promise (using `Promise.resolve(value)`)
 *    * `reject` - convert the value to rejected promise (using `Promise.reject(value)`)
 *    * `reverse` - reverse the value (see {@link module:adam.reverse reverse})
 *    * `set` - try to convert the value to Set (using `new Set(value)` or `new Set([value])`)
 *    * `string` - convert the value to string (using `String(value)`)
 *    * otherwise - source value
 * @return {Any}
 *      Transformed value.
 * @alias module:adam.transform
 * @see {@link module:adam.empty empty}
 * @see {@link module:adam.reverse reverse}
 */
Transform the given value applying the specified operation.

@param {Any} value
Value to be transformed.
@param {String} sAction
Operation that should be applied to transform the value. Can be one of the following.


Transform the given value applying the specified operation . @param { Any } value Value to be transformed . @param { String } sAction Operation that should be applied to transform the value . Can be one of the following .
function transform(value, sAction) {
    var result;
    switch (sAction) {
        case "array":
            result = Array(value);
            break;
        case "boolean":
            result = Boolean(value);
            break;
        case "empty":
            result = empty(value);
            break;
        case "function":
            result = Function(value);
            break;
        case "integer":
            result = Math.round(Number(value));
            break;
        case "map":
            try {
                result = new Map(value);
            }
            catch (e) {
                result = new Map([[value, value]]);
            }
            break;
        case "number":
            result = Number(value);
            break;
        case "object":
            result = Object(value);
            break;
        case "promise":
        case "resolve":
            result = Promise.resolve(value);
            break;
        case "reject":
            result = Promise.reject(value);
            break;
        case "reverse":
            result = reverse(value);
            break;
        case "set":
            try {
                result = new Set(value);
            }
            catch (e) {
                result = new Set([value]);
            }
            break;
        case "string":
            result = String(value);
            break;
        default:
            result = value;
    }
    return result;
}
function transform ( value , sAction ) { var result ; switch ( sAction ) { case "array" : result = Array ( value ) ; break ; case "boolean" : result = Boolean ( value ) ; break ; case "empty" : result = empty ( value ) ; break ; case "function" : result = Function ( value ) ; break ; case "integer" : result = Math . round ( Number ( value ) ) ; break ; case "map" : try { result = new Map ( value ) ; } catch ( e ) { result = new Map ( [ [ value , value ] ] ) ; } break ; case "number" : result = Number ( value ) ; break ; case "object" : result = Object ( value ) ; break ; case "promise" : case "resolve" : result = Promise . resolve ( value ) ; break ; case "reject" : result = Promise . reject ( value ) ; break ; case "reverse" : result = reverse ( value ) ; break ; case "set" : try { result = new Set ( value ) ; } catch ( e ) { result = new Set ( [ value ] ) ; } break ; case "string" : result = String ( value ) ; break ; default : result = value ; } return result ; }
Transform the given value applying the specified operation.
Transform the given value applying the specified operation .
/*jshint evil:true, -W064*/