fix optional array
This commit is contained in:
1 parent
45624c6869
commit
8198c19c7c
3 files changed
+5
-2
No files matched your search
@@ -137,6 +137,7 @@ async function createWindow(projectPath?: string) {
|
|||||||
trafficLightPosition: { x: 10, y: 10 },
|
trafficLightPosition: { x: 10, y: 10 },
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload,
|
preload,
|
||||||
|
webSecurity: false,
|
||||||
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
|
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
|
||||||
// Consider using contextBridge.exposeInMainWorld
|
// Consider using contextBridge.exposeInMainWorld
|
||||||
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
|
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
<!-- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> -->
|
||||||
<title>Behavior3 Editor</title>
|
<title>Behavior3 Editor</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+3
-1
@@ -267,11 +267,13 @@ export const checkNodeArg = (
|
|||||||
const arg = conf.args![i] as NodeArg;
|
const arg = conf.args![i] as NodeArg;
|
||||||
const value = data.args?.[arg.name];
|
const value = data.args?.[arg.name];
|
||||||
if (isNodeArgArray(arg)) {
|
if (isNodeArgArray(arg)) {
|
||||||
if (!Array.isArray(value) || (!isNodeArgOptional(arg) && value.length === 0)) {
|
if (!Array.isArray(value) || value.length === 0) {
|
||||||
|
if (!isNodeArgOptional(arg)) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
error(data, `'${arg.name}=${JSON.stringify(value)}' is not an array or empty array`);
|
error(data, `'${arg.name}=${JSON.stringify(value)}' is not an array or empty array`);
|
||||||
}
|
}
|
||||||
hasError = true;
|
hasError = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let j = 0; j < value.length; j++) {
|
for (let j = 0; j < value.length; j++) {
|
||||||
if (!checkNodeArgValue(data, arg, value[j], verbose)) {
|
if (!checkNodeArgValue(data, arg, value[j], verbose)) {
|
||||||
|
|||||||
Reference in new issue
Block a user