node-ainzfb-new 1.7.9-uOw19mf → 1.7.10-13

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,29 +4,29 @@
4
4
  var utils = require("../utils");
5
5
  var log = require("npmlog");
6
6
 
7
+ module.exports = function(defaultFuncs, api, ctx) {
8
+ return function getAccessToken(callback) {
9
+ var resolveFunc = function() {};
10
+ var rejectFunc = function() {};
11
+ var returnPromise = new Promise(function(resolve, reject) {
12
+ resolveFunc = resolve;
13
+ rejectFunc = reject;
14
+ });
7
15
 
8
- module.exports = function (defaultFuncs, api, ctx) {
9
- return function getAccessToken(callback) {
10
- var resolveFunc = function () { };
11
- var rejectFunc = function () { };
12
- var returnPromise = new Promise(function (resolve, reject) {
13
- resolveFunc = resolve;
14
- rejectFunc = reject;
15
- });
16
-
17
- if (!callback) {
18
- callback = function (err, userInfo) {
19
- if (err) return rejectFunc(err);
20
- resolveFunc(userInfo);
21
- };
22
- }
23
- try {
24
- var { getAccessToken } = require('../Extra/ExtraAddons');
25
- getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
16
+ if (!callback) {
17
+ callback = function(err, userInfo) {
18
+ if (err) return rejectFunc(err);
19
+ resolveFunc(userInfo);
20
+ };
26
21
  }
27
- catch (e) {
22
+ try {
23
+ var { getAccessToken } = require("../Extra/ExtraAddons");
24
+ getAccessToken(ctx.jar, ctx, defaultFuncs).then(data =>
25
+ callback(null, data)
26
+ );
27
+ } catch (e) {
28
28
  callback(null, e);
29
29
  }
30
30
  return returnPromise;
31
- };
32
- };
31
+ };
32
+ };