@cenk1cenk2/oclif-common 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -204,6 +204,7 @@ declare class ConfigService implements GlobalConfig {
204
204
  constructor(oclif: Command['config'], command: Command['ctor'], config: Omit<GlobalConfig, 'isVerbose' | 'isDebug' | 'isSilent'>);
205
205
  read<T extends LockableData = LockableData>(path: string): Promise<T>;
206
206
  extend<T extends LockableData = LockableData>(paths: string[], strategy?: MergeStrategy): Promise<T>;
207
+ merge<T extends LockableData = LockableData>(configs: Partial<T>[], strategy?: MergeStrategy): Promise<T>;
207
208
  env<T extends LockableData = LockableData>(definition: string, config: T): Promise<T>;
208
209
  write<T extends LockableData = LockableData>(path: string, data: T): Promise<void>;
209
210
  private recalculate;
package/dist/index.js CHANGED
@@ -630,6 +630,12 @@ var ConfigService = class {
630
630
  }
631
631
  })
632
632
  )).filter(Boolean);
633
+ return this.merge(configs, strategy);
634
+ }
635
+ async merge(configs, strategy = "OVERWRITE" /* OVERWRITE */) {
636
+ if (configs.length === 0) {
637
+ throw new Error("Nothing to merge, configuration files are empty.");
638
+ }
633
639
  return merge(strategy, configs.some((config) => Array.isArray(config)) ? [] : {}, ...configs);
634
640
  }
635
641
  async env(definition, config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "author": {