{"size": 2603, "ext": "js", "max_stars_repo_path": "backend/dist/src/utils/math.js", "max_stars_repo_name": "skullkim/metro-map-production", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/dist/src/utils/math.js", "max_issues_repo_name": "skullkim/metro-map-production", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend/dist/src/utils/math.js", "max_forks_repo_name": "skullkim/metro-map-production", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 43.3833333333, "max_line_length": 133, "alphanum_fraction": 0.6131386861}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTimeAsSecond = exports.convertDistance = exports.addUnitToMoney = exports.convertSecond = exports.addStringValue = void 0;
var convert_units_1 = __importDefault(require("convert-units"));
var addStringValue = function (otherValue1, otherValue2) {
    if (otherValue1 === void 0) { otherValue1 = ''; }
    if (otherValue2 === void 0) { otherValue2 = ''; }
    return (parseInt(otherValue1) + parseInt(otherValue2)).toString();
};
exports.addStringValue = addStringValue;
var convertSecond = function (second) {
    if (second === void 0) { second = ''; }
    var minute = (0, convert_units_1.default)(parseInt(second)).from('s').to('min');
    var tmpResult = (minute >= 60 ? (0, convert_units_1.default)(minute).from('min').to('h') : minute).toString();
    var isHour = minute >= 60;
    var result = '';
    if (tmpResult.includes('.')) {
        var resultArr = tmpResult.split('.');
        var pointUpper = isHour ? resultArr[0] + '시간' : resultArr[0] + '분';
        var pointBelow = isHour
            ? (0, convert_units_1.default)(Number("0." + resultArr[1]))
                .from('h')
                .to('min')
                .toFixed(0) + "\uBD84"
            : (0, convert_units_1.default)(Number("0." + resultArr[1]))
                .from('min')
                .to('s')
                .toFixed(0) + "\uCD08";
        result = pointUpper + " " + pointBelow;
    }
    else {
        result = isHour ? tmpResult + " \uC2DC\uAC04" : tmpResult + " \uBD84";
    }
    return result;
};
exports.convertSecond = convertSecond;
var addUnitToMoney = function (money) {
    if (money === void 0) { money = ''; }
    return money + '원';
};
exports.addUnitToMoney = addUnitToMoney;
var convertDistance = function (distance) {
    if (distance === void 0) { distance = ''; }
    return distance.length >= 4
        ? (0, convert_units_1.default)(parseInt(distance)).from('m').to('km').toString() + "km"
        : distance + "m";
};
exports.convertDistance = convertDistance;
var getTimeAsSecond = function () {
    var now = new Date();
    var hour = (0, convert_units_1.default)(now.getHours()).from('h').to('s');
    var minute = (0, convert_units_1.default)(now.getMinutes()).from('min').to('s');
    var nowAsSecond = (hour + minute + now.getSeconds()).toString();
    return nowAsSecond;
};
exports.getTimeAsSecond = getTimeAsSecond;
//# sourceMappingURL=math.js.map