store null value

This commit is contained in:
codetypes committed 2025-10-26 10:06:49 +08:00
1 parent 18786b2a62
commit 13986c9b2f
5 files changed
+9 -6

No files matched your search

+1
View File
@@ -738,6 +738,7 @@ const NodeInspector: FC = () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const finish = (values: any) => {
const data = {} as NodeData;
data.$id = editingNode.data.$id;
data.id = editingNode.data.id;
data.name = values.name;
data.debug = values.debug || undefined;
+1 -1
View File
@@ -1,6 +1,6 @@
import { NodeDef } from "../behavior3/src/behavior3";
export const VERSION = "1.8.7";
export const VERSION = "1.8.8";
export const keyWords = ["true", "false", "null", "undefined", "NaN", "Infinity"];
+4 -2
View File
@@ -251,8 +251,10 @@ export const stringifyJson = (data: unknown, option?: JsonStringifyOption) => {
buffer.writeString(numberToString(value, ctx.precision));
} else if (typeof value === "boolean") {
buffer.writeString(value.toString());
} else if (value === null || value === undefined) {
} else if (value === null) {
buffer.writeString("null");
} else if (value === undefined) {
buffer.writeString("undefined");
} else if (typeof value === "string") {
buffer.writeString('"');
buffer.writeString(escape(value));
@@ -280,7 +282,7 @@ export const stringifyJson = (data: unknown, option?: JsonStringifyOption) => {
return;
}
const ks = keys(value, undefined, value["!ignore"]);
const ks = keys(value, (v) => v !== undefined, value["!ignore"]);
const space = ctx.indent > 0 ? " " : "";
buffer.writeString("{");
buffer.linefeed();