[tslint] Remove space before function paren rule
This commit is contained in:
parent
fc9a150d91
commit
7403837099
|
@ -10,4 +10,3 @@ import Response from './response'
|
|||
export { Application, Mention, Notification, Status, Tag, StreamListener, Response }
|
||||
|
||||
export default Mastodon
|
||||
|
||||
|
|
|
@ -31,28 +31,6 @@ export default class Mastodon {
|
|||
this.baseUrl = baseUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Unauthorized GET request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Query parameters
|
||||
* @param baseUrl base URL of the target
|
||||
*/
|
||||
public static get(path: string, params = {}, baseUrl = DEFAULT_URL): Promise<object> {
|
||||
const apiUrl = baseUrl
|
||||
return axios
|
||||
.get(apiUrl + path, {
|
||||
params
|
||||
})
|
||||
.then(resp => resp.data)
|
||||
}
|
||||
|
||||
private static _post(path: string, params = {}, baseUrl = DEFAULT_URL): Promise<object> {
|
||||
const apiUrl = baseUrl
|
||||
return axios
|
||||
.post(apiUrl + path, params)
|
||||
.then(resp => resp.data)
|
||||
}
|
||||
|
||||
/**
|
||||
* First, call createApp to get client_id and client_secret.
|
||||
* Next, call generateAuthUrl to get authorization url.
|
||||
|
@ -81,7 +59,6 @@ export default class Mastodon {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an application
|
||||
*
|
||||
|
@ -172,6 +149,28 @@ export default class Mastodon {
|
|||
}, baseUrl).then(data => OAuth.TokenData.from(data as OAuth.TokenDataFromServer))
|
||||
}
|
||||
|
||||
/**
|
||||
* Unauthorized GET request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Query parameters
|
||||
* @param baseUrl base URL of the target
|
||||
*/
|
||||
public static get(path: string, params = {}, baseUrl = DEFAULT_URL): Promise<object> {
|
||||
const apiUrl = baseUrl
|
||||
return axios
|
||||
.get(apiUrl + path, {
|
||||
params
|
||||
})
|
||||
.then(resp => resp.data)
|
||||
}
|
||||
|
||||
private static _post(path: string, params = {}, baseUrl = DEFAULT_URL): Promise<object> {
|
||||
const apiUrl = baseUrl
|
||||
return axios
|
||||
.post(apiUrl + path, params)
|
||||
.then(resp => resp.data)
|
||||
}
|
||||
|
||||
/**
|
||||
* GET request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
"variable-name": [
|
||||
true,
|
||||
"ban-keywords"
|
||||
],
|
||||
"space-before-function-paren": [
|
||||
"never"
|
||||
]
|
||||
},
|
||||
"rulesDirectory": []
|
||||
|
|
Loading…
Reference in a new issue