Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a has-key() function #38

Closed
ecerulm opened this issue Nov 8, 2018 · 1 comment
Closed

Add a has-key() function #38

ecerulm opened this issue Nov 8, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@ecerulm
Copy link
Contributor

ecerulm commented Nov 8, 2018

The has-key(obj, 'x') should be equivalent to

is-object($o) and contains("key", $o)

On a first glance it may seems that just .x checks for the existence of key x but

  • what if . is an array
  • what if . contains key x but the value is null or a falsy value
@larsga larsga added the enhancement New feature or request label Nov 30, 2018
@larsga
Copy link
Collaborator

larsga commented Nov 30, 2018

Hmmmm. It might be useful, but on the other hand it's so easy to do yourself. I'm inclined to wait on this one.

@ecerulm ecerulm closed this as completed Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants