1001 B
1001 B
Excerpt from the DustJS tutorial:
Array - number of elements, [1,2,3,4] has size=4
String - length of the string, "abcdef" has size=6
Object - Number of properties in the object, {a:4, b:8, c:15, d:16} has size=4
Number - Value of the number, 23 has size 23 and 3.14 has size 3.14
Undefined, 0, empty string - zero
Any other value - length after conversion to string
This appears to be inaccurate (probably out of date because that tutorial was deprecated in favor of dustjs.com, but the latter is incomplete and lacking any reference to the @size
helper.
Corrections
- Booleans are 0, not converted to strings
Oddities
Reference parameters (like foo="{bar}"
) are usually treated as strings but it seems if it contains ONLY a reference to a value and not anything else, then it is still treated as a number.