forked from nsjcy/frontEnd/nsjcy

LAPTOP-RI7D261L\Mr Ke
2020-02-03 db3fdea847234226f6721fa347e667c267e16343
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const strftime = require('hife/strftime').default;
module.exports = args => [
  `/**\n`,
  ` * ${strip(process.env.AUTHORINFO)}\n`,
  ` * ${strftime(Date.now())}\n`,
  `${args.length > 0 ? ' *\n' : ''}`,
  `${args.map(arg => ` * ${arg}\n`)}`,
  ` *\n`,
  ` */\n\n`
].join('');
 
 
function strip(info) {
  if (info) {
    const short = /^[" `']*([^" `']+ ?<[-_.@:a-z0-9]+>)[" `']*$/i.exec(info);
    if (short) return short[1];
    return '姓名<example@email.com>'
  }
  return '请设置 AUTHORINFO 环境变量'
}