mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 05:54:43 -04:00
Extend config with various options from 1.x
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
18c6694bcb
commit
286575315e
13 changed files with 686 additions and 32 deletions
src/config
17
src/config/utils.ts
Normal file
17
src/config/utils.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export const toArrayConfig = (configValue: string, separator = ',') => {
|
||||
if (!configValue) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!configValue.includes(separator)) {
|
||||
return [configValue.trim()];
|
||||
}
|
||||
|
||||
return configValue.split(separator).map((arrayItem) => arrayItem.trim());
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue