compactValues

Compacts an associative array by its values

compactValues
(
alias pred = null
T
U
)
(
T[U] aa
)

Parameters

pred

a unary predicate that returns true if value should be compacted

aa
Type: T[U]

compacted associated array

Return Value

Type: auto

compacted associtive array

Examples

import ddash.utils: isFalsey;
auto aa = ["a": 1, "b": 0, "c": 2];
assert(aa.compactValues!isFalsey == ["a": 1, "c": 2]);

Meta

Since

0.0.1