Fediseer / fediseer

Something something stop bad instances
GNU Affero General Public License v3.0
50 stars 6 forks source link

[Enhancement] Return zero/empty arrays instead of null #45

Open asimons04 opened 11 months ago

asimons04 commented 11 months ago

Instead of returning null for certain keys in the API responses, consider returning 0 for numeric values or an empty array [] for values that, if populated, would normally return an array.

This would make interfacing with the API much easier for Javascript/Typescript (possibly other languages as well).

Example Candidates:

RikudouSage commented 10 months ago

Isn't null generally easy to handle? Like, in TS/JS:

if (instance?.moderators) {
    // do something
}