js Validating maps

The solution for “js Validating maps” can be found here. The following code will assist you in solving the problem.

// If your field is a map and you want to perform
// validation of each item in the map you must
// specify a special each: true decorator option:

import { MinLength, MaxLength } from ‘class-validator’;

export class Post {
@MaxLength(20, {
each: true,
tags: Map;

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in