From a8e9cf67c9fbff12d6b4ae2362a41e4e0eab82e9 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Fri, 2 Aug 2024 18:01:36 -0700 Subject: [PATCH] Update storage.ts --- libs/langchain-mongodb/src/storage.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/langchain-mongodb/src/storage.ts b/libs/langchain-mongodb/src/storage.ts index 506484f4398f..528afbe5dbc8 100644 --- a/libs/langchain-mongodb/src/storage.ts +++ b/libs/langchain-mongodb/src/storage.ts @@ -103,12 +103,10 @@ export class MongoDBStore extends BaseStore { } if (value === undefined || value === null) { return undefined; - } - else if (typeof value.value === "object") { + } else if (typeof value.value === "object") { return encoder.encode(JSON.stringify(value.value)); - } - else if (typeof value.value === "string") { - return encoder.encode(value.value); + } else if (typeof value.value === "string") { + return encoder.encode(value.value); } else { throw new Error("Unexpected value type"); }