Skip to content

Commit

Permalink
convert all objects to json
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Nov 15, 2024
1 parent d740d83 commit 0338c18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/managers/BaseCacheManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class BaseCacheManager {
case TO_JSON_TYPES_ENUM.CACHE_FORMAT:
case TO_JSON_TYPES_ENUM.DISCORD_FORMAT:
default: {
return [...this.#cache.values()];
return [...this.#cache.values()].map((value) => value.toJSON(format));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/managers/BaseCacheManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ describe("BaseCacheManager", function () {
const baseCacheManager = new BaseCacheManager(client, {
structureType: guildEmojisManager,
});
baseCacheManager.set("key", "value");
baseCacheManager.set("key", { value: "value", toJSON: () => "value" });
expect(baseCacheManager.toJSON()).to.deep.equal(["value"]);
});
});
Expand Down

0 comments on commit 0338c18

Please sign in to comment.