The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/settings/server/functions/convertValue.ts

14 lines
367 B

import { ISetting, SettingValue } from '../../../../definition/ISetting';
export const convertValue = (value: 'true' | 'false' | string, type: ISetting['type']): SettingValue => {
if (value.toLowerCase() === 'true') {
return true;
}
if (value.toLowerCase() === 'false') {
return false;
}
if (type === 'int') {
return parseInt(value);
}
return value;
};