Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit fe017eb

Browse files
author
Rayhan Arayilakath
committed
Return the current defaults in the package
1 parent e9e07ec commit fe017eb

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

index.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
let replapi = require('./src');
2-
let defaultInitVariables = {
1+
let _defaultInitVariables = {
32
username: undefined,
43
endpoints: {
54
gql: undefined,
@@ -12,22 +11,24 @@ module.exports = function(initVariables) {
1211
if(initVariables) {
1312
global.initVariables = initVariables;
1413
} else {
15-
console.warn('[WARN]: ReplAPI.it Initilization Variables not found!')
16-
global.initVariables = defaultInitVariables;
14+
global.initVariables = _defaultInitVariables;
1715
}
1816

17+
const replapi = require('./src');
18+
1919
return {
20-
User: replapi.User,
21-
Post: replapi.Post,
22-
Repl: replapi.Repl,
23-
Comment: replapi.Comment,
24-
Leaderboard: replapi.Leaderboard,
25-
Languages: replapi.Languages,
26-
Board: replapi.Board,
27-
Notifications: replapi.Notifications,
28-
Misc: replapi.Misc,
29-
Login: replapi.Login,
30-
CustomDataQuery: replapi.CustomDataQuery,
31-
CustomRecursiveQuery: replapi.CustomRecursiveQuery
20+
defaults: global.initVariables,
21+
User: replapi.User,
22+
Post: replapi.Post,
23+
Repl: replapi.Repl,
24+
Comment: replapi.Comment,
25+
Leaderboard: replapi.Leaderboard,
26+
Languages: replapi.Languages,
27+
Board: replapi.Board,
28+
Notifications: replapi.Notifications,
29+
Misc: replapi.Misc,
30+
Login: replapi.Login,
31+
CustomDataQuery: replapi.CustomDataQuery,
32+
CustomRecursiveQuery: replapi.CustomRecursiveQuery
3233
}
3334
};

0 commit comments

Comments
 (0)