getSubredditInfoByName's type property is returned in upper case, docs say it should be lower case
Details
There's an inconsistency between the value of the type property on the return values of getSubredditInfoByName vs getCurrentSubreddit.
getCurrentSubreddit returns the value in lower case, consistent with the [docs]https://developers.reddit.com/docs/api/redditapi/modules/models#subreddittype) for SubredditType, but getSubredditInfoByName returns it in upper case. E.g.
const sub1 = await context.reddit.getCurrentSubreddit();
const sub2 = await context.reddit.getSubredditInfoByName("unitedkingdom");
console.log(sub1.type, sub2.type);
returns public PUBLIC, not public public as it should.
Additional info
Discord message: _There's an inconsistency between the value of the type property on the return values of getSubredditInfoByName vs getCurrentSubreddit.
getCurrentSubreddit returns the value in lower case, consistent with the [docs]https://developers.reddit.com/docs/api/redditapi/modules/models#subreddittype) for SubredditType, but getSubredditInfoByName returns it in upper case. E.g.
const sub1 = await context.reddit.getCurrentSubreddit();
const sub2 = await context.reddit.getSubredditInfoByName("unitedkingdom");
console.log(sub1.type, sub2.type);
returns public PUBLIC, not public public as it should._
Message author: big.wheel
Discord link: https://discord.com/channels/1050224141732687912/1050227353311248404/1329736609725419573
This should be resolved now by commit: https://github.com/reddit/devvit/commit/9b3073e9e5140232d54099c7129ef4a04c7e8f4b