Skip to content

Commit a284ee0

Browse files
authored
Merge pull request #2190 from rocketstack-matt/fix/validate-signature-accepts-undefined
fix(shared): update validate() signature to accept undefined
2 parents 63fd92f + 126bcb5 commit a284ee0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cli/src/command-helpers/validate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export async function runValidate(options: ValidateOptions) {
3434
const schemaDirectory = await buildSchemaDirectory(docLoader, options.verbose);
3535
await schemaDirectory.loadSchemas();
3636

37-
let architecture: object | undefined;
38-
let pattern: object | undefined;
39-
let timeline: object | undefined;
37+
let architecture: object | undefined = undefined;
38+
let pattern: object | undefined = undefined;
39+
let timeline: object | undefined = undefined;
4040

4141
if (options.timelinePath) {
4242
const result = await loadTimeline(

shared/src/commands/validate/validate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ async function runSpectralValidations(
9898

9999
/**
100100
* Validation - with simple input parameters and output validation outcomes.
101-
* @param architecture The architecture as a JS object
102-
* @param patternOrSchema The pattern (or schema) as a JS object
103-
* @param timeline The timeline as a JS object
101+
* @param architecture The architecture as a JS object, or undefined if not provided
102+
* @param patternOrSchema The pattern (or schema) as a JS object, or undefined if not provided
103+
* @param timeline The timeline as a JS object, or undefined if not provided
104104
* @param schemaDirectory SchemaDirectory instance for schema resolution
105105
* @param debug Whether to log at debug level
106106
* @returns Validation report

0 commit comments

Comments
 (0)