Skip to content

Commit 010d243

Browse files
committed
✨ Feature(transformer): add size for path transformer
1 parent 5cf3662 commit 010d243

4 files changed

Lines changed: 6 additions & 15 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"conventional-changelog": "^3.0.6",
8181
"copyfiles": "^2.1.0",
8282
"cross-env": "^7.0.3",
83-
"cz-customizable": "^5.10.0",
83+
"cz-customizable": "^7.5.1",
8484
"eslint": "^9.39.1",
8585
"eslint-config-prettier": "^10.1.8",
8686
"eslint-plugin-import": "^2.32.0",

pnpm-lock.yaml

Lines changed: 2 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/transformer/path.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ const handle = async (ctx: IPicGo): Promise<IPicGo> => {
3535
// maybe undefined
3636
filePath: info.filePath,
3737
extname,
38+
// TODO: need optimized
39+
size: info.buffer?.length || 0,
3840
mimeType: mime.lookup(extname) || 'application/octet-stream'
3941
}
4042
} else {

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export interface IImgInfo {
264264
imgUrl?: string
265265
mimeType?: string
266266
filePath?: string
267+
size?: number
267268
[propName: string]: any
268269
}
269270

0 commit comments

Comments
 (0)