Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Export the names and codes as object (instead of array) #49

@KrishnaPG

Description

@KrishnaPG

Currently constants.names and constants.codes are exported as Arrays, which means looking-up if a particular name or code exists requires scanning the whole array.

exports.names = Object.freeze(Object.keys(constants.names))
exports.codes = Object.freeze(Object.keys(constants.codes))

Please export those name and codes as objects directly so that callers can lookup directly, and also get the name from the code, and vice-versa (since the object structure has rich info on relations between them, which is lost when Object.keys is performed).

Something like below:

 exports.names = Object.freeze(constants.names)
 exports.codes = Object.freeze(constants.codes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions