From 01dc0b4d4af8bbc9ae59774301ef3201936962e0 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Sun, 19 Jul 2020 10:46:12 +0200 Subject: [PATCH] require author object format --- ci.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ci.js b/ci.js index 22fc2b3..f0c4f71 100644 --- a/ci.js +++ b/ci.js @@ -5,8 +5,7 @@ * Created by Timo Hocker , 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, ''); }