"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    clamp: function() {
        return clamp;
    },
    isFunction: function() {
        return isFunction;
    },
    isObject: function() {
        return isObject;
    },
    isPromise: function() {
        return isPromise;
    },
    preventDefault: function() {
        return preventDefault;
    },
    upperCaseFirst: function() {
        return upperCaseFirst;
    }
});
var _type_of = require("@swc/helpers/_/_type_of");
var isObject = function isObject(val) {
    return val !== null && (typeof val === "undefined" ? "undefined" : (0, _type_of._)(val)) === 'object';
};
var isFunction = function isFunction(val) {
    return typeof val === 'function';
};
var isPromise = function isPromise(val) {
    return isObject(val) && isFunction(val.then) && isFunction(val.catch);
};
var upperCaseFirst = function upperCaseFirst(str) {
    str = str.toLowerCase();
    str = str.replace(/\b\w+\b/g, function(word) {
        return word.substring(0, 1).toUpperCase() + word.substring(1);
    });
    return str;
};
var clamp = function clamp(num, min, max) {
    return Math.min(Math.max(num, min), max);
};
function preventDefault(event, isStopPropagation) {
    if (typeof event.cancelable !== 'boolean' || event.cancelable) {
        event.preventDefault();
    }
    if (isStopPropagation) {
        event.stopPropagation();
    }
}
