From 4ead835c7b4970154a4e42889c2b300a30a99f9a Mon Sep 17 00:00:00 2001 From: kdh8219 <65698239+kdh8219@users.noreply.github.com> Date: Sat, 29 Apr 2023 00:39:22 +0900 Subject: [PATCH] fix two_way_map invalid error, Duplicated --- src/utils/two-way-map.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/two-way-map.ts b/src/utils/two-way-map.ts index f3640cf..c7d76b9 100644 --- a/src/utils/two-way-map.ts +++ b/src/utils/two-way-map.ts @@ -14,7 +14,7 @@ export default class TwoWayMap { } set_by_first(first: T1, second: T2) { const secondGet = this.secondMap.get(second); - if (!secondGet) { + if (secondGet) { throw new Error("Duplicate second argument"); } this.firstMap.set(first, second); @@ -22,7 +22,7 @@ export default class TwoWayMap { } set_by_second(first: T1, second: T2) { const firstGet = this.firstMap.get(first); - if (!firstGet) { + if (firstGet) { throw new Error("Duplicate first argument"); } this.firstMap.set(first, second);