MCPcopy Create free account
hub / github.com/appium/appium / handler

Function handler

packages/docutils/lib/cli/command/validate.ts:68–89  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

66 });
67 },
68 async handler(args) {
69 let errorCount = 0;
70 const validator = new DocutilsValidator(args)
71 .once(DocutilsValidator.BEGIN, (kinds: ValidationKind[]) => {
72 log.info(`Validating: ${kinds.join(', ')}`);
73 })
74 .once(DocutilsValidator.END, (errCount: number) => {
75 errorCount = errCount;
76 })
77 .on(DocutilsValidator.FAILURE, (err: DocutilsError) => {
78 log.error(err.message);
79 })
80 .on(DocutilsValidator.SUCCESS, (msg: string) => {
81 log.success(msg);
82 });
83
84 await validator.validate();
85
86 if (errorCount) {
87 throw new DocutilsError(`Validation failed with ${errorCount} ${util.pluralize('error', errorCount)}`);
88 }
89 },
90} as CommandModule<object, ValidateOptions>;

Callers

nothing calls this directly

Calls 3

infoMethod · 0.65
errorMethod · 0.65
validateMethod · 0.45

Tested by

no test coverage detected