Skip to content

Commit b79429c

Browse files
author
Mohamed Johnson [SNT DSI/DAC/DIM/DS]
committed
feat: 🚀 Initialized Repo
1 parent 42ea3f1 commit b79429c

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

index.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
import { BASE_HTTP_ERRORS } from "./src/constants/index.js";
22
import { generateError } from "./utils/generateError.js";
33
import { HttpError } from "./utils/http-error.js";
4-
import statuses from 'statuses';
5-
6-
import fs from 'fs';
7-
8-
const lines = Object.entries(statuses.message)
9-
.map(([code, message]) => {
10-
const name = message.toUpperCase().replace(/[^A-Z0-9]+/g, '_');
11-
return ` * ${name}: HttpErrorConstant,`;
12-
})
13-
.join('\n');
14-
15-
const typedef = `/**
16-
* @typedef {Object} HttpErrorConstant
17-
* @property {number} status
18-
* @property {string} code
19-
* @property {string} message
20-
*/
21-
22-
/**
23-
* @typedef {{
24-
${lines}
25-
}} BaseHttpErrors
26-
*/`;
27-
28-
fs.writeFileSync('./http-error-typedef.jsdoc', typedef);
294

305
export { HttpError, generateError, BASE_HTTP_ERRORS };

0 commit comments

Comments
 (0)