All files / src/app/core/models/address address.helper.ts

100% Statements 6/6
100% Branches 6/6
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15    348x   23x 12x   11x 9x     2x      
import { Address } from './address.model';
 
export class AddressHelper {
  static equal(add1: Address, add2: Address): boolean {
    if (!add1 || !add2) {
      return false;
    }
    if (add1.urn && add2.urn) {
      return add1.urn === add2.urn;
    }
    // fallback to id if urn is not set
    return add1.id === add2.id;
  }
}