UNPKG

548 BJavaScriptView Raw
1import moment from 'moment';
2
3const plugin = async (schema, documents, config) => {
4 let format;
5 let message = 'Generated on ';
6 if (config && typeof config === 'string') {
7 format = config;
8 }
9 else if (config && typeof config === 'object') {
10 if (config.format) {
11 format = config.format;
12 }
13 if (config.message) {
14 message = config.message;
15 }
16 }
17 return '// ' + message + moment().format(format) + '\n';
18};
19
20export { plugin };
21//# sourceMappingURL=index.esm.js.map