-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c600f4f
commit f03527b
Showing
3 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,2 @@ | ||
tsc --resolveJsonModule --esModuleInterop options_tester.ts | ||
mv options_tester.js options_tester.cjs |
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,21 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var options_schema_json_1 = __importDefault(require("./packages/lib/src/interfaces/options.schema.json")); | ||
var schemasafe_1 = require("@exodus/schemasafe"); | ||
var options_json_1 = __importDefault(require("./packages/demo/public/options.json")); | ||
console.log("Checking Lens options"); | ||
var parse = (0, schemasafe_1.parser)(options_schema_json_1.default, { | ||
includeErrors: true, | ||
allErrors: true, | ||
}); | ||
var validJSON = parse(JSON.stringify(options_json_1.default)); | ||
if (validJSON.valid === true) { | ||
console.log("Options are valid"); | ||
} | ||
else if (typeof options_json_1.default === "object") { | ||
console.error("Lens-Options are not conform with the JSON schema", validJSON.errors); | ||
process.exit(1); | ||
} |
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