Skip to content

Commit

Permalink
add logObject console.dir alias
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-dyck committed Oct 22, 2024
1 parent 7bd2cc2 commit c574b11
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions debug/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './logObject.ts'
13 changes: 13 additions & 0 deletions debug/logObject.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test } from 'vitest'
import { logObject } from './logObject.js'

test('logObject', () => {
logObject({
id: 'a1234',
number: 10017,
data: [
{ id: 1, name: 'foo', price: { cents: 170023 } },
{ id: 1, name: 'bar', price: { cents: 45231 } },
],
})
})
2 changes: 2 additions & 0 deletions debug/logObject.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const logObject = (obj: unknown) =>
console.dir(obj, { depth: Infinity, colors: true, numericSeparator: true })
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './arrays/index.ts'
export * from './debug/logObject.ts'
export * from './events/index.ts'
export * from './json/index.ts'
export * from './lazy/index.ts'
Expand Down

0 comments on commit c574b11

Please sign in to comment.