Number|Bigint
Creation
class User {
public id: bigint;
public age: number;
}
const ageField = new NumberField();
const idField = new BigintField();
const USER_META = new ObjectMeta({
builder: User,
fields: {
id: idField,
age: ageField
}
});
const values = [
{
id: BigInt(1),
age: 43
},
{
id: 12,
age: ``
}
];
const result = JTC.convert({
id: `Number`,
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) -> age -> '' | Expected number, but got string */
console.log(log);Validation
Min / Max
Last updated