build/lib/nls.js
function nls() {
    const input = event_stream_1.through();
    const output = input.pipe(event_stream_1.through(function (f) {
        if (!f.sourceMap) {
            return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
        }
        let source = f.sourceMap.sources[0];
        if (!source) {
            return this.emit('error', new Error(`File ${f.relative} does not have a source in the source map.`));
        }
        const root = f.sourceMap.sourceRoot;
        if (root) {
            source = path.join(root, source);
        }
        const typescript = f.sourceMap.sourcesContent[0];
        if (!typescript) {
            return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`));
        }
        nls.patchFiles(f, typescript).forEach(f => this.emit('data', f));
    }));
    return event_stream_1.duplex(input, output);
}
function nls() {
    const input = event_stream_1.through();
    const output = input.pipe(event_stream_1.through(function (f) {
        if (!f.sourceMap) {
            return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
        }
        let source = f.sourceMap.sources[0];
        if (!source) {
            return this.emit('error', new Error(`File ${f.relative} does not have a source in the source map.`));
        }
        const root = f.sourceMap.sourceRoot;
        if (root) {
            source = path.join(root, source);
        }
        const typescript = f.sourceMap.sourcesContent[0];
        if (!typescript) {
            return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`));
        }
        nls.patchFiles(f, typescript).forEach(f => this.emit('data', f));
    }));
    return event_stream_1.duplex(input, output);
}
function nls ( ) { const input = event_stream_1 . through ( ) ; const output = input . pipe ( event_stream_1 . through ( function ( f ) { if ( ! f . sourceMap ) { return this . emit ( 'error' , new Error ( ` ${ f . relative } ` ) ) ; } let source = f . sourceMap . sources [ 0 ] ; if ( ! source ) { return this . emit ( 'error' , new Error ( ` ${ f . relative } ` ) ) ; } const root = f . sourceMap . sourceRoot ; if ( root ) { source = path . join ( root , source ) ; } const typescript = f . sourceMap . sourcesContent [ 0 ] ; if ( ! typescript ) { return this . emit ( 'error' , new Error ( ` ${ f . relative } ` ) ) ; } nls . patchFiles ( f , typescript ) . forEach ( f => this . emit ( 'data' , f ) ) ; } ) ) ; return event_stream_1 . duplex ( input , output ) ; }
Returns a stream containing the patched JavaScript and source maps.
Returns a stream containing the patched JavaScript and source maps .