Skip to content

Commit 9466797

Browse files
authored
Merge pull request #10 from Yuriuh/fix-spelling
fix: typo
2 parents e01b69d + 4da2127 commit 9466797

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.changeset/light-boxes-complain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"easy-tinypng-cli": patch
3+
---
4+
5+
typo fix

packages/easy-tinypng-cli/src/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function isRecord(pathDir: string) {
7575

7676
export async function record(pathDir: string) {
7777
const isExist = await isFileExist(RecordFilePath)
78-
const fileName = getFIleName(pathDir)
78+
const fileName = getFileName(pathDir)
7979
if (isExist) {
8080
const json: Object = fse.readJSONSync(RecordFilePath)
8181
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -91,7 +91,7 @@ export async function record(pathDir: string) {
9191
export async function removeRecord(pathDir: string) {
9292
const RecordFilePath = path.resolve(cwd(), 'record.json')
9393
const isExist = await isFileExist(RecordFilePath)
94-
const fileName = getFIleName(pathDir)
94+
const fileName = getFileName(pathDir)
9595
if (isExist) {
9696
const json: Object = fse.readJSONSync(RecordFilePath)
9797
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -101,7 +101,7 @@ export async function removeRecord(pathDir: string) {
101101
}
102102
}
103103

104-
export function getFIleName(pathDir: string) {
104+
export function getFileName(pathDir: string) {
105105
return path.basename(pathDir)
106106
}
107107

@@ -110,7 +110,7 @@ export function getExtName(pathDir: string) {
110110
}
111111

112112
export function autoRecord(action: 'add' | 'unlink' | 'change', pathDir: string) {
113-
if (!isImageFIle(pathDir))
113+
if (!isImageFile(pathDir))
114114
return
115115

116116
if (action === 'add')
@@ -120,7 +120,7 @@ export function autoRecord(action: 'add' | 'unlink' | 'change', pathDir: string)
120120
removeRecord(pathDir)
121121
}
122122

123-
export function isImageFIle(pathDir: string) {
123+
export function isImageFile(pathDir: string) {
124124
const fileExtname = getExtName(pathDir)
125125
const supportFiles = ['webp', 'jpeg', 'png']
126126
return supportFiles.includes(fileExtname)
@@ -131,7 +131,7 @@ export async function reduceImage(fileDir: string, targetDir: string) {
131131
if (recorded)
132132
return
133133

134-
if (!isImageFIle(fileDir))
134+
if (!isImageFile(fileDir))
135135
return
136136
const spinner = ora('Loading').start()
137137
try {

0 commit comments

Comments
 (0)