From 1131fe3761c1fa0c5e687ad847077953c3e6a517 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Wed, 17 Apr 2024 11:04:29 -0400 Subject: [PATCH] More rust at home --- source/utility/{some.ts => option.ts} | 9 +++++++++ 1 file changed, 9 insertions(+) rename source/utility/{some.ts => option.ts} (65%) diff --git a/source/utility/some.ts b/source/utility/option.ts similarity index 65% rename from source/utility/some.ts rename to source/utility/option.ts index 05bb873b..9b722984 100644 --- a/source/utility/some.ts +++ b/source/utility/option.ts @@ -28,4 +28,13 @@ namespace utility { } } } + + /** + * If you're not sure if it's going to be nothing, safely wrap it. + * @param input Something...or maybe nothing? + * @returns Option + */ + export function optionWrap(input: T | null): Option { + return new Option(input); + } } \ No newline at end of file