Skip to content

CollectionContains

@tsed/schema

Usage

typescript
import { CollectionContains } from "@tsed/schema";

See /packages/specs/schema/src/types/decorators/collections/collectionContains.ts.

Overview

ts
function CollectionContains(type: any): import("./collectionOf.js").CollectionOfChainedDecorators;

Description

Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...

The array instance will be valid against "contains" if at least one of its elements is valid against the given schema.

typescript
class Model {
   @CollectionContains(String).MinLength(0).MaxLength(0)
   property: string[];
}

Released under the MIT License.