UniqueArray<S>Returns a new array schema that ensures all elements are unique.
Details
The equivalence used to determine uniqueness is the one provided by
Schema.toEquivalence(item).
export interface interface UniqueArray<S extends Constraint>Returns a new array schema that ensures all elements are unique.
Details
The equivalence used to determine uniqueness is the one provided by
Schema.toEquivalence(item).
Type-level representation returned by
UniqueArray
.
UniqueArray<function (type parameter) S in UniqueArray<S extends Constraint>S extends Constraint> extends interface $Array<S extends Constraint>Type-level representation returned by
Array
.
$Array<function (type parameter) S in UniqueArray<S extends Constraint>S> {
readonly "Rebuild": interface UniqueArray<S extends Constraint>Returns a new array schema that ensures all elements are unique.
Details
The equivalence used to determine uniqueness is the one provided by
Schema.toEquivalence(item).
Type-level representation returned by
UniqueArray
.
UniqueArray<function (type parameter) S in UniqueArray<S extends Constraint>S>
}
/**
* Returns a new array schema that ensures all elements are unique.
*
* **Details**
*
* The equivalence used to determine uniqueness is the one provided by
* `Schema.toEquivalence(item)`.
*
* @category constructors
* @since 4.0.0
*/
export function function UniqueArray<
S extends Constraint
>(item: S): UniqueArray<S>
Returns a new array schema that ensures all elements are unique.
Details
The equivalence used to determine uniqueness is the one provided by
Schema.toEquivalence(item).
UniqueArray<function (type parameter) S in UniqueArray<S extends Constraint>(item: S): UniqueArray<S>S extends Constraint>(item: S extends Constraintitem: function (type parameter) S in UniqueArray<S extends Constraint>(item: S): UniqueArray<S>S): interface UniqueArray<S extends Constraint>Returns a new array schema that ensures all elements are unique.
Details
The equivalence used to determine uniqueness is the one provided by
Schema.toEquivalence(item).
Type-level representation returned by
UniqueArray
.
UniqueArray<function (type parameter) S in UniqueArray<S extends Constraint>(item: S): UniqueArray<S>S> {
return const ArraySchema: ArrayLambda
;<S>(self: S) => $Array<S>
ArraySchema(item: S extends Constraintitem).Bottom<unknown, unknown, unknown, unknown, Arrays, $Array<S>, unknown, unknown, readonly [], unknown, "readonly", "required", "no-default", "readonly", "required">.check(checks_0: SchemaAST.Check<readonly S["Type"][]>, ...checks: SchemaAST.Check<readonly S["Type"][]>[]): $Array<S>check(function isUnique<S["Type"]>(annotations?: Annotations.Filter): SchemaAST.Filter<readonly S["Type"][]>Validates that all items in an array are unique according to Effect equality.
Details
JSON Schema:
This check corresponds to the uniqueItems: true constraint in JSON Schema.
Arbitrary:
When generating test data with fast-check, this applies a node-local
unique: true constraint. Array generators translate it to fast-check
uniqueArray using Effect equality.
isUnique())
}