1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
6 |
|
7 | const moment = _interopDefault(require('moment'));
|
8 |
|
9 | const plugin = async (schema, documents, config) => {
|
10 | let format;
|
11 | let message = 'Generated on ';
|
12 | if (config && typeof config === 'string') {
|
13 | format = config;
|
14 | }
|
15 | else if (config && typeof config === 'object') {
|
16 | if (config.format) {
|
17 | format = config.format;
|
18 | }
|
19 | if (config.message) {
|
20 | message = config.message;
|
21 | }
|
22 | }
|
23 | return '// ' + message + moment().format(format) + '\n';
|
24 | };
|
25 |
|
26 | exports.plugin = plugin;
|
27 |
|