Skip to content

Commit 20379ed

Browse files
Fix deployment config cloning
1 parent 50efe53 commit 20379ed

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

backend/eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default defineConfig({
3333
"guard-for-in": "warn",
3434
"no-console": "error",
3535
"require-await": "warn",
36+
"@typescript-eslint/no-unused-vars": [
37+
"error",
38+
{ ignoreRestSiblings: true },
39+
],
3640
},
3741
extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked],
3842
});

backend/src/db/repo/deployment.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,17 @@ export class DeploymentRepo {
287287
if (config === null) {
288288
return null;
289289
}
290-
const newConfig = structuredClone(config);
291290

292-
delete newConfig.getEnv;
293-
delete newConfig.displayEnv;
294-
delete newConfig.asGitConfig;
291+
const {
292+
// eslint-disable-next-line @typescript-eslint/unbound-method -- This function is unused
293+
getEnv: _getEnv,
294+
// eslint-disable-next-line @typescript-eslint/unbound-method -- This function is unused
295+
asGitConfig: _asGitConfig,
296+
displayEnv: _displayEnv,
297+
...rest
298+
} = config;
299+
300+
const newConfig = structuredClone(rest);
295301

296302
const env = config.getEnv();
297303
return { ...newConfig, env };

0 commit comments

Comments
 (0)