"use strict";
function isDef(value) {
    return value !== undefined && value !== null;
}
function isObj(x) {
    var type = typeof x;
    return x !== null && (type === 'object' || type === 'function');
}
function isNumber(value) {
    return /^\d+(\.\d+)?$/.test(value);
}
function range(num, min, max) {
    return Math.min(Math.max(num, min), max);
}
function nextTick(fn) {
    setTimeout(function () {
        fn();
    }, 1000 / 30);
}
var systemInfo = null;
function getSystemInfoSync() {
    if (systemInfo == null) {
        systemInfo = wx.getSystemInfoSync();
    }
    return systemInfo;
}
function addUnit(value) {
    if (!isDef(value)) {
        return undefined;
    }
    value = String(value);
    return isNumber(value) ? value + "px" : value;
}

export default {
    isDef,
    isObj,
    isNumber,
    range,
    nextTick,
    getSystemInfoSync,
    addUnit
}
