mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-10-23 04:52:14 +00:00
15 lines
271 B
TypeScript
15 lines
271 B
TypeScript
export { isNotThrowing, booleanToHumanReadable };
|
|
|
|
function isNotThrowing(cb: () => unknown): boolean {
|
|
try {
|
|
cb();
|
|
return true;
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function booleanToHumanReadable(value: boolean): string {
|
|
return value ? 'Yes' : 'No';
|
|
}
|