-
-
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.
Added information on documentation
- Loading branch information
ADMSK\AVROGAL1
committed
Feb 18, 2021
1 parent
c1db273
commit 23efc4c
Showing
14 changed files
with
352 additions
and
217 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,10 @@ | ||
import { ConfigOptions } from '../typings/types' | ||
|
||
export const getApiRootURL = async (setup: ConfigOptions, key: string): Promise<string> => { | ||
const { NODE_ENV } = process.env | ||
const isLocalEnv = NODE_ENV === 'development' | ||
const options = isLocalEnv ? setup.options.dev : setup.options.prod | ||
if (!options[key]) throw new Error(`No API end point defined for ${key}`) | ||
|
||
return options[key] | ||
} |
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 { existsSync, mkdirSync } from 'fs' | ||
import { join } from 'path' | ||
|
||
export const createFilePath = (locations): string => { | ||
const date = new Date() | ||
const timestamp = `${date.getFullYear()}_${ | ||
date.getMonth() + 1 | ||
}_${date.getDate()}_${date.getHours()}_${date.getMinutes()}` | ||
|
||
const { path, name, extension } = locations | ||
const fileName = `${name}-${timestamp}.${extension}` | ||
|
||
if (!existsSync(path)) { | ||
mkdirSync(path) | ||
} | ||
|
||
return join(path, fileName) | ||
} |
Oops, something went wrong.