build/lib/nls.ts/nls
export function nls(): NodeJS.ReadWriteStream {
	const input = through();
	const output = input.pipe(through(function (f: FileSourceMap) {
		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 duplex(input, output);
}