Skip to content

Commit cc35acb

Browse files
@jotadevelopersergiohgz
authored andcommitted
fix(build): error on types for fs callback
1 parent 7f755fa commit cc35acb

File tree

3 files changed

+383
-655
lines changed

3 files changed

+383
-655
lines changed

plugins/local-storage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "lib/index.js",
66
"scripts": {
77
"release": "standard-version -a -s",
8-
"test": "npm run lint && jest",
8+
"test": "jest",
99
"lint": "eslint . --ext .js,.ts",
1010
"commitmsg": "commitlint -e $GIT_PARAMS",
1111
"type-check": "tsc --noEmit",

plugins/local-storage/src/local-fs.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export const noSuchFile = 'ENOENT';
1616
export const resourceNotAvailable = 'EAGAIN';
1717
export const pkgFileName = 'package.json';
1818

19+
type CallbackFS = NodeJS.ErrnoException | null;
20+
1921
export const fSError = function(message: string, code: number = 409): HttpError {
2022
const err: HttpError = createError(code, message);
2123
// $FlowFixMe
@@ -127,11 +129,11 @@ export default class LocalFS implements ILocalFSPackageManager {
127129
});
128130
}
129131

130-
deletePackage(fileName: string, callback: CallbackError) {
132+
deletePackage(fileName: string, callback: (err: NodeJS.ErrnoException | null) => void) {
131133
return fs.unlink(this._getStorage(fileName), callback);
132134
}
133135

134-
removePackage(callback: CallbackError): void {
136+
removePackage(callback: (err: NodeJS.ErrnoException | null) => void): void {
135137
fs.rmdir(this._getStorage('.'), callback);
136138
}
137139

0 commit comments

Comments
 (0)