(annotations?: Annotations.Filter)
| 9157 | * @since 4.0.0 |
| 9158 | */ |
| 9159 | export function isUniqueKey<Key, Value>(annotations?: Annotations.Filter) { |
| 9160 | return makeFilter<ReadonlyArray<readonly [Key, Value]>>( |
| 9161 | (input) => Arr.dedupe(input.map(([key]) => key)).length === input.length, |
| 9162 | { |
| 9163 | expected: "an array with unique keys", |
| 9164 | representation: { |
| 9165 | id: "effect/schema/isUniqueKey", |
| 9166 | payload: null |
| 9167 | }, |
| 9168 | arbitraryConstraint: { |
| 9169 | uniqueBy: (entry: readonly [Key, Value]) => entry[0] |
| 9170 | }, |
| 9171 | ...annotations |
| 9172 | } |
| 9173 | ) |
| 9174 | } |
| 9175 | /** |
| 9176 | * Type-level representation of {@link NonEmptyString}. |
| 9177 | * |
no test coverage detected