Update config.js

This commit is contained in:
Neil Cuzon
2020-07-20 20:07:57 -07:00
committed by GitHub
parent 575c34467f
commit ddee6d2b6a

View File

@@ -855,16 +855,15 @@ const siteConfig = assignWithDepth({}, defaultConfig);
const currentConfig = assignWithDepth({}, defaultConfig); const currentConfig = assignWithDepth({}, defaultConfig);
/** /**
*## setSiteConfig
*| Function | Description | Type | Values | *| Function | Description | Type | Values |
*| --------- | ------------------- | ------- | ------------------ | *| --------- | ------------------- | ------- | ------------------ |
*| setSiteConfig|Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array| *| setSiteConfig|Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array|
***Notes:** ***Notes:**
*Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls to reset() will reset *Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls to reset() will reset
*the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) will reset siteConfig and currentConfig *the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) will reset siteConfig and currentConfig
*to the defaultConfig *to the defaultConfig
*Note: currentConfig is set in this function *Note: currentConfig is set in this function
**Default value: At default, will mirror Global Config** **Default value: At default, will mirror Global Config**
* @param conf - the base currentConfig to use as siteConfig * @param conf - the base currentConfig to use as siteConfig
* @returns {*} - the siteConfig * @returns {*} - the siteConfig
@@ -877,10 +876,10 @@ export const setSiteConfig = conf => {
return getSiteConfig(); return getSiteConfig();
}; };
/** /**
*## getSiteConfig
*| Function | Description | Type | Values | *| Function | Description | Type | Values |
*| --------- | ------------------- | ------- | ------------------ | *| --------- | ------------------- | ------- | ------------------ |
*| setSiteConfig|Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig| *| setSiteConfig|Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig|
***Notes**: ***Notes**:
*Returns **any** values in siteConfig. *Returns **any** values in siteConfig.
* @returns {*} * @returns {*}
@@ -889,11 +888,10 @@ export const getSiteConfig = () => {
return assignWithDepth({}, siteConfig); return assignWithDepth({}, siteConfig);
}; };
/** /**
*## setConfig
*| Function | Description | Type | Values | *| Function | Description | Type | Values |
*| --------- | ------------------- | ------- | ------------------ | *| --------- | ------------------- | ------- | ------------------ |
*| setSiteConfig|Sets the siteConfig to desired values | Put Request| Any Values, except ones in secure array| *| setSiteConfig|Sets the siteConfig to desired values | Put Request| Any Values, except ones in secure array|
***Notes**: ***Notes**:
*Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure keys. Any *Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure keys. Any
*values found in conf with key found in siteConfig.secure will be replaced with the corresponding *values found in conf with key found in siteConfig.secure will be replaced with the corresponding
@@ -908,10 +906,10 @@ export const setConfig = conf => {
return getConfig(); return getConfig();
}; };
/** /**
* ## getConfig
*| Function | Description | Type | Return Values | *| Function | Description | Type | Return Values |
*| --------- | ------------------- | ------- | ------------------ | *| --------- | ------------------- | ------- | ------------------ |
*| getConfig |Obtains the currentConfig | Get Request | Any Values from currentConfig| *| getConfig |Obtains the currentConfig | Get Request | Any Values from currentConfig|
***Notes**: ***Notes**:
*Returns **any** the currentConfig *Returns **any** the currentConfig
* @returns {*} - the currentConfig * @returns {*} - the currentConfig
@@ -920,10 +918,10 @@ export const getConfig = () => {
return assignWithDepth({}, currentConfig); return assignWithDepth({}, currentConfig);
}; };
/** /**
*## sanitize
*| Function | Description | Type | Values | *| Function | Description | Type | Values |
*| --------- | ------------------- | ------- | ------------------ | *| --------- | ------------------- | ------- | ------------------ |
*| sanitize |Sets the siteConfig to desired values. | Put Request |None| *| sanitize |Sets the siteConfig to desired values. | Put Request |None|
*Ensures options parameter does not attempt to override siteConfig secure keys *Ensures options parameter does not attempt to override siteConfig secure keys
*Note: modifies options in-place *Note: modifies options in-place
* @param options - the potential setConfig parameter * @param options - the potential setConfig parameter
@@ -942,6 +940,7 @@ export const sanitize = options => {
}); });
}; };
/** /**
*## reset
*| Function | Description | Type | Required | Values | *| Function | Description | Type | Required | Values |
*| --------- | ------------------- | ------- | -------- | ------------------ | *| --------- | ------------------- | ------- | -------- | ------------------ |
*| reset|Resets currentConfig to conf| Put Request | Required | None| *| reset|Resets currentConfig to conf| Put Request | Required | None|