Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis3797 committed Mar 6, 2023
1 parent a2e1dff commit 3a7e824
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"code:format": "prettier --write src/**/*.{ts,css,js,html}",
"code:check": "prettier --check src/**/*.{ts,css,js,html}",
"code:format:specific-file": "prettier --write ",
"test": "jest"
"test": "jest",
"prepare": "husky install"
},
"dependencies": {
"bcryptjs": "^2.4.3",
Expand Down Expand Up @@ -54,27 +55,27 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^5.0.0",
"husky": "^8.0.3",
"jest": "^29.4.3",
"lint-staged": "^13.1.2",
"nodemon": "^2.0.21",
"prettier": "^2.8.4",
"prettier-eslint": "^15.0.1",
"supertest": "^6.3.3",
"ts-jest": "^29.0.5",
"typescript": "*"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"repository": {
"type": "git",
"url": ""
},
"bugs": {
"url": ""
},
"homepage": ""
"homepage": "",
"lint-staged":{
"**/*.{js,jsx,ts,tsx}":[
"npx prettier --write",
"npx eslint --fix",
"npx jest"
]
}
}
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as dotenv from 'dotenv';
import cors from 'cors';
import helmet from 'helmet';
import compression from 'compression';
import shouldCompress from './utils/shouldCompress';
import shouldCompress from './utils/compresssFilter.util';

dotenv.config();

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
import app from './app';
import logger from './utils/logger';
import logger from './middleware/logger';

dotenv.config();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Request, Response } from 'express';
* @param res HTTPs Response
* @returns Returns false if request header contains x-no-compression
*/
function shouldCompress(req: Request, res: Response): boolean {
function compresssFilter(req: Request, res: Response): boolean {
if (req.headers['x-no-compression']) {
// don't compress responses with this request header
return false;
Expand All @@ -17,4 +17,4 @@ function shouldCompress(req: Request, res: Response): boolean {
return compression.filter(req, res);
}

export default shouldCompress;
export default compresssFilter;

0 comments on commit 3a7e824

Please sign in to comment.