Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils/dedupe

Index

Functions

  • dedupeConcat(list1: any, list2: any, __namedParameters?: { idSelector: any; useFirstList: undefined | boolean }): any[]
  • Concat 2 list, with data dedupped (duplicated data get removed).

    Basically it concats 2 list, but if any data in list2 having the same id as one in list1, the one on list1 will be replaced by the one in list2.

    For example: list1 = [ A, B, C ] list2 = [ C', D, E] // C' is the modified version of C concat(list1, list2) --> [A, B, C', D, E]

    An important note that it's a concat rather than merge, the order in list1 remains the same For example: list1 = [ B, C, D ] list2 = [ A, B, C', D, E ] concat(list1, list2) --> [B, C', D, A, E]

    Items from list1 [ B, C, D ] remains the same, but with C updated Non-duplicated items [A, E] from list2 are appended

    Options:

    Parameters

    • list1: any
    • list2: any
    • __namedParameters: { idSelector: any; useFirstList: undefined | boolean } = {}
      • idSelector: any
      • useFirstList: undefined | boolean

    Returns any[]

  • primitiveConcat(list1: any, list2: any, __namedParameters?: { useFirstList: any }): any[]
  • A shortcut to concat array with primitive values, for exmaple, string array.

    Parameters

    • list1: any
    • list2: any
    • __namedParameters: { useFirstList: any } = {}
      • useFirstList: any

    Returns any[]

Generated using TypeDoc