DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.36k stars 29 forks source link

Hyphenated object keys like `Content-Type:` #1377

Closed edemaine closed 1 month ago

edemaine commented 1 month ago

I was looking back at old Discord messages and noticed this feature suggestion by @esthedebeste. (She also suggested spaces, but that seems harder.)

Hyphenated names are at least a small improvement that's nice for dealing with HTTP headers. Existing support for numbers take priority, so e.g. -0n: still turns into a key of 0, while -0n-x: doesn't parse. Basically you need to start with a letter or a hyphen followed by a letter.