Skip to content

map

@tsed/schema

Usage

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

See /packages/specs/schema/src/fn/collection.ts.

Overview

ts
function map(): JsonSchema<Record<string, any>>;
export function map<V>(value: JsonSchema<V>): JsonSchema<Map<string, V>>;

Description

Declare a new object model with additionalProperties: true (map-like). If a value schema is provided, it is used as additionalProperties and its type will be inferred.

json
{ "type": "object", "additionalProperties": true }

See JsonSchema to discover available methods.

Released under the MIT License.