openverse-frontend icon indicating copy to clipboard operation
openverse-frontend copied to clipboard

Convert the media type constants back from TS to JSDoc

Open obulat opened this issue 3 years ago • 0 comments

Problem

We cannot use the media type constants in the scripts that are run by Nodejs without a build step, such as proxy.js in tests, or the locale generator scripts.

Description

We can convert the constants back to use JSDoc. This way they will be typed, but at the same time be valid JS that can be used from JS scripts.

Alternatives

Create a duplicate JS file - would be dangerous because it would drift away from one source of truth. Use hard-coded constants in the scripts - this may also result in incorrect constant values.

Additional context

Implementation

  • [ ] 🙋 I would be interested in implementing this feature.

obulat avatar Jun 10 '22 13:06 obulat