Interface FilterableSpec<I, O>

Interface used in ChecksumArgs for each piece of data that can be filtered (i.e. modified) before it is included in the hash computed by the checksum method.

interface FilterableSpec<I, O> {
    include?: boolean;
    filter?(input: I): O | Promise<O>;
}

Type Parameters

  • I
  • O = I

Hierarchy (view full)

Properties

Methods

Properties

include?: boolean

Whether to include this piece of data in the hash. It is true by default (if an object is passed).

Methods

  • A function used to filter (i.e. modify) the piece of data before it is included in the hash. If no function is given, the unmodified piece of data is used.

    Parameters

    • input: I

      piece of data to filter

    Returns O | Promise<O>

    The modified piece of data. Note that the filter function can optionally be asynchronous, in which case it is expected to return a promise of the modified piece of data.