Skip to content

Commit

Permalink
Update storage.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored Aug 3, 2024
1 parent 2aa4319 commit a8e9cf6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libs/langchain-mongodb/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,10 @@ export class MongoDBStore extends BaseStore<string, Uint8Array> {
}
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");
}
Expand Down

0 comments on commit a8e9cf6

Please sign in to comment.