mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 21:16:18 +00:00
Added function to parse optional boolean to string
This commit is contained in:
@@ -30,3 +30,7 @@ export const equals = (value: any) => (otherValue: any) => value === otherValue;
|
||||
export type BooleanString = 'true' | 'false';
|
||||
|
||||
export const parseBooleanToString = (value: boolean): BooleanString => (value ? 'true' : 'false');
|
||||
|
||||
export const parseOptionalBooleanToString = (value?: boolean): BooleanString | undefined => (
|
||||
value === undefined ? undefined : parseBooleanToString(value)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user