Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

317 B
Raw Blame
export const arrayEqual = (
  a: string[],
  b: string[],
  {
    sameOrder = false,
  }: {
    sameOrder?: boolean;
  } = {},
) => {
  if (a.length !== b.length) {
    return false;
  }

  if (sameOrder) {
    return a.every((item, index) => item === b[index]);
  }

  return a.every((item) => b.includes(item));
};