Skip to content

Commit

Permalink
Fix problem where keys with undefined values would overwrite default …
Browse files Browse the repository at this point in the history
…config
  • Loading branch information
runem committed Dec 12, 2019
1 parent 3b372d1 commit 5d19404
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/analyze/make-context-from-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export function makeContextFromConfig(options: AnalyzerOptions): AnalyzerVisitCo
general: new Map()
},
config: {
analyzeLibDom: false,
excludedDeclarationNames: [],
features: ALL_COMPONENT_FEATURES,
...(options.config || {})
...options.config,
analyzeLibDom: options.config?.analyzeLibDom ?? false,
excludedDeclarationNames: options.config?.excludedDeclarationNames ?? [],
features: options.config?.features ?? ALL_COMPONENT_FEATURES
}
};
}
1 change: 1 addition & 0 deletions src/cli/analyzer-cli-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface AnalyzerCliConfig {

features?: ComponentFeature[];
discoverLibraryFiles?: boolean;
analyzeGlobalFeatures?: boolean;

markdown?: {
titleLevel?: number;
Expand Down
3 changes: 2 additions & 1 deletion src/cli/util/analyze-globs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export async function analyzeGlobs(
verbose: config.verbose || false,
ts: config.ts,
config: {
features: config.features
features: config.features,
analyzeGlobalFeatures: config.analyzeGlobalFeatures
}
});

Expand Down
4 changes: 1 addition & 3 deletions test/helpers/test-result-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ function testResult(
test(testName, async t => {
const { results, program } = await analyzeGlobs(globs, {
discoverLibraryFiles: true,
analyze: {
analyzeGlobalFeatures: true
}
analyzeGlobalFeatures: true
});

const nonEmptyResults = results.filter(result => result.componentDefinitions.length > 0);
Expand Down

0 comments on commit 5d19404

Please sign in to comment.