angular/aio/tools/transforms/angular-extended-diagnostics-package/readers/extended-diagnostic.js
George Kalpakas 7480660a95 fix(docs-infra): track error docs during serve-and-sync (#44704)
Refs #42966.

Look for changes in error docs (i.e. docs under `aio/content/error/`) in
`authors-package`, so that such docs are tracked when running the
`serve-and-sync` script.

PR Close #44704
2022-01-24 10:41:13 -08:00

24 lines
656 B
JavaScript

/**
* @dgService
* @description
* This file reader will pull the contents from an extended diagnostic text file (by default `.md`).
*
* The doc will initially have the form:
* ```
* {
* docType: 'extended-diagnostic',
* content: 'the content of the file',
* }
* ```
*/
module.exports = function extendedDiagnosticFileReader() {
return {
name: 'extendedDiagnosticFileReader',
defaultPattern: /\.md$/,
getDocs: fileInfo => {
// We return a single element array because extended-diagnostic files only contain one
// document.
return [{docType: 'extended-diagnostic', content: fileInfo.content}];
},
};
};