From 244b4ae3973bc1511464a08158a123767f83179c Mon Sep 17 00:00:00 2001 From: BO41 Date: Thu, 18 Oct 2018 09:08:59 +0200 Subject: NoImplicitAny flag true (#1157) this enables the `noImplicitAny` flag in the Typescript compiler > When the noImplicitAny flag is true and the TypeScript compiler cannot infer the type, it still generates the JavaScript files, but it also reports an error. Many seasoned developers prefer this stricter setting because type checking catches more unintentional errors at compile time. closes: #1131 replaces #1137 --- client/src/assets/player/peertube-chunk-store.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'client/src/assets/player/peertube-chunk-store.ts') diff --git a/client/src/assets/player/peertube-chunk-store.ts b/client/src/assets/player/peertube-chunk-store.ts index 767e46821..ac3f9e654 100644 --- a/client/src/assets/player/peertube-chunk-store.ts +++ b/client/src/assets/player/peertube-chunk-store.ts @@ -40,15 +40,15 @@ export class PeertubeChunkStore extends EventEmitter { // If the store is full private memoryChunks: { [ id: number ]: Buffer | true } = {} private databaseName: string - private putBulkTimeout - private cleanerInterval + private putBulkTimeout: any + private cleanerInterval: any private db: ChunkDatabase private expirationDB: ExpirationDatabase private readonly length: number private readonly lastChunkLength: number private readonly lastChunkIndex: number - constructor (chunkLength: number, opts) { + constructor (chunkLength: number, opts: any) { super() this.databaseName = 'webtorrent-chunks-' @@ -113,13 +113,13 @@ export class PeertubeChunkStore extends EventEmitter { }, PeertubeChunkStore.BUFFERING_PUT_MS) } - get (index: number, opts, cb) { + get (index: number, opts: any, cb: any): any { if (typeof opts === 'function') return this.get(index, null, opts) // IndexDB could be slow, use our memory index first const memoryChunk = this.memoryChunks[index] if (memoryChunk === undefined) { - const err = new Error('Chunk not found') + const err = new Error('Chunk not found') as any err['notFound'] = true return process.nextTick(() => cb(err)) @@ -146,11 +146,11 @@ export class PeertubeChunkStore extends EventEmitter { }) } - close (db) { + close (db: any) { return this.destroy(db) } - async destroy (cb) { + async destroy (cb: any) { try { if (this.pendingPut) { clearTimeout(this.putBulkTimeout) @@ -225,7 +225,7 @@ export class PeertubeChunkStore extends EventEmitter { } } - private nextTick (cb, err, val?) { + private nextTick (cb: any, err: Error, val?: any) { process.nextTick(() => cb(err, val), undefined) } } -- cgit v1.2.3