static compareArrays()

in source/services/tagHandler/lib/EC2Helper.ts [116:136]


  static compareArrays(a1: string[], a2: string[]): boolean {
    const superSet: { [key: string]: number } = {};
    for (const i of a1) {
      superSet[i] = 1;
    }

    for (const i of a2) {
      if (!superSet[i]) {
        return false;
      }
      superSet[i] = 2;
    }

    for (const e in superSet) {
      if (superSet[e] === 1) {
        return false;
      }
    }

    return true;
  }