toArray(val) {
			if (val == null)
				return [];
			else if (Array.isArray(val))
				return val;
			else if (typeof(val) == 'object')
				return [ val ];

			const s = String(val).trim();

			if (s == '')
				return [];

			return s.split(/\s+/);
		}
Converts the given value to an array. If the given value is of
type array, it is returned as-is, values of type object are
returned as one-element array containing the object, empty
strings and `null` values are returned as empty array, all other
values are converted using `String()`, trimmed, split on white
space and returned as array.

@instance
@memberof LuCI

@param {*} val
The value to convert into an array.

@return {Array<*>}
Returns the resulting array.