require author object format

This commit is contained in:
Timo Hocker 2020-07-19 10:46:12 +02:00
parent 1c4224adf6
commit 01dc0b4d4a

19
ci.js
View File

@ -5,8 +5,7 @@
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
/* eslint-disable */
/* eslint-disable no-console, no-process-exit, prefer-named-capture-group */
'use strict';
const fs = require ('fs');
@ -30,6 +29,22 @@ if (typeof pkg.repository === 'undefined') {
ok = false;
}
if (typeof pkg.author === 'object') {
if (typeof pkg.author.name !== 'string') {
console.log ('author name undefined');
ok = false;
}
if (typeof pkg.author.email !== 'string') {
console.log ('author email undefined');
ok = false;
}
}
else {
console.log ('author not in object format');
ok = false;
}
function major (version) {
return version.replace (/\.[0-9x]+$/ui, '');
}