From 9d9f4069ef4dafbbc3e8470c49acd2c323d996de Mon Sep 17 00:00:00 2001 From: Tao Date: Wed, 20 Dec 2023 18:54:11 +0800 Subject: [PATCH] chore: use named exports of bmpjs --- src/compress.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compress.ts b/src/compress.ts index ea71d03..2ffabf6 100644 --- a/src/compress.ts +++ b/src/compress.ts @@ -1,4 +1,4 @@ -import * as bmp from '@vingle/bmp-js' +import { decode as bmpDecode } from '@vingle/bmp-js' import { readFile } from 'fs/promises' import NodeMozjpeg, { type EncodeOptions as MozjpegEncodeOptions } from 'node-mozjpeg' import path from 'path' @@ -33,7 +33,7 @@ function isBitmap(buf: Buffer): boolean { } const handleBmp = (buf: Buffer) => { - const bitmap = bmp.decode(buf, true) + const bitmap = bmpDecode(buf, true) return sharp(bitmap.data, { raw: { width: bitmap.width,