mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: deploy new compression
This commit is contained in:
1 parent
1575b803c0
commit
63084d1855
10 files changed
+10312
-6090
No files matched your search
@@ -1,8 +1,6 @@
|
||||
import { GithubChangeBlob, createBlob } from './createBlob';
|
||||
import { octokit } from './octokit';
|
||||
|
||||
const TIME_PER_BLOB = 2 ** 4 * 1000;
|
||||
|
||||
export interface FileChange {
|
||||
path: string;
|
||||
content: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { encode } from 'lz4';
|
||||
import { compress } from 'lz4js';
|
||||
import { BkonWriteStream } from '../streams/bkon';
|
||||
|
||||
export function superCompress(object: any) {
|
||||
const write = new BkonWriteStream().bkon(object);
|
||||
const compressed = encode(write.buffer);
|
||||
return compressed.toString('base64');
|
||||
const compressed = compress(write.buffer);
|
||||
return Buffer.from(compressed).toString('base64');
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { decode } from 'lz4';
|
||||
import { decompress } from 'lz4js';
|
||||
import { BkonReadStream } from '../streams/bkon';
|
||||
|
||||
export function superDecompress<Type>(buffer: Buffer) {
|
||||
const decompressed = decode(buffer);
|
||||
const decompressed = Buffer.from(decompress(buffer));
|
||||
const read = new BkonReadStream(decompressed);
|
||||
return read.bkon() as Type;
|
||||
}
|
||||
Reference in new issue
Block a user