1 | import moment from 'moment';
|
2 | import pkg from '../package.json';
|
3 |
|
4 | const header = `
|
5 | ${ pkg.homepage }
|
6 |
|
7 | ${ pkg.description }
|
8 |
|
9 | @version ${ pkg.version }
|
10 | @date ${ moment().utc().format() }
|
11 |
|
12 | @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
13 | @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs
|
14 |
|
15 | @license
|
16 | vis.js is dual licensed under both
|
17 |
|
18 | 1. The Apache 2.0 License
|
19 | http://www.apache.org/licenses/LICENSE-2.0
|
20 |
|
21 | and
|
22 |
|
23 | 2. The MIT License
|
24 | http://opensource.org/licenses/MIT
|
25 |
|
26 | vis.js may be distributed under either license.`;
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | function genHeader(component) {
|
35 | return '/**\n' + [
|
36 | pkg.name,
|
37 | component ? ' - ' + component : '',
|
38 | header
|
39 | ].join('')
|
40 | .replace(/^(?!\n)/gm, ' * ')
|
41 | .replace(/^(?=\n)/gm, ' *') + '\n */';
|
42 | }
|
43 |
|
44 | export default genHeader;
|