Allow singular url to validFor

This commit is contained in:
Mitra Ardron 2018-10-06 21:35:17 +10:00
parent 3d1422c91b
commit 4dba3723c4
2 changed files with 2 additions and 1 deletions

View File

@ -52,6 +52,7 @@ class Transports {
returns: Array of pairs of Url & transport instance [ [ u1, t1], [u1, t2], [u2, t1]]
throws: CodingError if urls empty or [undefined...]
*/
if (typeof urls === "string") urls = [urls];
if (!((urls && urls[0]) || ["store", "newlisturls", "newdatabase", "newtable"].includes(func))) {
console.error("Transports.validFor called with invalid arguments: urls=", urls, "func=", func); // FOr debugging old calling patterns with [ undefined ]
return [];

View File

@ -51,5 +51,5 @@
"test": "cd src; node ./test.js",
"help": "echo 'test (test it)'; echo 'build (creates dweb-transports-bundle)'"
},
"version": "0.1.22"
"version": "0.1.23"
}