mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
make compressed data wrapper over the real data
This commit is contained in:
parent
e14a7ca0bc
commit
1060b1e52e
@ -17,7 +17,8 @@ namespace ts.server {
|
||||
|
||||
function compress(s: string): CompressedData {
|
||||
const gzip = zlib.createGZip();
|
||||
return <CompressedData><any>gzip.gzipSync(new Buffer(s, "utf8"));
|
||||
const data = gzip.gzipSync(new Buffer(s, "utf8"));
|
||||
return { data, length: data.length };
|
||||
}
|
||||
|
||||
class Logger implements ts.server.Logger {
|
||||
@ -289,7 +290,7 @@ namespace ts.server {
|
||||
|
||||
function writeCompressedData(prefix: string, compressed: CompressedData, suffix: string): void {
|
||||
sys.write(prefix);
|
||||
writeMessage(<Buffer><any>compressed);
|
||||
writeMessage(compressed.data);
|
||||
sys.write(suffix);
|
||||
}
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
export interface CompressedData {
|
||||
__compressedDataTag: any;
|
||||
length: number;
|
||||
data: any;
|
||||
}
|
||||
|
||||
export interface ServerHost {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user