Skip to content

Commit 9c33379

Browse files
committed
tweak undefined
1 parent 5163348 commit 9c33379

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/browser/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function logger (
6060
{ prevTime, color },
6161
env?:Record<string, string>
6262
) {
63+
args = args || []
6364
if (!isEnabled(namespace, env)) return
6465

6566
// Set `diff` timestamp

src/node.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ function formatArgs ({ diff, color, namespace, useColors }:{
230230
color:number,
231231
namespace:string,
232232
useColors:boolean
233-
}, args:string[]):typeof args {
233+
}, args:string[]):string[] {
234+
args = args || []
235+
234236
if (useColors) {
235237
const c = color
236238
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c)

0 commit comments

Comments
 (0)