Skip to content

forAnyValueIfExists should pass if environment doesn't have the key #23

@broom9

Description

@broom9

See the ok2 condition below. Please let me know if you agree.

const condition = {
  stringEquals: {
    forAnyValueIfExists: {
      foo: ['bar', 'baz', 'boo']
    }
  }
};


const ok = {
  foo: ['bar', 'booz', undefined] // This will pass because bar is an accepted value
};

const ok2 = {
  foo: undefined  // This should pass for the same logic as simpleValueIfExists. Currently, this doesn't pass
};

In the use case I have, sometimes the env has a groupId that needs to be matched against a list of IDs to see if it matches any of them. Sometimes the env doesn't have this groupId attribute and it should allow (condition match) in this case.

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