npm package diff
Package: @forge/cli
Versions: 12.8.0-next.18-experimental-003d118 - 12.8.0-next.24
File: package/out/custom-scopes/validate/index.js
Index: package/out/custom-scopes/validate/index.js
===================================================================
--- package/out/custom-scopes/validate/index.js
+++ package/out/custom-scopes/validate/index.js
@@ -1,24 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const tslib_1 = require("tslib");
-const ajv_1 = tslib_1.__importDefault(require("ajv"));
-const cli_shared_1 = require("@forge/cli-shared");
-const schema = tslib_1.__importStar(require("./schema.json"));
-function validate(value) {
- const ajv = new ajv_1.default({ allErrors: true, verbose: true, strict: true });
- const validator = ajv.compile(schema);
- const isValid = validator(value);
- if (isValid) {
- return {
- isValid: true,
- data: value
- };
- }
- const errors = validator.errors?.map((error) => cli_shared_1.Text.customScopes.validation.formatError(error.instancePath, error.message)) || [cli_shared_1.Text.customScopes.validation.failed];
- return {
- isValid: false,
- errors
- };
-}
-exports.default = validate;
-//# sourceMappingURL=index.js.map
\ No newline at end of file