Module:utilities/scribunto parameter key/documentation
Takes a parameter name as an input, and returns the Scribunto-normalized form (i.e. the key that that parameter would have in a frame.args
table). For example, "1"
is normalized to 1
(a number), and " foo "
is normalized to "foo"
. If the input is not a string, it is returned unchanged.
Strings are trimmed with Module:string/php trim, and then converted to numbers if:
- They are integers, with no decimals (2.0) or leading zeroes (02).
- They are ≤ 253 and ≥ -253.
- For positive values, they do not have a leading
+
sign.
Note: Lua integers are only accurate to 253 - 1, so 253 and -253 have to be specifically checked for, since 2^53 == 2^53 + 1
evaluates to true
.