-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {files, fromFile} from "../lib/input"; | ||
import {formatMessage} from "../lib/tools"; | ||
import {validate} from "../lib/validate"; | ||
import {Resource} from "../resolver/resource"; | ||
|
||
const specs = process.argv[2]; | ||
|
||
if (!specs) { | ||
console.error("Usage: node resolver.js SPEC"); | ||
process.exit(1); | ||
} | ||
|
||
for (let file of files(specs, ".md")) { | ||
let source = fromFile(file); | ||
validate(format, file, source); | ||
} | ||
|
||
function format(input: string) { | ||
let resource = new Resource(input); | ||
let result = formatMessage(resource, new Map(), "test"); | ||
return JSON.stringify(result, null, 4); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters