mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
use nullish coalescing and fix mode plugin pick up
This commit is contained in:
@@ -52,7 +52,7 @@ export class NumberField<Required extends true | false = false> extends Field<
|
|||||||
|
|
||||||
switch (context) {
|
switch (context) {
|
||||||
case "submit":
|
case "submit":
|
||||||
return Number.parseInt(value);
|
return Number.parseInt(value, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export function getChangeSet(
|
|||||||
const value = _value === "" ? null : _value;
|
const value = _value === "" ? null : _value;
|
||||||
|
|
||||||
// normalize to null if undefined
|
// normalize to null if undefined
|
||||||
const newValue = field.getValue(value, "submit") || null;
|
const newValue = field.getValue(value, "submit") ?? null;
|
||||||
// @todo: add typing for "action"
|
// @todo: add typing for "action"
|
||||||
if (action === "create" || newValue !== data[key]) {
|
if (action === "create" || newValue !== data[key]) {
|
||||||
acc[key] = newValue;
|
acc[key] = newValue;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export async function makeModeConfig<
|
|||||||
const { typesFilePath, configFilePath, writer, syncSecrets: syncSecretsOptions } = config;
|
const { typesFilePath, configFilePath, writer, syncSecrets: syncSecretsOptions } = config;
|
||||||
|
|
||||||
const isProd = config.isProduction ?? _isProd();
|
const isProd = config.isProduction ?? _isProd();
|
||||||
const plugins = appConfig?.options?.plugins ?? ([] as AppPlugin[]);
|
const plugins = config?.options?.plugins ?? ([] as AppPlugin[]);
|
||||||
const syncFallback = typeof config.syncSchema === "boolean" ? config.syncSchema : !isProd;
|
const syncFallback = typeof config.syncSchema === "boolean" ? config.syncSchema : !isProd;
|
||||||
const syncSchemaOptions =
|
const syncSchemaOptions =
|
||||||
typeof config.syncSchema === "object"
|
typeof config.syncSchema === "object"
|
||||||
|
|||||||
Reference in New Issue
Block a user