Skip to content

Commit d989494

Browse files
committed
Can add a default configuration to just fill the unspecified fields
1 parent b0bf9f1 commit d989494

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

package/src/ConfigurationProvider.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ export class ConfigurationProvider<T> {
2929
}
3030
}
3131
}
32+
33+
/**
34+
* Add a default object that will only add params that aren't already specified
35+
* @param obj
36+
*/
37+
public addDefaultObject(obj: any) {
38+
if (obj) {
39+
this.mergedConfiguration = <T>merge(obj, this.mergedConfiguration);
40+
}
41+
}
3242
}
3343

3444
export function loadConfigurationJSON(callback) {

0 commit comments

Comments
 (0)