From 340fe440c9aed4d858fd0fedd4f388ed309c73fc Mon Sep 17 00:00:00 2001 From: manusant Date: Thu, 2 May 2024 17:45:20 +0100 Subject: [PATCH] add raw function as a get alternative --- package.json | 2 +- src/optional.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a8c519..2358b96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "katxupa", - "version": "1.9.5", + "version": "1.9.6", "description": "Delicious Dish for Typescript and JavaScript projects", "author": "Manuel Santos ", "license": "MIT", diff --git a/src/optional.ts b/src/optional.ts index a68ec80..3b4868a 100644 --- a/src/optional.ts +++ b/src/optional.ts @@ -239,6 +239,15 @@ export class Optional { return this.value!; } + /** + * The get method is used to retrieve the value inside the Optional object. + * + * @return The value inside the Optional object. + * */ + raw(): T | undefined | null { + return this.value; + } + /** * The orElse method is used to retrieve the value inside the Optional object if it is present, * or return a default value if the Optional object is empty.