1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00

New updates and modules

This commit is contained in:
DanieL 2022-07-15 11:08:01 -03:00
parent 4d5d408898
commit 0abf0f90f6
959 changed files with 364301 additions and 17493 deletions

54
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()
})