Cleanup
This commit is contained in:
parent
a49e779d11
commit
27c65ccff2
|
@ -134,10 +134,10 @@ async function processDefaultValues(table: Table, row: Row) {
|
|||
|
||||
for (const [key, schema] of Object.entries(table.schema)) {
|
||||
if ("default" in schema && schema.default != null && row[key] == null) {
|
||||
let processed = schema.default
|
||||
if (typeof processed === "string") {
|
||||
processed = await processString(schema.default, ctx)
|
||||
}
|
||||
const processed =
|
||||
typeof schema.default === "string"
|
||||
? await processString(schema.default, ctx)
|
||||
: schema.default
|
||||
try {
|
||||
row[key] = coerce(processed, schema.type)
|
||||
} catch (err: any) {
|
||||
|
|
Loading…
Reference in New Issue