-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from deveshsangwan/migrate-js-to-ts
Migrate js to ts
- Loading branch information
Showing
49 changed files
with
415 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Document } from 'mongoose'; | ||
|
||
export interface ILiveMatches extends Document { | ||
_id: string; | ||
matchUrl: string; | ||
matchName: string; | ||
} | ||
|
||
export interface IMatchStats extends Document { | ||
createdAt: Date; | ||
_id: string; | ||
team1: object; | ||
team2: object; | ||
onBatting: object; | ||
summary: object; | ||
tournamentName: string; | ||
matchName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import nconf from 'nconf'; | ||
import * as path from 'path'; | ||
|
||
const nodeEnv: string = process.env.NODE_ENV || 'development'; | ||
const __basedir: string = path.resolve(); | ||
|
||
nconf.argv().env(); | ||
nconf.file('config', path.join(__basedir, `app/config/config.${nodeEnv}.json`)); | ||
nconf.file('responseMessage', path.join(__basedir, 'app/config/responseMessage.json')); | ||
nconf.file('partners', path.join(__basedir, 'app/config/partners.json')); | ||
|
||
export default nconf; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import config from './configuration'; | ||
import winston from 'winston'; | ||
|
||
const logger = winston.createLogger({ | ||
format: winston.format.combine( | ||
winston.format.label({ label: config.get('logging:label') as string }), | ||
winston.format.errors({ stack: true }), | ||
winston.format.timestamp({ format: 'YYYY-MM-DD hh:mm:ss' }), | ||
winston.format.printf(({ timestamp, label, level, message, meta, stack }) => { | ||
const text = '[' + timestamp + '] ' + | ||
label + '.' + level.toUpperCase() + ': ' + (message ?? | ||
'') + (meta && Object.keys(meta).length ? | ||
'\n' + JSON.stringify(meta, null, 4) : | ||
''); | ||
return stack ? text + '\n' + stack : text; | ||
}), | ||
winston.format.colorize({ all: true }), | ||
), | ||
transports: [ | ||
new winston.transports.Console({ | ||
level: config.get('logging:consoleLevel') as string, | ||
handleExceptions: true, | ||
}), | ||
] | ||
}); | ||
|
||
export const writeLogInfo = (arr: unknown[]): void => { | ||
logger.info( | ||
arr | ||
); | ||
}; | ||
|
||
export const writeLogError = (arr: unknown[]): void => { | ||
logger.error( | ||
arr | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.