String
Creation
class User {
public name: string;
}
const USER_META = new ObjectMeta({
builder: User,
fields: {
name: new StringField(),
}
});
const values = [
{
name: `Vasya`
},
{
name: 12
},
];
const result = JTC.convert({
id: `String`,
meta: new ObjectArrayMeta({ meta: USER_META }),
values,
});
const log = JTC.log.asString(result.tree);
console.log(result.converted.all);
/* 1 (EXCLUDED) -> {...} | Validation failed for all fields
1 (EXCLUDED) -> name -> 12 | Expected string, but got number */
console.log(log);Validation
Enum
Min / Max
Pattern
Last updated