Decode "flat object"(whose values are not reference type), unlike t.type, the return is Record<string, string>.
One use case is validating JSON from excel, and using the returned error report to display table like UI.
const validateObject = flatObject(drawFirstLine)({
name: D.withMessage(() => 'name must be string')(D.string),
age: D.withMessage(() => 'age must be number')(D.number),
})
const error = F.pipeable.pipe(
{
name: 'jit',
age: '140',
},
validateObject
)
assert.deepStrictEqual(error, {
name: undefined,
age: 'age must be number',
})
Decode "flat object"(whose values are not reference type), unlike
t.type
, the return isRecord<string, string>
. One use case is validating JSON from excel, and using the returned error report to display table like UI.