diff --git a/build/lib/asar.ts b/build/lib/asar.ts index 186cdf093a4b3d83d9c8f48c0a7eed1a8f0327df..d2823043aabfc829c6df638a34a610871631e83b 100644 --- a/build/lib/asar.ts +++ b/build/lib/asar.ts @@ -64,7 +64,7 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted); }; - return es.through(function (this: any, file) { + return es.through(function (file) { if (file.stat.isDirectory()) { return; } @@ -88,7 +88,7 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena // The file goes inside of xx.asar out.push(file.contents); } - }, function (this: any) { + }, function () { let finish = () => { { diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index eac4e226d5e169258430b863bc5e54f30fbdd5c4..27bce9ff38c6b748108c5606b963328b77f95b5b 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -175,7 +175,7 @@ function monacodtsTask(out: string, isWatch: boolean): NodeJS.ReadWriteStream { })); } - resultStream = es.through(function (this: any, data) { + resultStream = es.through(function (data) { const filePath = path.normalize(path.resolve(basePath, data.relative)); if (neededFiles[filePath]) { setInputFile(filePath, data.contents.toString()); diff --git a/build/lib/extensions.js b/build/lib/extensions.js index b8f48515b29ddb05395b7c70248f52ea872ac98f..071fb5258c2887cf7e187b8c9144b9664d1794ee 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -150,11 +150,6 @@ function fromLocalNormal(extensionPath) { .catch(function (err) { return result.emit('error', err); }); return result.pipe(stats_1.createStatsStream(path.basename(extensionPath))); } -function error(err) { - var result = es.through(); - setTimeout(function () { return result.emit('error', err); }); - return result; -} var baseHeaders = { 'X-Market-Client-Id': 'VSCode Build', 'User-Agent': 'VSCode Build', diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index a04c9ff27dc9545706bf9240be871420e3868f49..18020bb63ad7c7f54239f642561c4520d005b319 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -110,12 +110,12 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string | let relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path); return webpackGulp(webpackConfig, webpack, webpackDone) - .pipe(es.through(function (this: any, data) { + .pipe(es.through(function (data) { data.stat = data.stat || {}; data.base = extensionPath; this.emit('data', data); })) - .pipe(es.through(function (this: any, data: File) { + .pipe(es.through(function (data: File) { // source map handling: // * rewrite sourceMappingURL // * save to disk so that upload-task picks this up diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 85ae97a697adfc7dbe4db6f48d91cff62082eb67..52b8aa5c051d8c884de3280eef0aa93fb98e40e0 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -79,20 +79,9 @@ var PackageJsonFormat; } PackageJsonFormat.is = is; })(PackageJsonFormat || (PackageJsonFormat = {})); -var ModuleJsonFormat; -(function (ModuleJsonFormat) { - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Is.array(candidate.messages) && candidate.messages.every(function (message) { return Is.string(message); }) - && Is.array(candidate.keys) && candidate.keys.every(function (key) { return Is.string(key) || LocalizeInfo.is(key); }); - } - ModuleJsonFormat.is = is; -})(ModuleJsonFormat || (ModuleJsonFormat = {})); var Line = /** @class */ (function () { function Line(indent) { if (indent === void 0) { indent = 0; } - this.indent = indent; this.buffer = []; if (indent > 0) { this.buffer.push(new Array(indent + 1).join(' ')); @@ -375,7 +364,6 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) { var messageSection = json.messages; var bundleSection = json.bundles; var statistics = Object.create(null); - var total = 0; var defaultMessages = Object.create(null); var modules = Object.keys(keysSection); modules.forEach(function (module) { @@ -388,7 +376,6 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) { var messageMap = Object.create(null); defaultMessages[module] = messageMap; keys.map(function (key, i) { - total++; if (typeof key === 'string') { messageMap[key] = messages[i]; } diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index c13a2042fed04b622bc928a8b329f85ee786d5d5..041a5120db41f52b6048d59bc5e7bfffa3b34c7d 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -1064,7 +1064,7 @@ function pullXlfFiles(apiHostname: string, username: string, password: string, l called = true; const stream = this; resources.map(function (resource) { - retrieveResource(language, resource, apiHostname, credentials).then((file: File) => { + retrieveResource(language, resource, apiHostname, credentials).then((file: File | null) => { if (file) { stream.emit('data', file); } diff --git a/build/lib/typings/event-stream.d.ts b/build/lib/typings/event-stream.d.ts index a39470c5395d302b231a9c6aa8a4320100a0848c..260051be52e5cd29f0ba2648d6fc8f80d4b92b22 100644 --- a/build/lib/typings/event-stream.d.ts +++ b/build/lib/typings/event-stream.d.ts @@ -1,6 +1,6 @@ declare module "event-stream" { import { Stream } from 'stream'; - import { ThroughStream as _ThroughStream} from 'through'; + import { ThroughStream as _ThroughStream } from 'through'; import * as File from 'vinyl'; export interface ThroughStream extends _ThroughStream { @@ -14,14 +14,14 @@ declare module "event-stream" { function concat(...stream: Stream[]): ThroughStream; function duplex(istream: Stream, ostream: Stream): ThroughStream; - function through(write?: (data: any) => void, end?: () => void, - opts?: {autoDestroy: boolean; }): ThroughStream; + function through(write?: (this: ThroughStream, data: any) => void, end?: (this: ThroughStream) => void, + opts?: { autoDestroy: boolean; }): ThroughStream; function readArray(array: T[]): ThroughStream; - function writeArray(cb: (err:Error, array:T[]) => void): ThroughStream; + function writeArray(cb: (err: Error, array: T[]) => void): ThroughStream; - function mapSync(cb: (data:I) => O): ThroughStream; - function map(cb: (data:I, cb:(err?:Error, data?: O)=>void) => O): ThroughStream; + function mapSync(cb: (data: I) => O): ThroughStream; + function map(cb: (data: I, cb: (err?: Error, data?: O) => void) => O): ThroughStream; - function readable(asyncFunction: Function): any; + function readable(asyncFunction: (this: ThroughStream, ...args: any[]) => any): any; } \ No newline at end of file