import * as core from '@actions/core' ; export const getInput = ( name ) => core . getInput ( name ) || undefined ; export const getRequiredInput = ( name ) => core . getInput ( name , { required : true } ) ; export const daysSince = ( timestamp ) : number => ( Date . now ( ) - timestamp ) / 1000 / 60 / 60 / 24 ; export const daysAgoToTimestamp = ( days ) : number => + new Date ( Date . now ( ) - days * 24 * 60 * 60 * 1000 ) ; export const daysAgoToHumanReadbleDate = ( days ) => new Date ( Date . now ( ) - days * 24 * 60 * 60 * 1000 ) . toISOString ( ) . replace ( /\.\d{3}\w$/ , '' ) ; export const safeLog = ( message , ... args ) : void => { const clean = ( val ) => ( '' + val ) . replace ( /:|#/g , '' ) ; console . log ( clean ( message ) , ... args . map ( clean ) ) ; } ;