Skip to content

Commit

Permalink
fix: deep replace
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Oct 18, 2022
1 parent 0cba630 commit 2f067ff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"dependencies": {
"@nestjs/common": "^8.4.7",
"@vodyani/class-decorator": "^8.2.3",
"@vodyani/core": "^8.9.8",
"@vodyani/utils": "^8.7.1",
"@vodyani/core": "^8.10.0",
"@vodyani/utils": "^8.8.1",
"js-yaml": "^4.1.0",
"lodash": "4.17.21"
},
Expand Down
4 changes: 2 additions & 2 deletions src/provider/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { This } from '@vodyani/class-decorator';
import { IConfig } from '@vodyani/core';
import { isValidDict, toDeepMatch, toDeepMerge, toDeepSave } from '@vodyani/utils';
import { isValidDict, toDeepMatch, toDeepMerge, toDeepReplace } from '@vodyani/utils';
import { cloneDeep } from 'lodash';

@Injectable()
Expand All @@ -22,7 +22,7 @@ export class ConfigProvider<T = any> implements IConfig<T> {

@This
public replace(key: string, value: any) {
toDeepSave(this.writeConfig, value, key);
this.writeConfig = toDeepReplace(this.writeConfig, value, key);
this.updateReadonlyConfig();
}

Expand Down

0 comments on commit 2f067ff

Please sign in to comment.