Skip to content

Commit

Permalink
add raw function as a get alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
manusant committed May 2, 2024
1 parent 340fe44 commit 8bdde10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "katxupa",
"version": "1.9.6",
"version": "1.9.7",
"description": "Delicious Dish for Typescript and JavaScript projects",
"author": "Manuel Santos <ney.br.santos@gmail.com>",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/optional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ export class Optional<T> {
*
* @return The value inside the Optional object.
* */
raw(): T | undefined | null {
raw(): T | undefined {
if (this.value === null) return undefined;
return this.value;
}

Expand Down

0 comments on commit 8bdde10

Please sign in to comment.