-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Readme and JS Docs in general (#8)
* Added updated readme docs * Added JSDOcs * Added more JS Docs
- Loading branch information
Showing
14 changed files
with
282 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Taiwo Yusuf | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,21 +1,58 @@ | ||
/** | ||
* An object containing environment constants. | ||
* @typedef {Object} EnvConfig | ||
* @property {Object} api - An object containing API-related environment constants. | ||
* @property {string} api.catFactBaseUrl - The base URL of the Cat Fact API. | ||
* @property {number} api.defaultFactPerPage - The default number of facts to display per page. | ||
* @property {number} api.defaultFactMaxLength - The default maximum length of facts to retrieve. | ||
* @property {number} api.defaultFactPage - The default page number to retrieve. | ||
* @property {boolean} api.useCache - Indicates whether to use cache for API requests. | ||
*/ | ||
|
||
import { GetBool, GetInt, GetString } from "@/utils/env"; | ||
import { EnvConstants } from "./defaultValues"; | ||
|
||
export default { | ||
/** | ||
* The environment configuration object. | ||
* @type {EnvConfig} | ||
*/ | ||
const config: EnvConfig = { | ||
api: { | ||
/** | ||
* The base URL of the Cat Fact API. | ||
* @type {string} | ||
*/ | ||
catFactBaseUrl: GetString( | ||
"CAT_FACT_API_BASE_URL", | ||
EnvConstants.catFactAPIBaseUrl | ||
), | ||
/** | ||
* The default number of facts to display per page. | ||
* @type {number} | ||
*/ | ||
defaultFactPerPage: GetInt( | ||
"DEFAULT_FACTS_PER_PAGE", | ||
EnvConstants.defaultFactPerPage | ||
), | ||
/** | ||
* The default maximum length of facts to retrieve. | ||
* @type {number} | ||
*/ | ||
defaultFactMaxLength: GetInt( | ||
"DEFAULT_FACTS_MAX_LENGTH", | ||
EnvConstants.defaultFactMaxLength | ||
), | ||
/** | ||
* The default page number to retrieve. | ||
* @type {number} | ||
*/ | ||
defaultFactPage: GetInt("DEFAULT_FACTS_PAGE", EnvConstants.defaultFactPage), | ||
/** | ||
* Indicates whether to use cache for API requests. | ||
* @type {boolean} | ||
*/ | ||
useCache: GetBool("USE_CACHE", EnvConstants.useCache), | ||
}, | ||
}; | ||
|
||
export default config; |
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,20 @@ | ||
/** | ||
* An object containing environment constants. | ||
* @typedef {Object} EnvConfig | ||
* @property {Object} api - An object containing API-related environment constants. | ||
* @property {string} api.catFactBaseUrl - The base URL of the Cat Fact API. | ||
* @property {number} api.defaultFactPerPage - The default number of facts to display per page. | ||
* @property {number} api.defaultFactMaxLength - The default maximum length of facts to retrieve. | ||
* @property {number} api.defaultFactPage - The default page number to retrieve. | ||
* @property {boolean} api.useCache - Indicates whether to use cache for API requests. | ||
*/ | ||
|
||
type EnvConfig = { | ||
api: { | ||
catFactBaseUrl: string; | ||
defaultFactPerPage: number; | ||
defaultFactMaxLength: number; | ||
defaultFactPage: number; | ||
useCache: boolean; | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
/** | ||
* An enum representing the sort order for sorting cat facts. | ||
* @readonly | ||
* @enum {string} | ||
* @property {string} ASC - Sort cat facts in ascending order. | ||
* @property {string} DESC - Sort cat facts in descending order. | ||
*/ | ||
export enum SortOrder { | ||
ASC = "asc", | ||
DESC = "desc", | ||
} | ||
ASC = "asc", | ||
DESC = "desc", | ||
} |
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
Oops, something went wrong.
eb5f0dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kitty-facty – ./
kitty-facty.vercel.app
kitty-facty-git-main-teezzan.vercel.app
kitty-facty-teezzan.vercel.app