MCPcopy Create free account
hub / github.com/react-hook-form/react-hook-form / checkReportMatchesApi

Function checkReportMatchesApi

scripts/apiExtractor.js:21–37  ·  view source on GitHub ↗

* Runs the API Extractor to check if the API report matches the API. * Exits with status code 1 if it does not match. * @param config {ExtractorConfig}

(config)

Source from the content-addressed store, hash-verified

19 * @param config {ExtractorConfig}
20 */
21function checkReportMatchesApi(config) {
22 const result = Extractor.invoke(config, {
23 localBuild: false, // validate report, fail on warnings or errors
24 messageCallback: (message) => {
25 // suppress all error or warnings
26 message.handled = true;
27 },
28 });
29
30 if (result.apiReportChanged) {
31 exit(
32 `The API Extractor report does not match the exported API.`,
33 `Please run \`${API_EXTRACTOR_YARN_COMMAND}\` to generate an`,
34 `updated report and commit it.`,
35 );
36 }
37}
38
39/**
40 * Runs the API Extractor.

Callers 1

apiExtractor.jsFile · 0.85

Calls 1

exitFunction · 0.85

Tested by

no test coverage detected