nest icon indicating copy to clipboard operation
nest copied to clipboard

feat(common): add new enums to common/enums

Open Adi3g opened this issue 1 year ago • 1 comments
trafficstars

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior?

Lack of standardized enums for common constants such as HTTP headers, protocols, MIME types, and other frequently used values. This leads to inconsistent usage and potential errors due to typos or mismatches.

Issue Number: N/A

What is the new behavior?

This PR introduces new enums in the common/enums directory to centralize and standardize common constants across the application. The new enums include:

  • CACHE_CONTROL: Common cache control directives.
  • CORS_SETTING: Common CORS settings headers.
  • HTTP_HEADERS: A list of HTTP headers.
  • MIME_TYPE: Common MIME types for content-type headers.
  • PROTOCOL: List of network protocols.
  • TIME_UNIT: Time units for various time-related operations.

These enums improve code maintainability and readability by reducing hard-coded values and standardizing their use across the codebase.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

Adi3g avatar Sep 01 '24 11:09 Adi3g