google / google/jsonnet

Add ?? with nullsafe or default value.

Open
#1,232 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jsonnet
Stars
7.6k
Forks
475
PR merge metrics
No merged PRs in 30d

Description

refs: https://github.com/google/jsonnet/issues/930

better to have it as
```
maybeNullObj?['someField'] ?? 'defaultValue'
```

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing
refs in sjsonnet: https://github.com/databricks/sjsonnet/issues/328
refs: https://github.com/CertainLach/jrsonnet/blob/master/docs/features.adoc#exp-null-coalescing
refs: https://tace.alibaba-inc.com/#/tmcp/ali-office/server/supermall/detail?businessId=huming-guarden&selectedKeys=server

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.