Total Complexity | 20 |
Complexity/F | 1.33 |
Lines of Code | 62 |
Function Count | 15 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /* |
||
10 | API.cookies = { |
||
11 | get: function (details) { |
||
12 | if (API.promise) { |
||
13 | return API.api.cookies.get(details); |
||
14 | } |
||
15 | else { |
||
16 | return new C_Promise(function () { |
||
17 | API.api.cookies.get(details, (function (cookie) { |
||
18 | this.call_then(cookie); |
||
19 | }).bind(this)); |
||
20 | }); |
||
21 | } |
||
22 | }, |
||
23 | getAll: function (details) { |
||
24 | if (API.promise) { |
||
25 | return API.api.cookies.getAll(details); |
||
26 | } |
||
27 | else { |
||
28 | return new C_Promise(function () { |
||
29 | API.api.cookies.getAll(details, (function (cookie) { |
||
30 | this.call_then(cookie); |
||
31 | }).bind(this)); |
||
32 | }); |
||
33 | } |
||
34 | }, |
||
35 | set: function (details) { |
||
36 | if (API.promise) { |
||
37 | return API.api.cookies.set(details); |
||
38 | } |
||
39 | else { |
||
40 | return new C_Promise(function () { |
||
41 | API.api.cookies.set(details, (function (cookie) { |
||
42 | this.call_then(cookie); |
||
43 | }).bind(this)); |
||
44 | }); |
||
45 | } |
||
46 | }, |
||
47 | remove: function (details) { |
||
48 | if (API.promise) { |
||
49 | return API.api.cookies.remove(details); |
||
50 | } |
||
51 | else { |
||
52 | return new C_Promise(function () { |
||
53 | API.api.cookies.remove(details, (function (cookie) { |
||
54 | this.call_then(cookie); |
||
55 | }).bind(this)); |
||
56 | }); |
||
57 | } |
||
58 | }, |
||
59 | getAllCookieStores: function (details) { |
||
60 | if (API.promise) { |
||
61 | return API.api.cookies.getAllCookieStores(details); |
||
62 | } |
||
63 | else { |
||
64 | return new C_Promise(function () { |
||
65 | API.api.cookies.getAllCookieStores(details, (function (cookie) { |
||
66 | this.call_then(cookie); |
||
67 | }).bind(this)); |
||
68 | }); |
||
69 | } |
||
70 | } |
||
71 | }; |