(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular-ru/cdk/date'), require('@angular-ru/cdk/function'), require('@angular-ru/cdk/utils'), require('@angular-ru/cdk/string')) :
    typeof define === 'function' && define.amd ? define('@angular-ru/cdk/class-transformer', ['exports', '@angular-ru/cdk/date', '@angular-ru/cdk/function', '@angular-ru/cdk/utils', '@angular-ru/cdk/string'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['angular-ru'] = global['angular-ru'] || {}, global['angular-ru'].cdk = global['angular-ru'].cdk || {}, global['angular-ru'].cdk['class-transformer'] = {}), global['angular-ru'].cdk.date, global['angular-ru'].cdk.function, global['angular-ru'].cdk.utils, global['angular-ru'].cdk.string));
}(this, (function (exports, date, _function, utils, string) { 'use strict';

    function transformAsPrepareFieldsFromClass(classRef) {
        return function (_a) {
            var value = _a.value;
            return (Object.assign(Object.assign({}, new classRef()), value));
        };
    }

    function transformDateToFormat(options) {
        return function (_a) {
            var value = _a.value;
            return date.toFormatDateTime(value, options);
        };
    }

    var ONLY_TO_CLASS = { toClassOnly: true };
    var ONLY_TO_PLAIN = { toPlainOnly: true };

    function transformParseFloat(_a) {
        var value = _a.value;
        return parseFloat(value);
    }

    function transformParseInt(_a) {
        var value = _a.value;
        return parseInt(value);
    }

    function transformToBoolean(_a) {
        var value = _a.value;
        return Boolean(value);
    }

    function transformToClass(classType) {
        if (utils.isNil(Reflect)) {
            throw new Error("You are forgot add: import 'reflect-metadata';");
        }
        return _function.typeofType(classType);
    }

    function transformToFormatDateTime(_a) {
        var value = _a.value;
        return date.toFormatDateTime(value);
    }

    function transformToNumber(_a) {
        var value = _a.value;
        if (string.isString(value)) {
            var strValue = value.trim().replace(/\s/g, '');
            return strValue ? Number(strValue) : null;
        }
        return utils.checkValueIsEmpty(value) ? null : Number(value);
    }

    function transformToPrettyFormat(_a) {
        var value = _a.value;
        return date.toPrettyFormat(value);
    }

    function transformToStringVal(_a) {
        var value = _a.value;
        return string.toStringVal(value);
    }

    function transformToTrim(_a) {
        var value = _a.value;
        return string.trim(value);
    }

    function transformToUnix(_a) {
        var value = _a.value;
        return date.toUnix(value);
    }

    /**
     * Generated bundle index. Do not edit.
     */

    exports.ONLY_TO_CLASS = ONLY_TO_CLASS;
    exports.ONLY_TO_PLAIN = ONLY_TO_PLAIN;
    exports.transformAsPrepareFieldsFromClass = transformAsPrepareFieldsFromClass;
    exports.transformDateToFormat = transformDateToFormat;
    exports.transformParseFloat = transformParseFloat;
    exports.transformParseInt = transformParseInt;
    exports.transformToBoolean = transformToBoolean;
    exports.transformToClass = transformToClass;
    exports.transformToFormatDateTime = transformToFormatDateTime;
    exports.transformToNumber = transformToNumber;
    exports.transformToPrettyFormat = transformToPrettyFormat;
    exports.transformToStringVal = transformToStringVal;
    exports.transformToTrim = transformToTrim;
    exports.transformToUnix = transformToUnix;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=angular-ru-cdk-class-transformer.umd.js.map
