Skip to content

Commit

Permalink
fix: remove 'util' dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Dec 8, 2021
1 parent 9aeed6b commit 875d5ea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/test-cbor-vectors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-env mocha,es2020 */

import chai from 'chai'
import { inspect } from 'util'

import { decode, encode } from '../cborg.js'
import * as taglib from 'cborg/taglib'
Expand Down Expand Up @@ -93,3 +92,16 @@ describe('cbor/test-vectors', () => {
it.skip('encode w/ tags', () => {
})
})

function inspect (o) {
if (typeof o === 'string') {
return `'${o}'`
}
if (o instanceof Uint8Array) {
return `Uint8Array<${o.join(',')}>`
}
if (o == null || typeof o !== 'object') {
return String(o)
}
return JSON.stringify(o)
}

0 comments on commit 875d5ea

Please sign in to comment.