Skip to content

Commit f092e5d

Browse files
committed
docs
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent da241f7 commit f092e5d

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

src/validation/baseValidator.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ import type { Version } from '../spec'
2121

2222
export interface Validator {
2323
/**
24-
* Promise rejects with one of the following
24+
* validate the data.
25+
*
26+
* Promise may reject with one of the following:
2527
* - {@link Validation.NotImplementedError | NotImplementedError} when there is no validator available for `this.version`
2628
* - {@link Validation.MissingOptionalDependencyError | MissingOptionalDependencyError} when a required dependency was not installed
2729
* - {@link Validation.ValidationError | ValidationError} when `data` was invalid to the schema
2830
*/
2931
validate: (data: string) => Promise<void>
3032
}
3133

32-
export abstract class BaseValidator implements BaseValidator {
34+
export abstract class BaseValidator implements Validator {
3335
readonly #version: Version
3436

3537
constructor (version: Version) {
@@ -40,5 +42,6 @@ export abstract class BaseValidator implements BaseValidator {
4042
return this.#version
4143
}
4244

45+
/** {@inheritDoc Validator.validate} */
4346
abstract validate (data: string): Promise<void>
4447
}

src/validation/index.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export * from './index.common'
2121

2222
// region node-specifics
2323

24-
export * from './jsonValidator'
24+
export * from './jsonValidator.node'
2525
export * from './xmlValidator.node'
2626

2727
// endregion node-specifics

src/validation/index.web.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ export * from './index.common'
2121

2222
// region web-specifics
2323

24-
// json validator is notentirely tested fr WEB, yet
25-
// export * from './jsonValidator'
26-
27-
// there is no XML validator for the web, yet
24+
// there is no JSON validator for the web, yet
25+
// there is no XML validator for the web, yet
2826

2927
// endregion web-specifics

src/validation/jsonValidator.ts renamed to src/validation/jsonValidator.node.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ abstract class BaseJsonValidator extends BaseValidator {
9999
}
100100

101101
/**
102-
* Promise rejects with one of the following
102+
* Validate the data against CycloneDX spec of `this.version`.
103+
*
104+
* Promise may reject with one of the following:
103105
* - {@link Validation.NotImplementedError | NotImplementedError} when there is no validator available for `this.version`
104106
* - {@link Validation.MissingOptionalDependencyError | MissingOptionalDependencyError} when a required dependency was not installed
105107
* - {@link Validation.ValidationError | ValidationError} when `data` was invalid to the schema

src/validation/xmlValidator.node.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ export class XmlValidator extends BaseValidator {
7373
}
7474

7575
/**
76-
* Promise rejects with one of the following
76+
* Validate the data against CycloneDX spec of `this.version`.
77+
*
78+
* Promise may reject with one of the following:
7779
* - {@link Validation.NotImplementedError | NotImplementedError} when there is no validator available for `this.version`
7880
* - {@link Validation.MissingOptionalDependencyError | MissingOptionalDependencyError} when a required dependency was not installed
7981
* - {@link Validation.ValidationError | ValidationError} when `data` was invalid to the schema

0 commit comments

Comments
 (0)