mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-11 15:02:47 +01:00
Add note
This commit is contained in:
parent
084135141f
commit
78414dee29
1 changed files with 3 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
/**
|
||||||
|
* 値が null または undefined の場合はエラーを発生させ、そうでない場合は値をそのまま返します
|
||||||
|
*/
|
||||||
export function ensure<T>(x: T): NonNullable<T> {
|
export function ensure<T>(x: T): NonNullable<T> {
|
||||||
if (x == null) {
|
if (x == null) {
|
||||||
throw 'ぬるぽ';
|
throw 'ぬるぽ';
|
||||||
|
|
Loading…
Reference in a new issue