OptString returns the string at index if it is a string. If this argument is absent or is nil, returns def. Otherwise, raises an error.
(l *State, index int, def string)
| 325 | // OptString returns the string at index if it is a string. If this argument is |
| 326 | // absent or is nil, returns def. Otherwise, raises an error. |
| 327 | func OptString(l *State, index int, def string) string { |
| 328 | if l.IsNoneOrNil(index) { |
| 329 | return def |
| 330 | } |
| 331 | return CheckString(l, index) |
| 332 | } |
| 333 | |
| 334 | func CheckNumber(l *State, index int) float64 { |
| 335 | n, ok := l.ToNumber(index) |