Skip to content

Commit 6780fd9

Browse files
committed
Upgrade package and fix util
1 parent 9ba0693 commit 6780fd9

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"date-fns": "^2.11.1",
6060
"dotenv": "^16.0.1",
6161
"express": "4.17.1",
62-
"helmet": "^4.6.0",
62+
"helmet": "^5.1.0",
6363
"http-status-codes": "^2.1.4",
6464
"joi": "^17.6.0",
6565
"jsonwebtoken": "^8.5.1",
@@ -80,7 +80,7 @@
8080
"@types/jest": "^28.1.3",
8181
"@types/jsonwebtoken": "^8.5.4",
8282
"@types/morgan": "^1.9.3",
83-
"@types/node": "^16.4.0",
83+
"@types/node": "^18.0.0",
8484
"@types/nodemailer": "^6.4.4",
8585
"@types/supertest": "^2.0.11",
8686
"@typescript-eslint/eslint-plugin": "^5.30.0",

scripts/fake-loader.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ import factories, { FactoryType } from '../src/database/factories';
55

66
const { info } = console;
77

8+
function print<T>(data: T): void {
9+
const jsonData = JSON.stringify(data, null, ' ');
10+
11+
info(chalk.green(jsonData));
12+
}
13+
814
(async (): Promise<void> => {
915
try {
1016
const table = process.argv[2];
1117
const total = +process.argv[3] || 1;
18+
1219
const factoryCallback = factories[table as FactoryType].run;
1320

14-
await fake.generate(factoryCallback, total);
21+
print(await fake.generate(factoryCallback, total));
1522

1623
process.exit(0);
1724
} catch (err: any) {

src/utils/object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function camelize(data: any): any {
3535
if (!isDate && isObject(data)) {
3636
return Object.keys(data).reduce((accumulator, current) => {
3737
const key = camelcase(current);
38-
const value = camelize(data[parseInt(current)]);
38+
const value = camelize(data[current as any]);
3939

4040
return Object.assign(accumulator, { [key]: value });
4141
}, {});

yarn.lock

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -905,16 +905,11 @@
905905
dependencies:
906906
"@types/node" "*"
907907

908-
"@types/node@*":
908+
"@types/node@*", "@types/node@^18.0.0":
909909
version "18.0.0"
910910
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a"
911911
integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==
912912

913-
"@types/node@^16.4.0":
914-
version "16.11.41"
915-
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.41.tgz#88eb485b1bfdb4c224d878b7832239536aa2f813"
916-
integrity sha512-mqoYK2TnVjdkGk8qXAVGc/x9nSaTpSrFaGFm43BUH3IdoBV0nta6hYaGmdOvIMlbHJbUEVen3gvwpwovAZKNdQ==
917-
918913
"@types/nodemailer@^6.4.4":
919914
version "6.4.4"
920915
resolved "https://registry.yarnpkg.com/@types/nodemailer/-/nodemailer-6.4.4.tgz#c265f7e7a51df587597b3a49a023acaf0c741f4b"
@@ -2988,10 +2983,10 @@ has@^1.0.3:
29882983
dependencies:
29892984
function-bind "^1.1.1"
29902985

2991-
helmet@^4.6.0:
2992-
version "4.6.0"
2993-
resolved "https://registry.yarnpkg.com/helmet/-/helmet-4.6.0.tgz#579971196ba93c5978eb019e4e8ec0e50076b4df"
2994-
integrity sha512-HVqALKZlR95ROkrnesdhbbZJFi/rIVSoNq6f3jA/9u6MIbTsPh3xZwihjeI5+DO/2sOV6HMHooXcEOuwskHpTg==
2986+
helmet@^5.1.0:
2987+
version "5.1.0"
2988+
resolved "https://registry.yarnpkg.com/helmet/-/helmet-5.1.0.tgz#e98a5d4bf89ab8119c856018a3bcc82addadcd47"
2989+
integrity sha512-klsunXs8rgNSZoaUrNeuCiWUxyc+wzucnEnFejUg3/A+CaF589k9qepLZZ1Jehnzig7YbD4hEuscGXuBY3fq+g==
29952990

29962991
hexoid@1.0.0:
29972992
version "1.0.0"

0 commit comments

Comments
 (0)