From 78414dee29c511e136475d439d150162c7f7d398 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Apr 2019 14:45:51 +0900 Subject: [PATCH] Add note --- src/prelude/ensure.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/prelude/ensure.ts b/src/prelude/ensure.ts index 90bf05538a..c9264adc13 100644 --- a/src/prelude/ensure.ts +++ b/src/prelude/ensure.ts @@ -1,3 +1,6 @@ +/** + * 値が null または undefined の場合はエラーを発生させ、そうでない場合は値をそのまま返します + */ export function ensure(x: T): NonNullable { if (x == null) { throw 'ぬるぽ';