Skip to content

Commit 8f05600

Browse files
Merge pull request #6 from jacksierkstra/develop
Exporting everything because it can be consumed that way.
2 parents fb34dbd + 3d8bb6f commit 8f05600

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

src/core/main.ts

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
class Checkr {
2-
1+
import { ValidationResult } from "@lib/types/validation";
2+
import { Validator, ValidatorImpl } from "@lib/validator/validator";
3+
import { XMLParser, XMLParserImpl } from "@lib/xml/parser";
4+
import { XSDParser, XSDParserImpl } from "@lib/xsd/parser";
5+
6+
export class Checkr {
7+
8+
private xmlParser: XMLParser;
9+
private xsdParser: XSDParser;
10+
private validator: Validator;
11+
12+
constructor() {
13+
this.xmlParser = new XMLParserImpl();
14+
this.xsdParser = new XSDParserImpl(this.xmlParser);
15+
this.validator = new ValidatorImpl(this.xmlParser, this.xsdParser);
16+
}
17+
18+
public validate(xml: string, xsd: string): Promise<ValidationResult> {
19+
return this.validator.validate(xml, xsd);
20+
}
21+
322
}

src/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
export { Checkr } from "@lib/core/main";
2+
export { ValidationResult } from "@lib/types/validation";
13
export { Validator, ValidatorImpl } from "@lib/validator/validator";
2-
export { XMLParser } from "@lib/xml/parser";
3-
export { XSDParser } from "@lib/xsd/parser";
4-
export { ValidationResult } from "@lib/types/validation";
4+
export { XMLParser, XMLParserImpl } from "@lib/xml/parser";
5+
export { XSDParser, XSDParserImpl } from "@lib/xsd/parser";

0 commit comments

Comments
 (0)