luci-base: amend path() to handle arrays better
authorPaul Donald <newtwen+github@gmail.com>
Mon, 23 Dec 2024 17:14:40 +0000 (17:14 +0000)
committerPaul Donald <newtwen+github@gmail.com>
Mon, 23 Dec 2024 17:48:43 +0000 (17:48 +0000)
commit0826411de7c5a107138cf00d1171fde13a1637ec
tree3384264835f1443e883aa01f774a56dcf20166e4
parent779ca1412564844efae93e7f00354bf8afd3ac1e
luci-base: amend path() to handle arrays better

While the jsdoc for this function describes a string[] parameter, this
seemingly was not handled; consistent usage of various
L.(url|resource|etc) is multiple strings that become object properties.
E.g.:

 L.resource('lldpd/lldpd.css');
 L.url("admin", "system", "leds");

which become e.g.:

 Arguments { 0: "admin/network", 1: "routes", … }

Handle a string[] parameter, by re-entering the function with any
Array[] parameter.

follow-up fix to 7c2cde52dbb14d5e878ca775946db9b3f13dcf1d

This prevents:

TypeError
parts[i].startsWith is not a function

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
modules/luci-base/htdocs/luci-static/resources/luci.js