UNPKG

771 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
7const moment = _interopDefault(require('moment'));
8
9const 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
26exports.plugin = plugin;
27//# sourceMappingURL=index.cjs.js.map