File tree 3 files changed +9
-8
lines changed
output/themes/default/assets/typedoc/utils
3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ title: Changelog
6
6
7
7
### Bug Fixes
8
8
9
+ - Switch from gzip to deflate for compressing assets to make output consistent across different operating systems, #2796 .
9
10
- Cascaded modifier tags will no longer be copied into type literals, #2802 .
10
11
11
12
## v0.27.3 (2024-12-04)
Original file line number Diff line number Diff line change 1
1
/**
2
- * Decompresses Base64-encoded Gzip data and parses it into a JSON object.
2
+ * Decompresses Base64-encoded deflate compressed data and parses it into a JSON object.
3
3
*
4
- * @param base64 - The Base64-encoded string representing the Gzip -compressed JSON string.
4
+ * @param base64 - The Base64-encoded string representing the deflate -compressed JSON string.
5
5
* @returns A promise that resolves to the parsed JSON object.
6
6
*/
7
7
export async function decompressJson ( base64 : string ) {
8
8
const binaryData = Uint8Array . from ( atob ( base64 ) , ( c ) => c . charCodeAt ( 0 ) ) ;
9
9
const blob = new Blob ( [ binaryData ] ) ;
10
10
const decompressedStream = blob
11
11
. stream ( )
12
- . pipeThrough ( new DecompressionStream ( "gzip " ) ) ;
12
+ . pipeThrough ( new DecompressionStream ( "deflate " ) ) ;
13
13
const decompressedText = await new Response ( decompressedStream ) . text ( ) ;
14
14
return JSON . parse ( decompressedText ) ;
15
15
}
Original file line number Diff line number Diff line change 1
- import { gzip } from "zlib" ;
1
+ import { deflate } from "zlib" ;
2
2
import { promisify } from "util" ;
3
3
4
- const gzipP = promisify ( gzip ) ;
4
+ const deflateP = promisify ( deflate ) ;
5
5
6
6
/**
7
- * Compresses a JSON-serializable object into a Base64-encoded Gzip string.
7
+ * Compresses a JSON-serializable object into a Base64-encoded deflate string.
8
8
*
9
9
* @param data - The JSON-serializable object to compress.
10
- * @returns A promise that resolves to a Base64-encoded string of the Gzip -compressed data.
10
+ * @returns A promise that resolves to a Base64-encoded string of the deflate -compressed data.
11
11
*/
12
12
export async function compressJson ( data : any ) {
13
- const gz = await gzipP ( Buffer . from ( JSON . stringify ( data ) ) ) ;
13
+ const gz = await deflateP ( Buffer . from ( JSON . stringify ( data ) ) ) ;
14
14
return gz . toString ( "base64" ) ;
15
15
}
You can’t perform that action at this time.
0 commit comments