Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Support boolean values in resolveOptions func #174

Open

Description

@bartmacbartek

Reference: https://github.com/confio/ts-relayer/pull/173/files/af3e18ccdaeb5e9f817c1d0372c0ffba6d12993c#r622158971

Allow for boolean values in resolveOption function: https://github.com/confio/ts-relayer/blob/main/src/binary/utils/options/resolve-option.ts

e.g.

const enableMetrics = resolveOption('enableMetrics', { required: true, boolean: true })(
  flags.enableMetrics,
  process.env.RELAYER_ENABLE_METRICS,
  app?.enableMetrics,
  false,
)

Currently, it's only capable of resolving strings to string/integer.

Activity

  1. bartmacbartek commented on Apr 28, 2021

    @bartmacbartek
    ContributorAuthor

    I wonder if this is not an overkill. If boolean flag is not passed, it gets a false value and we never need to throw. 🤷

  2. ethanfrey commented on Apr 28, 2021

    @ethanfrey
    Contributor

    I wonder if this is not an overkill. If boolean flags is not passed, it gets a false value and we never need to throw. shrug

    I guess you are right. Maybe just the non-required version?

  3. bartmacbartek commented on Apr 30, 2021

    @bartmacbartek
    ContributorAuthor

    I guess you are right. Maybe just the non-required version?

    Yeah, I'll try to come up with something nice. Let's see...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BinaryCode for the actual executableenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions