Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now

Follow-up from "Reference all Release data using `camelCase`"

The following discussion from !24700 (merged) should be addressed:

  • @nfriend started a discussion: (+1 comment)

    The convertObjectPropsToCamelCase function automatically translates _links to Links. This is a bit weird, but I went with it since trying to make an exception for this one property seemed like more work than it was worth.

    (And just for some context: there's already an assets.links property in this response, which is distinct from _links.)

copied from discussion:

I’m concerned that this behavior is a bug (or use case omission) in the camelCase utility.

For one, having properties that begin with a capital letter violates our usual naming conventions.

Secondly, property names prefixes with _ often denote some special meaning and this context will be lost in translation.

I believe we ought to update our utility to preserve underscores (and capitalization) in cases where they are found at the beginning or end of a string.

e.g. a._link -> a._link, b._private_var -> b._privateVar, c._reserved_ -> c._reserved_

Assignee Loading
Time tracking Loading