"use strict";
const isFunction = (val) => typeof val === "function";
const isObject = (val) => val !== null && typeof val === "object";
const isUrl = (url) => {
  return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(
    url
  );
};
const isJSON = (str) => {
  if (typeof str === "string") {
    try {
      const data = JSON.parse(str);
      if (data) {
        return true;
      }
      return false;
    } catch (error) {
      return false;
    }
  }
  return false;
};
const JSONToObject = (str) => {
  if (!str || !isJSON(str)) {
    return str;
  }
  return JSON.parse(str);
};
exports.JSONToObject = JSONToObject;
exports.isFunction = isFunction;
exports.isObject = isObject;
exports.isUrl = isUrl;
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/utils/type-check.js.map
