MCPcopy
hub / github.com/smapiot/piral / readValidatorOptions

Function readValidatorOptions

tools/generate-command-docs.js:50–62  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

48}
49
50function readValidatorOptions(content) {
51 const head = 'export type Options = ';
52 const lines = content.split('\n');
53 const [line] = lines.filter((m) => m.startsWith(head));
54 const value = line.substr(head.length);
55 const options = value.substr(0, value.indexOf(';'));
56
57 if (options === 'void') {
58 return '<none>';
59 }
60
61 return options;
62}
63
64function readValidatorDescription(content) {
65 const head = 'export default ';

Callers 1

readValidatorsFunction · 0.85

Calls 1

filterMethod · 0.65

Tested by

no test coverage detected