import { isString as c } from "../value/is.js";
const o = 60 * 1e3, r = 60 * o, s = 24 * r, i = 7 * s, u = ((...e) => {
  const [t] = e, n = (e.length >= 2 ? new Date(...e) : t instanceof Date ? t : new Date(c(t) || Number.isFinite(t) ? t : void 0)).getTime();
  return Number.isFinite(n) ? n : void 0;
}), _ = (e, t) => {
  switch (e) {
    case "hour":
      return t * r;
    case "minute":
      return t * o;
    case "day":
      return t * s;
    case "week":
      return t * i;
    default:
      return console.warn(`Unknown unit: ${e}`), 0;
  }
};
export {
  u as parseDate,
  _ as transformToMS
};
