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

Commit 770dbf1

Browse files
author
Ray Arayilakath
committed
Run Linter
1 parent 48a0960 commit 770dbf1

File tree

4 files changed

+35
-36
lines changed

4 files changed

+35
-36
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
3-
import replapi from './src/source.js';
4-
53
import stringify from 'json-stable-stringify-without-jsonify';
4+
import replapi from './src/source.js';
65

76
const defaultInitVariables = {
87
username: undefined,
@@ -25,7 +24,7 @@ const defaultInitVariables = {
2524
};
2625

2726
function sortByKey(a, b) {
28-
return a.key > b.key ? 1 : -1;
27+
return a.key > b.key ? 1 : -1;
2928
}
3029

3130
export default function ReplAPI(initVariables) {

src/classes/Database.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function compare(value, hashData) {
2626
let exportable;
2727
let isExperimentalFeaturesEnabled;
2828
if (fs.existsSync(path.join(process.cwd(), '.replapirc.json'))) {
29-
isExperimentalFeaturesEnabled = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.replapirc.json'))).experimentalFeatures;
29+
isExperimentalFeaturesEnabled = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.replapirc.json'))).experimentalFeatures;
3030
}
3131

3232
if (isExperimentalFeaturesEnabled) {

src/classes/Notifications.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import constants from '../utils/constants.js';
88
let exportable;
99
let isExperimentalFeaturesEnabled;
1010
if (fs.existsSync(path.join(process.cwd(), '.replapirc.json'))) {
11-
isExperimentalFeaturesEnabled = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.replapirc.json'))).experimentalFeatures;
11+
isExperimentalFeaturesEnabled = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.replapirc.json'))).experimentalFeatures;
1212
}
1313

1414
if (isExperimentalFeaturesEnabled) {

src/utils/constants.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@ import path from 'path';
33

44
let initVariables;
55
if (fs.existsSync(path.join(process.cwd(), '.replapirc.json'))) {
6-
initVariables = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.replapirc.json')));
6+
initVariables = JSON.parse(fs.readFileSync(path.join(process.cwd(), '.replapirc.json')));
77
} else {
8-
initVariables = {
9-
username: undefined,
10-
captcha: {
11-
token: undefined,
12-
},
13-
endpoints: {
14-
gql: undefined,
15-
restful: undefined,
16-
login: undefined,
17-
},
18-
markdown: {
19-
length: undefined,
20-
removeMarkdown: undefined,
21-
},
22-
previewCount: {
23-
comments: undefined,
24-
},
25-
};
8+
initVariables = {
9+
username: undefined,
10+
captcha: {
11+
token: undefined,
12+
},
13+
endpoints: {
14+
gql: undefined,
15+
restful: undefined,
16+
login: undefined,
17+
},
18+
markdown: {
19+
length: undefined,
20+
removeMarkdown: undefined,
21+
},
22+
previewCount: {
23+
comments: undefined,
24+
},
25+
};
2626
}
2727

2828
export default {
29-
roleAttributes: 'id, name, key, tagline',
30-
languageAttributes: 'id, displayName, key, category, tagline, icon, isNew',
31-
organizationAttributes: 'id, name, country, postalCode, state, city, googlePlaceId, timeCreated, timeUpdated, timeDeleted, time_created',
32-
subscriptionAttributes: 'id, userId, customerId, planId, timeUpdated, timeCreated, timeDeleted',
33-
userAttributes: 'id, username, firstName, lastName, bio, isVerified, displayName, fullName, url, isLoggedIn, isSubscribed, timeCreated, isBannedFromBoards, karma, isHacker, image',
34-
boardAttributes: 'id, name, description, slug, cta, titleCta, bodyCta, template, buttonCta, color, replRequired, isLocked, isAnswerable, isPrivate, timeCreated, timeUpdated, url, canPost',
35-
replAttributes: 'id, language, isProject, isPrivate, isStarred, title, slug, description, folderId, isRenamed, url, timeCreated, timeUpdated, isOwner, tags { id }, pinnedToProfile, files, hostedUrl, terminalUrl, reactions { id, count }',
36-
commentAttributes: `id, body, voteCount, timeCreated, timeUpdated, url, isAuthor, canEdit, canVote, canComment, hasVoted, canReport, hasReported, isAnswer, canSelectAsAnswer, canUnselectAsAnswer, preview(length: ${initVariables.markdown.length || 150}, removeMarkdown: ${initVariables.markdown.removeMarkdown || true})`,
37-
postAttributes: `id, title, body, showHosted, voteCount, commentCount, isPinned, isLocked, timeCreated, timeUpdated, url, isAnnouncement, isAuthor, canEdit, canComment, canVote, canPin, canSetType, canChangeBoard, canLock, hasVoted, canReport, hasReported, isAnswerable, tutorialPages, preview(length: ${initVariables.markdown.length || 150}, removeMarkdown: ${initVariables.markdown.removeMarkdown || true})`,
38-
graphql: `${initVariables.endpoints.gql || 'https://staging.replit.com/graphql'}`,
39-
login: `${initVariables.endpoints.login || 'https://staging.replit.com/login'}`,
40-
restful: `${initVariables.endpoints.restful || 'https://staging.replit.com'}`,
29+
roleAttributes: 'id, name, key, tagline',
30+
languageAttributes: 'id, displayName, key, category, tagline, icon, isNew',
31+
organizationAttributes: 'id, name, country, postalCode, state, city, googlePlaceId, timeCreated, timeUpdated, timeDeleted, time_created',
32+
subscriptionAttributes: 'id, userId, customerId, planId, timeUpdated, timeCreated, timeDeleted',
33+
userAttributes: 'id, username, firstName, lastName, bio, isVerified, displayName, fullName, url, isLoggedIn, isSubscribed, timeCreated, isBannedFromBoards, karma, isHacker, image',
34+
boardAttributes: 'id, name, description, slug, cta, titleCta, bodyCta, template, buttonCta, color, replRequired, isLocked, isAnswerable, isPrivate, timeCreated, timeUpdated, url, canPost',
35+
replAttributes: 'id, language, isProject, isPrivate, isStarred, title, slug, description, folderId, isRenamed, url, timeCreated, timeUpdated, isOwner, tags { id }, pinnedToProfile, files, hostedUrl, terminalUrl, reactions { id, count }',
36+
commentAttributes: `id, body, voteCount, timeCreated, timeUpdated, url, isAuthor, canEdit, canVote, canComment, hasVoted, canReport, hasReported, isAnswer, canSelectAsAnswer, canUnselectAsAnswer, preview(length: ${initVariables.markdown.length || 150}, removeMarkdown: ${initVariables.markdown.removeMarkdown || true})`,
37+
postAttributes: `id, title, body, showHosted, voteCount, commentCount, isPinned, isLocked, timeCreated, timeUpdated, url, isAnnouncement, isAuthor, canEdit, canComment, canVote, canPin, canSetType, canChangeBoard, canLock, hasVoted, canReport, hasReported, isAnswerable, tutorialPages, preview(length: ${initVariables.markdown.length || 150}, removeMarkdown: ${initVariables.markdown.removeMarkdown || true})`,
38+
graphql: `${initVariables.endpoints.gql || 'https://staging.replit.com/graphql'}`,
39+
login: `${initVariables.endpoints.login || 'https://staging.replit.com/login'}`,
40+
restful: `${initVariables.endpoints.restful || 'https://staging.replit.com'}`,
4141
};

0 commit comments

Comments
 (0)