Remove node-unifi package dependency

- Add custom Unifi proxy built on existing cookie jar and httpProxy
- Change formatApiCall to emit empty string instead of undefined on missing key
This commit is contained in:
Jason Fischer 2022-10-07 17:12:29 -07:00
parent 952f0295cc
commit ac4dcd3222
No known key found for this signature in database
8 changed files with 148 additions and 163 deletions

View file

@ -2,7 +2,7 @@ export function formatApiCall(url, args) {
const find = /\{.*?\}/g;
const replace = (match) => {
const key = match.replace(/\{|\}/g, "");
return args[key];
return args[key] || "";
};
return url.replace(/\/+$/, "").replace(find, replace);