Skip to main content

dedupeCatalogue

Small helper used by the CnIconPicker catalogue adapters. Removes duplicate entries by value (keeping the first occurrence) and drops entries without a value. Useful when composing catalogues from multiple sources by hand.

import { dedupeCatalogue } from '@conduction/nextcloud-vue'

dedupeCatalogue([{ value: 'a' }, { value: 'a' }, { value: '' }, { value: 'b' }])
// [{ value: 'a' }, { value: 'b' }]

Signature

dedupeCatalogue(entries: Array<CatalogueEntry>): Array<CatalogueEntry>

  • entries — catalogue entries (each { key, label, value, search, path?, component?, viewBox? }).
  • returns — a new array with duplicate/empty values removed, order preserved.

See also: fromMdiJs, fromFontAwesome, fromOpenGemeenten.