Skip to content

Commit

Permalink
fix(compression-webpack-plugin): fix result type
Browse files Browse the repository at this point in the history
  • Loading branch information
peterblazejewicz committed Sep 2, 2020
1 parent 6e8dd40 commit 960c6e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -58,13 +58,14 @@ const badZlib: Configuration = {
]
};

function customAlgorithm(input: string, options: number, callback: (err: Error, result: Buffer) => void) {
}

const custom: Configuration = {
plugins: [
new CompressionPlugin({
algorithm: customAlgorithm,
algorithm: (input: string, options: number, callback: (err: Error, result: Buffer) => void) => {},
compressionOptions: 5
}),
new CompressionPlugin({
algorithm: (input: string, options: number, callback: (err: Error, result: Uint8Array) => void) => {},
compressionOptions: 5
})
]
Expand Down
2 changes: 1 addition & 1 deletion types/compression-webpack-plugin/index.d.ts
Expand Up @@ -19,7 +19,7 @@ declare class CompressionPlugin<O = any> extends Plugin {
}

declare namespace CompressionPlugin {
type AlgorithmCallback = (error: Error | null, result: Buffer) => void;
type AlgorithmCallback = (error: Error | null, result: Uint8Array) => void;
type Algorithm<O> = (source: string, options: O, callback: AlgorithmCallback) => void;

// NOTE: These are the async compression algorithms on the zlib object.
Expand Down

0 comments on commit 960c6e8

Please sign in to comment.