ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.49k stars 41 forks source link

[patterns] Support optional keys in Hash / objects #576

Closed ilyash-b closed 1 year ago

ilyash-b commented 2 years ago

Given the hash h, check that either key k is not present or, if it is present, it matches the pattern p.

Right now there is no straightforward way to check the above. Use case: id and params in https://www.jsonrpc.org/specification

ilyash-b commented 2 years ago

Idea: {"key": IfExists(pattern)}

ilyash-b commented 1 year ago

In dev