Skip to content

Commit

Permalink
fix(build): error on types for fs callback
Browse files Browse the repository at this point in the history
  • Loading branch information
@jotadeveloper authored and sergiohgz committed Aug 13, 2019
1 parent 7f755fa commit cc35acb
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 655 deletions.
2 changes: 1 addition & 1 deletion plugins/local-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/index.js",
"scripts": {
"release": "standard-version -a -s",
"test": "npm run lint && jest",
"test": "jest",
"lint": "eslint . --ext .js,.ts",
"commitmsg": "commitlint -e $GIT_PARAMS",
"type-check": "tsc --noEmit",
Expand Down
6 changes: 4 additions & 2 deletions plugins/local-storage/src/local-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const noSuchFile = 'ENOENT';
export const resourceNotAvailable = 'EAGAIN';
export const pkgFileName = 'package.json';

type CallbackFS = NodeJS.ErrnoException | null;

export const fSError = function(message: string, code: number = 409): HttpError {
const err: HttpError = createError(code, message);
// $FlowFixMe
Expand Down Expand Up @@ -127,11 +129,11 @@ export default class LocalFS implements ILocalFSPackageManager {
});
}

deletePackage(fileName: string, callback: CallbackError) {
deletePackage(fileName: string, callback: (err: NodeJS.ErrnoException | null) => void) {
return fs.unlink(this._getStorage(fileName), callback);
}

removePackage(callback: CallbackError): void {
removePackage(callback: (err: NodeJS.ErrnoException | null) => void): void {
fs.rmdir(this._getStorage('.'), callback);
}

Expand Down
Loading

0 comments on commit cc35acb

Please sign in to comment.