Effect CommunityEC
Effect Community3mo ago
5 replies
RATIU5

Issue with `Options.optional` Wrapping in Extra Option

Is this a bug, or am I misusing Options.optional? Whenever I use Options.optional, the Option gets wrapped in an extra option: https://effect.website/play#5dccc6547c49
{ /* Options.withDefault: this one works fine */
    _tag: 'WithDefault',
    options: {
      _tag: 'WithDefault',
      options: {
        _tag: 'Single',
        name: 'silent1',
        fullName: '--silent1',
        placeholder: 'boolean',
        aliases: [Array],
        primitiveType: [Object],
        description: [Object],
        pseudoName: [Object]
      },
      fallback: false
    },
    fallback: false
  }
  { /* Options.optional: this one has an extra "options" property */
    _tag: 'WithDefault',
    options: {
      _tag: 'Map',
      options: { _tag: 'WithDefault', options: [Object], fallback: false },
      f: [Function (anonymous)]
    },
    fallback: { _id: 'Option', _tag: 'None' }
  }
Was this page helpful?