mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 07:53:54 +00:00
16 lines
328 B
TypeScript
16 lines
328 B
TypeScript
/**
|
|
* Business logic for resolving a string
|
|
*/
|
|
export function extractPin(value: string | undefined | null, fallback: string | null): string | null {
|
|
if (value === null) {
|
|
return value;
|
|
}
|
|
if (typeof value === 'undefined') {
|
|
return fallback;
|
|
}
|
|
if (value.length === 0) {
|
|
return null;
|
|
}
|
|
return value;
|
|
}
|