This shows you the differences between two versions of the page.
Last revision Both sides next revision | |||
cookbooks:5.5.x:transformations [2021/04/27 09:38] miconda created |
cookbooks:5.5.x:transformations [2021/11/17 17:26] miconda [{urialias.decode}] |
||
---|---|---|---|
Line 852: | Line 852: | ||
</ | </ | ||
+ | ===== Value Transformations | ||
+ | |||
+ | Exported by **pv** module. | ||
+ | |||
+ | ==== {val.json} ==== | ||
+ | |||
+ | If value is $null, return empty string; if value is string, then it is escaped for use as json value (without surrounding quotes. | ||
+ | |||
+ | <code c> | ||
+ | $var(x) = '" | ||
+ | $(var(x){val.json}) => \" | ||
+ | </ | ||
+ | |||
+ | ==== {val.n0} ==== | ||
+ | |||
+ | Return integer 0 for values that are $null. | ||
+ | |||
+ | <code c> | ||
+ | $sht(a=> | ||
+ | $(sht(a=> | ||
+ | </ |