Skip to content

Commit 249db31

Browse files
committed
Use uint8 array
1 parent a0647eb commit 249db31

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

redisinsight/ui/src/utils/formatters/valueFormatters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const stringToSerializedBufferFormat = (format: KeyValueFormat, value: string):
180180
case KeyValueFormat.Msgpack: {
181181
try {
182182
const json = JSON.parse(value)
183-
const encoded = pack(json)
183+
const encoded = Uint8Array.from(pack(json))
184184
return anyToBuffer(encoded)
185185
} catch (e) {
186186
return stringToBuffer(value, format)

redisinsight/ui/src/utils/tests/formatters/valueFormatters.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('bufferToSerializedFormat', () => {
2525
describe(KeyValueFormat.Msgpack, () => {
2626
describe('should properly serialize', () => {
2727
const testValues = [{}, '""', 6677, true, { a: { b: [1, 2, '3'] } }].map((v) => ({
28-
input: anyToBuffer(pack(v)),
28+
input: anyToBuffer(Uint8Array.from(pack(v))),
2929
expected: JSON.stringify(v)
3030
}))
3131

@@ -88,7 +88,7 @@ describe('stringToSerializedBufferFormat', () => {
8888
describe('should properly unserialize', () => {
8989
const testValues = [{}, '""', 6677, true, { a: { b: [1, 2, '3'] } }].map((v) => ({
9090
input: JSON.stringify(v),
91-
expected: anyToBuffer(pack(v))
91+
expected: anyToBuffer(Uint8Array.from(pack(v)))
9292
}))
9393

9494
test.each(testValues)('test %j', ({ input, expected }) => {

0 commit comments

Comments
 (0)