Skip to content

Commit

Permalink
Don't try to serialize or deserialize blobs in arrays
Browse files Browse the repository at this point in the history
We don't have any
  • Loading branch information
GarboMuffin committed Aug 19, 2023
1 parent 671230e commit 38e657b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/p4/blob-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const isObjectOrArray = (value) => value !== null && typeof value === 'object';
*/
const recursivelySerializeBlobs = async (object) => {
if (Array.isArray(object)) {
return Promise.all(object.map(recursivelySerializeBlobs));
return object;
}
const result = {};
for (const key of Object.keys(object)) {
Expand Down Expand Up @@ -48,7 +48,7 @@ const recursivelySerializeBlobs = async (object) => {
*/
const recursivelyDeserializeBlobs = (object) => {
if (Array.isArray(object)) {
return object.map(recursivelyDeserializeBlobs);
return object;
}
const result = {};
for (const key of Object.keys(object)) {
Expand Down
3 changes: 3 additions & 0 deletions test/p4/blob-seriralizer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ test('basic cloning functionality', async () => {
c: 3,
d: "test"
}
],
z: [
'abcdef'
]
},
e: true
Expand Down

0 comments on commit 38e657b

Please sign in to comment.