Skip to content

Commit 494395f

Browse files
committed
Adding correct typings for event-stream this values
1 parent 86fbc62 commit 494395f

7 files changed

Lines changed: 13 additions & 31 deletions

File tree

build/lib/asar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena
6464
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
6565
};
6666

67-
return es.through(function (this: any, file) {
67+
return es.through(function (file) {
6868
if (file.stat.isDirectory()) {
6969
return;
7070
}
@@ -88,7 +88,7 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena
8888
// The file goes inside of xx.asar
8989
out.push(file.contents);
9090
}
91-
}, function (this: any) {
91+
}, function () {
9292

9393
let finish = () => {
9494
{

build/lib/compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function monacodtsTask(out: string, isWatch: boolean): NodeJS.ReadWriteStream {
175175
}));
176176
}
177177

178-
resultStream = es.through(function (this: any, data) {
178+
resultStream = es.through(function (data) {
179179
const filePath = path.normalize(path.resolve(basePath, data.relative));
180180
if (neededFiles[filePath]) {
181181
setInputFile(filePath, data.contents.toString());

build/lib/extensions.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ function fromLocalNormal(extensionPath) {
150150
.catch(function (err) { return result.emit('error', err); });
151151
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
152152
}
153-
function error(err) {
154-
var result = es.through();
155-
setTimeout(function () { return result.emit('error', err); });
156-
return result;
157-
}
158153
var baseHeaders = {
159154
'X-Market-Client-Id': 'VSCode Build',
160155
'User-Agent': 'VSCode Build',

build/lib/extensions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
110110
let relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
111111

112112
return webpackGulp(webpackConfig, webpack, webpackDone)
113-
.pipe(es.through(function (this: any, data) {
113+
.pipe(es.through(function (data) {
114114
data.stat = data.stat || {};
115115
data.base = extensionPath;
116116
this.emit('data', data);
117117
}))
118-
.pipe(es.through(function (this: any, data: File) {
118+
.pipe(es.through(function (data: File) {
119119
// source map handling:
120120
// * rewrite sourceMappingURL
121121
// * save to disk so that upload-task picks this up

build/lib/i18n.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,9 @@ var PackageJsonFormat;
7979
}
8080
PackageJsonFormat.is = is;
8181
})(PackageJsonFormat || (PackageJsonFormat = {}));
82-
var ModuleJsonFormat;
83-
(function (ModuleJsonFormat) {
84-
function is(value) {
85-
var candidate = value;
86-
return Is.defined(candidate)
87-
&& Is.array(candidate.messages) && candidate.messages.every(function (message) { return Is.string(message); })
88-
&& Is.array(candidate.keys) && candidate.keys.every(function (key) { return Is.string(key) || LocalizeInfo.is(key); });
89-
}
90-
ModuleJsonFormat.is = is;
91-
})(ModuleJsonFormat || (ModuleJsonFormat = {}));
9282
var Line = /** @class */ (function () {
9383
function Line(indent) {
9484
if (indent === void 0) { indent = 0; }
95-
this.indent = indent;
9685
this.buffer = [];
9786
if (indent > 0) {
9887
this.buffer.push(new Array(indent + 1).join(' '));
@@ -375,7 +364,6 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
375364
var messageSection = json.messages;
376365
var bundleSection = json.bundles;
377366
var statistics = Object.create(null);
378-
var total = 0;
379367
var defaultMessages = Object.create(null);
380368
var modules = Object.keys(keysSection);
381369
modules.forEach(function (module) {
@@ -388,7 +376,6 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
388376
var messageMap = Object.create(null);
389377
defaultMessages[module] = messageMap;
390378
keys.map(function (key, i) {
391-
total++;
392379
if (typeof key === 'string') {
393380
messageMap[key] = messages[i];
394381
}

build/lib/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ function pullXlfFiles(apiHostname: string, username: string, password: string, l
10641064
called = true;
10651065
const stream = this;
10661066
resources.map(function (resource) {
1067-
retrieveResource(language, resource, apiHostname, credentials).then((file: File) => {
1067+
retrieveResource(language, resource, apiHostname, credentials).then((file: File | null) => {
10681068
if (file) {
10691069
stream.emit('data', file);
10701070
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
declare module "event-stream" {
22
import { Stream } from 'stream';
3-
import { ThroughStream as _ThroughStream} from 'through';
3+
import { ThroughStream as _ThroughStream } from 'through';
44
import * as File from 'vinyl';
55

66
export interface ThroughStream extends _ThroughStream {
@@ -14,14 +14,14 @@ declare module "event-stream" {
1414
function concat(...stream: Stream[]): ThroughStream;
1515
function duplex(istream: Stream, ostream: Stream): ThroughStream;
1616

17-
function through(write?: (data: any) => void, end?: () => void,
18-
opts?: {autoDestroy: boolean; }): ThroughStream;
17+
function through(write?: (this: ThroughStream, data: any) => void, end?: (this: ThroughStream) => void,
18+
opts?: { autoDestroy: boolean; }): ThroughStream;
1919

2020
function readArray<T>(array: T[]): ThroughStream;
21-
function writeArray<T>(cb: (err:Error, array:T[]) => void): ThroughStream;
21+
function writeArray<T>(cb: (err: Error, array: T[]) => void): ThroughStream;
2222

23-
function mapSync<I,O>(cb: (data:I) => O): ThroughStream;
24-
function map<I,O>(cb: (data:I, cb:(err?:Error, data?: O)=>void) => O): ThroughStream;
23+
function mapSync<I, O>(cb: (data: I) => O): ThroughStream;
24+
function map<I, O>(cb: (data: I, cb: (err?: Error, data?: O) => void) => O): ThroughStream;
2525

26-
function readable(asyncFunction: Function): any;
26+
function readable(asyncFunction: (this: ThroughStream, ...args: any[]) => any): any;
2727
}

0 commit comments

Comments
 (0)