Skip to content

Commit

Permalink
feat: exported national id interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-master committed Jun 9, 2020
1 parent 72215f2 commit 2f40256
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export { default as addCommas } from "./modules/addCommas";
export { default as removeCommas } from "./modules/removeCommas";
// Iran National-ID
export { default as verifyIranianNationalId } from "./modules/nationalId";
export { default as getPlaceByIranNationalId } from "./modules/getPlaceByIranNationalId";
export * as getPlaceByIranNationalId from "./modules/getPlaceByIranNationalId";
// Verify Card Number and Get Bank Name from Card-Number
export { default as verifyCardNumber } from "./modules/verifyCardNumber";
export { default as getBankNameFromCardNumber } from "./modules/getBankNameFromCardNumber";
Expand Down
8 changes: 4 additions & 4 deletions src/modules/getPlaceByIranNationalId.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import NationalIdJSON from "../dummy/nationalId";
import ProvincesJSON from "../dummy/provincesCodes";

interface IProvince {
export interface IProvince {
code: number | string;
city: string;
}

interface INationalId extends IProvince {
export interface INationalId extends IProvince {
parentCode: number;
}

interface IGetPlaceByNationalIId {
export interface IPlaceByNationalIId {
codes: number[] | string[];
city: string;
province: string;
Expand All @@ -22,7 +22,7 @@ interface IGetPlaceByNationalIId {
* @param {String?} nationalId [String of national id - like this: 1111111111]
* @return {Object} [If nationalId is valid, function returning an object of details, but nationalId is invalid, return error message]
*/
function getPlaceByIranNationalId(nationalId?: string): IGetPlaceByNationalIId | null | undefined {
function getPlaceByIranNationalId(nationalId?: string): IPlaceByNationalIId | null | undefined {
if (!nationalId) return;

if (nationalId && nationalId.length === 10) {
Expand Down

0 comments on commit 2f40256

Please sign in to comment.