Skip to content

Commit

Permalink
solve gender type
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezcarlosjr committed Apr 30, 2022
1 parent 95fdc31 commit e1017c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "get-mexican-data-by-curp",
"version": "0.7.3-beta",
"version": "0.7.4-beta",
"description": "Verify CURP and obtain personal information from the Mexican government CURP. It scrapes official site and another providers.",
"main": "./lib/src/index.js",
"files": [
Expand Down
6 changes: 5 additions & 1 deletion src/models/Mexican.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ export interface Mexican {
fatherName: string;
motherName: string;
name: string;
gender: string; // https://en.wikipedia.org/wiki/ISO/IEC_5218
gender?: string; // https://en.wikipedia.org/wiki/ISO/IEC_5218
birthday: string; // https://en.wikipedia.org/wiki/ISO_8601
birthState: string; // https://www.iso.org/obp/ui/#iso:code:3166:MX
statusCurp?: string; // https://www.notion.so/sanchezcarlosjr/statusCurp-68e3bd32a9274fd1976a3e9a6be33096
pdf?: string;
nationality?: string;
probatoryDocument?: string;
probatoryDocumentData?: Record<string, string | number | undefined>;
}
3 changes: 1 addition & 2 deletions src/providers/GovernmentScrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class GovernmentScrapper extends Provider {
private static async parseResponse(
renapoResponse: { registros: any[] },
curp: Curp
) {
): Promise<Mexican> {
const register = renapoResponse.registros[0];
return {
curp: curp.value,
Expand Down Expand Up @@ -98,7 +98,6 @@ export class GovernmentScrapper extends Provider {
error: 'CURP not found',
};
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return GovernmentScrapper.parseResponse(renapoResponse, curpId);
}

Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
Expand Down Expand Up @@ -68,5 +68,6 @@
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": ["src/**/*.ts", "test/**/*.ts"]
"include": ["src/**/*.ts"],
"exclude": ["test/**/*.ts"]
}

0 comments on commit e1017c8

Please sign in to comment.