Skip to content

Types Refactor: Duplicating literal types in Method & responseEncoding #7519

@tryonelove

Description

@tryonelove

There are duplicate literals in the Method and responseEncoding types. These can be simplified using native TypeScript utilities (Uppercase/Lowercase) and a single source of truth (e.g. type UppercaseMethod = 'GET' | 'POST' | ...).

ResponseEncoding

  type responseEncoding =
    | 'ascii'
    | 'ASCII'
    | 'ansi'
    | 'ANSI'
    | 'binary'
    | 'BINARY'
    | 'base64'
    | 'BASE64'
    | 'base64url'
    | 'BASE64URL'
    | 'hex'
    | 'HEX'
    | 'latin1'
    | 'LATIN1'
    | 'ucs-2'
    | 'UCS-2'
    | 'ucs2'
    | 'UCS2'
    | 'utf-8'
    | 'UTF-8'
    | 'utf8'
    | 'UTF8'
    | 'utf16le'
    | 'UTF16LE';

Method

  type Method =
    | 'get'
    | 'GET'
    | 'delete'
    | 'DELETE'
    | 'head'
    | 'HEAD'
    | 'options'
    | 'OPTIONS'
    | 'post'
    | 'POST'
    | 'put'
    | 'PUT'
    | 'patch'
    | 'PATCH'
    | 'purge'
    | 'PURGE'
    | 'link'
    | 'LINK'
    | 'unlink'
    | 'UNLINK';

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue::enhancementThis issue is related to an enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions