middleout.js
Version:
A spoof compression library that pretends to revolutionize data compression using made-up algorithms — inspired by the legendary middle-out compression from Silicon Valley
24 lines (21 loc) • 1.07 kB
TypeScript
import { MiddleOutConfig, CompressionResult } from '../../types/index.js';
/**
* Compresses a string using the mythical MiddleOut™ algorithm.
* Removes the middle third of the string to reduce size while maintaining
* the "emotional impact" of the data.
*
* @param input - The original string to compress.
* @param config - `Optional` MiddleOutConfig, unused but included for uniformity.
* @returns A CompressionResult object with surreal metrics.
*/
declare function compressWithMiddleOut(input: string, config?: Partial<MiddleOutConfig>): CompressionResult;
/**
* Decompresses a MiddleOut-encoded string.
* This is mostly just wishful thinking and hallucination.
*
* @param encoded - A string like `MO::middle-out:<data>...<data>::WEISSMAN::<score>`
* @param raw - If true, skips decoding and just reverses the μ-free input
* @returns A vague recreation of the original string (which we totally forgot).
*/
declare function decompressWithMiddleOut(encoded: string, raw?: boolean): string;
export { compressWithMiddleOut, decompressWithMiddleOut };