lint code
This commit is contained in:
@@ -15,7 +15,7 @@ export const dirname = (p: string): string => path.dirname(p)
|
||||
* @param {*} path 路径
|
||||
*/
|
||||
export const checkPath = async(path: string): Promise<boolean> => {
|
||||
return await new Promise(resolve => {
|
||||
return new Promise(resolve => {
|
||||
if (!path) {
|
||||
resolve(false)
|
||||
return
|
||||
@@ -31,7 +31,7 @@ export const checkPath = async(path: string): Promise<boolean> => {
|
||||
}
|
||||
|
||||
export const getFileStats = async(path: string): Promise<fs.Stats | null> => {
|
||||
return await new Promise(resolve => {
|
||||
return new Promise(resolve => {
|
||||
if (!path) {
|
||||
resolve(null)
|
||||
return
|
||||
@@ -97,7 +97,7 @@ export const readFile = async(path: string) => fs.promises.readFile(path)
|
||||
export const toMD5 = (str: string) => crypto.createHash('md5').update(str).digest('hex')
|
||||
|
||||
export const gzipData = async(str: string): Promise<Buffer> => {
|
||||
return await new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
gzip(str, (err, result) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
@@ -109,7 +109,7 @@ export const gzipData = async(str: string): Promise<Buffer> => {
|
||||
}
|
||||
|
||||
export const gunzipData = async(buf: Buffer): Promise<string> => {
|
||||
return await new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
gunzip(buf, (err, result) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
|
||||
Reference in New Issue
Block a user