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)) {
|
for (const [key, schema] of Object.entries(table.schema)) {
|
||||||
if ("default" in schema && schema.default != null && row[key] == null) {
|
if ("default" in schema && schema.default != null && row[key] == null) {
|
||||||
let processed = schema.default
|
const processed =
|
||||||
if (typeof processed === "string") {
|
typeof schema.default === "string"
|
||||||
processed = await processString(schema.default, ctx)
|
? await processString(schema.default, ctx)
|
||||||
}
|
: schema.default
|
||||||
try {
|
try {
|
||||||
row[key] = coerce(processed, schema.type)
|
row[key] = coerce(processed, schema.type)
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|
Loading…
Reference in New Issue