Found shorthand type coercions JS-0066
Anti-pattern
Minor
10 months ago3 years old
use Number(page) instead
  57
  58const getPagingData = (data, page, limit) => {
  59  const { count: totalItems, rows: tutorials } = data;
  60  const currentPage = page ? +page : 0;  61  const totalPages = Math.ceil(totalItems / limit);
  62  return { totalItems, tutorials, totalPages, currentPage };
  63};
use Number(size) instead
  49};
  50
  51const getPagination = (page, size) => {
  52  const limit = size ? +size : 3;  53  const offset = page ? page * limit : 0;
  54
  55  return { limit, offset };