import { isDevMode } from '@angular/core' ; const record = { } ; export const PREFIX = '[TETHYS-CDK]:' ; function notRecorded ( ... args ) { const asRecord = args . reduce ( ( acc , c ) => acc + c . toString ( ) , '' ) ; if ( record [ asRecord ] ) { return false ; } else { record [ asRecord ] = true ; return true ; } } function consoleCommonBehavior ( consoleFunc , ... args ) { if ( isDevMode ( ) && notRecorded ( ... args ) ) { consoleFunc ( ... args ) ; } } export const warn = ( ... args ) => consoleCommonBehavior ( ( ... arg ) => console . warn ( PREFIX , ... arg ) , ... args ) ; export function createWarnDeprecation ( prefix ) { return ( ... args ) => { const stack = new Error ( ) . stack ; return consoleCommonBehavior ( ( ... arg ) => { console . warn ( prefix , 'deprecated:' , ... arg , stack ) ; } , ... args ) ; } ; } export const warnDeprecation = createWarnDeprecation ( PREFIX ) ; export const log = ( ... args ) => { if ( isDevMode ( ) ) { console . log ( PREFIX , ... args ) ; } } ;