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