mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix ci
This commit is contained in:
4 files changed
+13
-16
No files matched your search
@@ -40,12 +40,12 @@ export class ConfigService extends Service {
|
||||
|
||||
applyDelta(source: any, key: string, value: any) {
|
||||
const path = key.split('.');
|
||||
if (path.filter((i) => ['__proto__', 'prototype'].includes(i)).length) return false;
|
||||
if (path.filter((i) => ['__proto__', 'prototype', 'constructor'].includes(i)).length) return false;
|
||||
const t = path.pop();
|
||||
const root = JSON.parse(JSON.stringify(source));
|
||||
let cursor = root;
|
||||
for (const p of path) {
|
||||
cursor[p] ||= {};
|
||||
cursor[p] ??= {};
|
||||
cursor = cursor[p];
|
||||
}
|
||||
cursor[t] = value;
|
||||
|
||||
Reference in new issue
Block a user