@dongdev/fca-unofficial 3.0.21 → 3.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/module/loginHelper.js +15 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/module/loginHelper.js
CHANGED
|
@@ -1005,7 +1005,21 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1005
1005
|
skipped++;
|
|
1006
1006
|
return;
|
|
1007
1007
|
}
|
|
1008
|
-
|
|
1008
|
+
let mod;
|
|
1009
|
+
try {
|
|
1010
|
+
mod = require(p);
|
|
1011
|
+
} catch (e) {
|
|
1012
|
+
logger(`Failed to require API module ${p}: ${e && e.message ? e.message : String(e)}`, "warn");
|
|
1013
|
+
skipped++;
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
const factory = typeof mod === "function" ? mod : (mod && typeof mod.default === "function" ? mod.default : null);
|
|
1017
|
+
if (!factory) {
|
|
1018
|
+
logger(`API module ${p} does not export a function, skipping`, "warn");
|
|
1019
|
+
skipped++;
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
api[key] = factory(defaultFuncs, api, ctxMain);
|
|
1009
1023
|
loaded++;
|
|
1010
1024
|
});
|
|
1011
1025
|
});
|
package/package.json
CHANGED