mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 15:59:51 +02:00
enable prettier-plugin-jsdoc
This commit is contained in:
113
src/config.js
113
src/config.js
@@ -42,19 +42,22 @@ export const updateCurrentConfig = (siteCfg, _directives) => {
|
||||
return cfg;
|
||||
};
|
||||
/**
|
||||
*## setSiteConfig
|
||||
*| Function | Description | Type | Values |
|
||||
*| --------- | ------------------- | ------- | ------------------ |
|
||||
*| setSiteConfig|Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array|
|
||||
***Notes:**
|
||||
*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
|
||||
*to the defaultConfig
|
||||
*Note: currentConfig is set in this function
|
||||
*Default value: At default, will mirror Global Config
|
||||
* ## setSiteConfig
|
||||
*
|
||||
* @param {any} conf - the base currentConfig to use as siteConfig
|
||||
* @returns {*} - the siteConfig
|
||||
* | Function | Description | Type | Values |
|
||||
* | ------------- | ------------------------------------- | ----------- | --------------------------------------- |
|
||||
* | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
|
||||
*
|
||||
* **Notes:** 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 current Config to the defaultConfig
|
||||
*
|
||||
* Note: currentConfig is set in this function
|
||||
*
|
||||
* Default value: At default, will mirror Global Config
|
||||
*
|
||||
* @param {any} conf - The base currentConfig to use as siteConfig
|
||||
* @returns {any} - The siteConfig
|
||||
*/
|
||||
export const setSiteConfig = (conf) => {
|
||||
siteConfig = assignWithDepth({}, defaultConfig);
|
||||
@@ -79,30 +82,32 @@ export const updateSiteConfig = (conf) => {
|
||||
return siteConfig;
|
||||
};
|
||||
/**
|
||||
*## getSiteConfig
|
||||
*| Function | Description | Type | Values |
|
||||
*| --------- | ------------------- | ------- | ------------------ |
|
||||
*| setSiteConfig|Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig|
|
||||
***Notes**:
|
||||
*Returns **any** values in siteConfig.
|
||||
* ## getSiteConfig
|
||||
*
|
||||
* @returns {*}
|
||||
* | Function | Description | Type | Values |
|
||||
* | ------------- | ------------------------------------------------- | ----------- | --------------------------------- |
|
||||
* | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in site Config |
|
||||
*
|
||||
* **Notes**: Returns **any** values in siteConfig.
|
||||
*
|
||||
* @returns {any}
|
||||
*/
|
||||
export const getSiteConfig = () => {
|
||||
return assignWithDepth({}, siteConfig);
|
||||
};
|
||||
/**
|
||||
*## setConfig
|
||||
*| Function | Description | Type | Values |
|
||||
*| --------- | ------------------- | ------- | ------------------ |
|
||||
*| setSiteConfig|Sets the siteConfig to desired values | Put Request| Any Values, except ones in secure array|
|
||||
***Notes**:
|
||||
*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
|
||||
*siteConfig value.
|
||||
* ## setConfig
|
||||
*
|
||||
* @param {any} conf - the potential currentConfig
|
||||
* @returns {*} - the currentConfig merged with the sanitized conf
|
||||
* | Function | Description | Type | Values |
|
||||
* | ------------- | ------------------------------------- | ----------- | --------------------------------------- |
|
||||
* | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
|
||||
*
|
||||
* **Notes**: 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 siteConfig value.
|
||||
*
|
||||
* @param {any} conf - The potential currentConfig
|
||||
* @returns {any} - The currentConfig merged with the sanitized conf
|
||||
*/
|
||||
export const setConfig = (conf) => {
|
||||
// sanitize(conf);
|
||||
@@ -117,28 +122,30 @@ export const setConfig = (conf) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* ## getConfig
|
||||
*| Function | Description | Type | Return Values |
|
||||
*| --------- | ------------------- | ------- | ------------------ |
|
||||
*| getConfig |Obtains the currentConfig | Get Request | Any Values from currentConfig|
|
||||
***Notes**:
|
||||
*Returns **any** the currentConfig
|
||||
* ## getConfig
|
||||
*
|
||||
* @returns {*} - the currentConfig
|
||||
* | Function | Description | Type | Return Values |
|
||||
* | --------- | ------------------------- | ----------- | ------------------------------ |
|
||||
* | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config |
|
||||
*
|
||||
* **Notes**: Returns **any** the currentConfig
|
||||
*
|
||||
* @returns {any} - The currentConfig
|
||||
*/
|
||||
export const getConfig = () => {
|
||||
return assignWithDepth({}, currentConfig);
|
||||
};
|
||||
/**
|
||||
*## sanitize
|
||||
*| Function | Description | Type | Values |
|
||||
*| --------- | ------------------- | ------- | ------------------ |
|
||||
*| sanitize |Sets the siteConfig to desired values. | Put Request |None|
|
||||
*Ensures options parameter does not attempt to override siteConfig secure keys
|
||||
***Notes**:
|
||||
* modifies options in-place
|
||||
* ## sanitize
|
||||
*
|
||||
* @param {any} options - the potential setConfig parameter
|
||||
* | Function | Description | Type | Values |
|
||||
* | -------- | -------------------------------------- | ----------- | ------ |
|
||||
* | sanitize | Sets the siteConfig to desired values. | Put Request | None |
|
||||
*
|
||||
* Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies
|
||||
* options in-place
|
||||
*
|
||||
* @param {any} options - The potential setConfig parameter
|
||||
*/
|
||||
export const sanitize = (options) => {
|
||||
// Checking that options are not in the list of excluded options
|
||||
@@ -193,18 +200,18 @@ export const addDirective = (directive) => {
|
||||
};
|
||||
|
||||
/**
|
||||
*## reset
|
||||
*| Function | Description | Type | Required | Values |
|
||||
*| --------- | ------------------- | ------- | -------- | ------------------ |
|
||||
*| reset|Resets currentConfig to conf| Put Request | Required | None|
|
||||
* ## reset
|
||||
*
|
||||
*| Parameter | Description |Type | Required | Values|
|
||||
*| --- | --- | --- | --- | --- |
|
||||
*| conf| base set of values, which currentConfig coul be **reset** to.| Dictionary | Required | Any Values, with respect to the secure Array|
|
||||
* | Function | Description | Type | Required | Values |
|
||||
* | -------- | ---------------------------- | ----------- | -------- | ------ |
|
||||
* | reset | Resets currentConfig to conf | Put Request | Required | None |
|
||||
*
|
||||
***Notes**:
|
||||
* (default: current siteConfig ) (optional, default `getSiteConfig()`)
|
||||
* | Parameter | Description | Type | Required | Values |
|
||||
*
|
||||
* | --------- | ------------------------------------------------------------ | ---------- | -------- | -------------------------------------------- |
|
||||
* | conf | base set of values, which currentConfig coul be **reset** to.| Dictionary | Required | Any Values, with respect to the secure Array |
|
||||
*
|
||||
* **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`)
|
||||
*/
|
||||
export const reset = () => {
|
||||
// Replace current config with siteConfig
|
||||
|
Reference in New Issue
Block a user