Skip to content

Commit c017e2e

Browse files
committed
chore: upgrade major dependency versions, fix tests, tslint, etc.
1 parent 316ce1e commit c017e2e

File tree

11 files changed

+5657
-7638
lines changed

11 files changed

+5657
-7638
lines changed

.travis/build-types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ interface OBSStatsType {
8383

8484
const DOTS_REGEX = /\./g;
8585
const outFile = path.join(__dirname, '../types/index.d.ts');
86-
async function getLatestComments() {
86+
async function getLatestComments(): Promise<any> {
8787
const headers = {
8888
Authorization: `token ${process.env.GH_TOKEN}`
8989
};
@@ -101,12 +101,12 @@ async function getLatestComments() {
101101
}
102102

103103
getLatestComments().then(rawComments => {
104-
return parseApi(rawComments);
104+
parseApi(rawComments);
105105
}).catch(error => {
106106
console.error(error);
107107
});
108108

109-
function parseApi(raw: RawComments) {
109+
function parseApi(raw: RawComments): void {
110110
const interfaces: string[] = [];
111111
const requestArgs: string[] = [];
112112
const requestResponses: string[] = [];
@@ -230,7 +230,7 @@ declare module 'obs-websocket-js' {
230230
}));
231231
}
232232

233-
function unflattenAndResolveTypes(inputItems: RawType[]) {
233+
function unflattenAndResolveTypes(inputItems: RawType[]): Tree {
234234
const tree: Tree = {};
235235

236236
const items = inputItems.slice(0);
@@ -276,7 +276,7 @@ function unflattenAndResolveTypes(inputItems: RawType[]) {
276276
}
277277

278278
if (currentNode.type === 'array') {
279-
const arrayNode = currentNode as ArrayType;
279+
const arrayNode = currentNode;
280280
// If the currentNode is an array, then we must be describing the items of that array.
281281
if (!arrayNode.items) {
282282
arrayNode.items = {
@@ -446,7 +446,7 @@ function resolveType(inType: string): AnyType {
446446
}
447447
}
448448

449-
function stringifyTypes(inputTypes: Tree, {terminator = ';', finalTerminator = true, includePrefix = true} = {}) {
449+
function stringifyTypes(inputTypes: Tree, {terminator = ';', finalTerminator = true, includePrefix = true} = {}): string {
450450
let returnString = '';
451451
Object.entries(inputTypes).forEach(([key, typeDef]) => {
452452
if (includePrefix) {

.travis/tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"file-name-casing": false,
77
"no-require-imports": false,
88
"no-single-line-block-comment": false,
9+
"no-unsafe-any": false,
910
"variable-name": [
1011
true,
1112
"ban-keywords",

lib/OBSWebSocket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class OBSWebSocket extends Socket {
5353
debug('[send] %s %s %o', messageId, requestType, args);
5454
try {
5555
this._socket.send(JSON.stringify(args));
56-
} catch (e) {
56+
} catch (_) {
5757
// TODO: Consider inspecting the exception thrown to gleam some relevant info and pass that on.
5858
rejectReason = Status.SOCKET_EXCEPTION;
5959
}
@@ -74,7 +74,7 @@ class OBSWebSocket extends Socket {
7474
* @param {Object} [args={}] request arguments.
7575
* @param {Function} callback Optional. callback(err, data)
7676
*/
77-
sendCallback(requestType, args = {}, callback) {
77+
sendCallback(requestType, args = {}, callback) { // eslint-disable-line default-param-last
7878
// Allow the `args` argument to be omitted.
7979
if (callback === undefined && typeof args === 'function') {
8080
callback = args;

lib/Socket.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class Socket extends EventEmitter {
9494

9595
// This handler must be present before we can call _authenticate.
9696
this._socket.onmessage = msg => {
97-
// eslint-disable-next-line capitalized-comments
9897
debug('[OnMessage]: %o', msg);
9998
const message = camelCaseKeys(JSON.parse(msg.data));
10099
let err;

lib/util/authenticationHashing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const SHA256 = require('sha.js/sha256');
88
* @param {String} msg Message to encode.
99
* @return {String} sha256 encoded string.
1010
*/
11+
// eslint-disable-next-line default-param-last
1112
module.exports = function (salt = '', challenge = '', msg) {
1213
const hash = new SHA256()
1314
.update(msg)

0 commit comments

Comments
 (0)