Skip to content

Commit 434bc34

Browse files
author
winjo
committed
fix: 修复 fs-watcher checkCb 报错
1 parent 41b3c44 commit 434bc34

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/core/src/server/node/extend/fs-watcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fs.open = (p: string, flag: string, mode: any, cb?: any) => {
134134
// 文件不存在且为写模式,那么会自动创建文件
135135
const willCreated = err && mayCreatedFile(flag);
136136
const _cb = typeof mode === 'function' ? mode : cb;
137-
checkCb(cb);
137+
checkCb(_cb);
138138
const newCb = (err: any, fd: any) => {
139139
fd2Path[fd] = p;
140140
const res = _cb(err, fd);
@@ -212,7 +212,7 @@ fs.writeFile = (filename: any, data: any, arg3?: any, cb?: any) => {
212212
// 文件不存在且为写模式,那么会自动创建文件
213213
const willCreated = err && mayCreatedFile(flag);
214214
const _cb = typeof arg3 === 'function' ? arg3 : cb;
215-
checkCb(cb);
215+
checkCb(_cb);
216216
const newCb: any = (err: any, fd: any) => {
217217
const res = _cb(err, fd);
218218
if (!err) {

0 commit comments

Comments
 (0)