-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.mjs
23 lines (23 loc) · 807 Bytes
/
index.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {main_class} from "./lib/workings.mjs"
class IRCTC extends main_class{
constructor(){
super();
}
async book(params){
if (!params){
throw new Error("You have not set any parameters for booking. Please set the parameters.");
}
if (!(params.hasOwnProperty("log") && typeof params["log"] === 'boolean')){
console.log("You have not set any valid log parameter. Setting log to false.\nIf you need to set up logging, please set log parameter to true.");
params.log = false;
}
return await super.book(params);
}
async last_transaction(params){
return await super.last_transaction(params);
}
async pnr_status(params){
return await super.pnr_status(params);
}
};
export {IRCTC};