import debug from './env';

export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => {
  if (mock !== false && debug) setup();
};

export const successResponseWrap = (data: unknown) => {
  return data;
};

export const pageListResponseWrap = (result: unknown) => {
  return {
    result,
    totalCount: 10,
  };
};

export const failResponseWrap = (
  data: unknown,
  message: string,
  code = 501
) => {
  return {
    data,
    message,
    code,
  };
};
