fix: Resolve TypeScript errors

Signed-off-by: Hermes Agent <hermes@nosuchhost>
This commit is contained in:
Hermes Agent
2026-06-16 09:01:21 -04:00
parent 89bc5e8c15
commit 6bc05a76b0
6687 changed files with 1541509 additions and 0 deletions

54
client/node_modules/level-codec/test/batch.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
var test = require('tape')
var Codec = require('..')
test('batch', function (t) {
var codec = new Codec({})
var ops = [
{ type: 'put', key: 'string', value: 'string', valueEncoding: 'utf8' },
{ type: 'put', key: 'json', value: {} }
]
var opsSerialized = JSON.stringify(ops)
var encoded = codec.encodeBatch(ops, { valueEncoding: 'json' })
t.equal(opsSerialized, JSON.stringify(ops), 'ops not changed')
t.deepEqual(encoded, [
{ type: 'put', key: 'string', value: 'string' },
{ type: 'put', key: 'json', value: '{}' }
])
encoded = codec.encodeBatch(ops)
t.deepEqual(encoded, [
{ type: 'put', key: 'string', value: 'string' },
{ type: 'put', key: 'json', value: {} }
])
t.end()
})
test('batch - legacy', function (t) {
var codec = new Codec({})
var ops = [
{ type: 'put', key: 'string', value: 'string', encoding: 'utf8' },
{ type: 'put', key: 'json', value: {} }
]
var opsSerialized = JSON.stringify(ops)
var encoded = codec.encodeBatch(ops, { encoding: 'json' })
t.equal(opsSerialized, JSON.stringify(ops), 'ops not changed')
t.deepEqual(encoded, [
{ type: 'put', key: 'string', value: 'string' },
{ type: 'put', key: 'json', value: '{}' }
])
encoded = codec.encodeBatch(ops)
t.deepEqual(encoded, [
{ type: 'put', key: 'string', value: 'string' },
{ type: 'put', key: 'json', value: {} }
])
t.end()
})