Skip to content

dedupePieces

dedupePieces<T>(pieces): ReturnType<T>

Defined in: packages/synapse-core/src/utils/dedupe-pieces.ts:32

Remove inputs whose PieceCID already appeared earlier in the array.

The first input for each PieceCID wins, including its metadata and source URL.

Type Parameter
T extends object
Parameter Type Description
pieces T[] Inputs to dedupe.

ReturnType<T>

The kept inputs and the removed ones. dedupePieces.ReturnType