12 lines
242 B
TypeScript
12 lines
242 B
TypeScript
/**
|
|
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
|
* @license MIT
|
|
*/
|
|
|
|
export function throwIfFalsy<T>(value: T | undefined | null): T {
|
|
if (!value) {
|
|
throw new Error('value must not be falsy');
|
|
}
|
|
return value;
|
|
}
|