import {
  __esm
} from "./chunk-2CV3WTQN.mjs";

// src/utils.ts
import debug from "debug";
function getHttpMethods() {
  return [
    "get",
    "post",
    "put",
    "head",
    "delete",
    "options",
    "trace",
    "copy",
    "lock",
    "mkcol",
    "move",
    "purge",
    "propfind",
    "proppatch",
    "unlock",
    "report",
    "mkactivity",
    "checkout",
    "merge",
    "m-search",
    "notify",
    "subscribe",
    "unsubscribe",
    "patch",
    "search",
    "connect"
  ];
}
function log(msg, debugFlag) {
  if (debugFlag) {
    console.log(msg);
  } else {
    debugLog(msg);
  }
}
function isObject(item) {
  return item && typeof item === "object" && !Array.isArray(item);
}
function mergeDeep(target, ...sources) {
  if (!sources.length)
    return target;
  const source = sources.shift();
  if (isObject(target) && isObject(source)) {
    for (const key in source) {
      if (isObject(source[key])) {
        if (!target[key])
          Object.assign(target, { [key]: {} });
        mergeDeep(target[key], source[key]);
      } else {
        Object.assign(target, { [key]: source[key] });
      }
    }
  }
  return mergeDeep(target, ...sources);
}
var debugLog, isArrowFunction;
var init_utils = __esm({
  "src/utils.ts"() {
    debugLog = debug("@tomrpc/core");
    isArrowFunction = (func) => {
      if (typeof func === "function") {
        const source = func.toString();
        return /^\([^)]*\)\s*=>/.test(source);
      }
      return false;
    };
  }
});

export {
  isArrowFunction,
  getHttpMethods,
  log,
  isObject,
  mergeDeep,
  init_utils
};
