This repository was archived by the owner on Oct 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ import { isDev } from './utils' ;
2+
13// The Log Code Manager keeps track
24// and manages all important Logs of AgileTs.
35//
@@ -163,8 +165,9 @@ const niceLogCodeMessages = {
163165 '00:03:01' : "'${0}' has to be of the type ${1}!" ,
164166} ;
165167
166- const logCodeMessages : typeof niceLogCodeMessages =
167- process . env . NODE_ENV === 'dev' ? niceLogCodeMessages : ( { } as any ) ;
168+ const logCodeMessages : typeof niceLogCodeMessages = isDev
169+ ? niceLogCodeMessages
170+ : ( { } as any ) ;
168171
169172/**
170173 * Returns the log message according to the specified log code.
@@ -258,7 +261,7 @@ function logIfTags<T extends LogCodesArrayType<typeof logCodeMessages>>(
258261 * @internal
259262 */
260263let tempLogCodeManager ;
261- if ( typeof process === 'object' && process . env . NODE_ENV !== 'production' ) {
264+ if ( isDev ) {
262265 tempLogCodeManager = {
263266 getLog,
264267 log,
Original file line number Diff line number Diff line change @@ -272,3 +272,6 @@ export const runsOnServer = (): boolean => {
272272 typeof window . document . createElement !== 'undefined'
273273 ) ;
274274} ;
275+
276+ export const isDev =
277+ typeof process === 'object' && process . env . NODE_ENV !== 'production' ;
You can’t perform that action at this time.
0 commit comments