fix(browser): allow single string url as only argument

This commit is contained in:
AJ ONeal 2022-09-01 00:22:38 -06:00
parent 420eb4f197
commit a98d4b7341
Signed by: coolaj86
GPG Key ID: 585419CA6DB0AA23
1 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,9 @@ let _optionKeys = Object.keys(_fetchDefaults).concat([
function setDefaults(_defs) { function setDefaults(_defs) {
return async function request(opts) { return async function request(opts) {
if ('string' === typeof opts) {
opts = { url: opts };
}
let reqOpts = { headers: {} }; let reqOpts = { headers: {} };
if ( if (