Skip to content

Commit 62a23bb

Browse files
Bas950porsager
authored andcommitted
feat: don't override array type if already exists
1 parent c9ded40 commit 62a23bb

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

cjs/src/connection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
735735
}
736736

737737
function addArrayType(oid, typarray) {
738+
if (!!options.parsers[typarray] && !!options.serializers[typarray]) return;
738739
const parser = options.parsers[oid]
739740
options.shared.typeArrayMap[oid] = typarray
740741
options.parsers[typarray] = (xs) => arrayParser(xs, parser)

deno/src/connection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
739739
}
740740

741741
function addArrayType(oid, typarray) {
742+
if (!!options.parsers[typarray] && !!options.serializers[typarray]) return;
742743
const parser = options.parsers[oid]
743744
options.shared.typeArrayMap[oid] = typarray
744745
options.parsers[typarray] = (xs) => arrayParser(xs, parser)

src/connection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
736736
}
737737

738738
function addArrayType(oid, typarray) {
739+
if (!!options.parsers[typarray] && !!options.serializers[typarray]) return;
739740
const parser = options.parsers[oid]
740741
options.shared.typeArrayMap[oid] = typarray
741742
options.parsers[typarray] = (xs) => arrayParser(xs, parser)

0 commit comments

Comments
 (0)