Skip to content

Commit

Permalink
Fixed optional types
Browse files Browse the repository at this point in the history
  • Loading branch information
ffrostfall committed Mar 10, 2024
1 parent c55c083 commit b569907
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dataTypes/optional.luau
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ return function(valueType: types.dataTypeInterface<any>)
end,

write = function(value: any)
bool(value ~= nil)
valueWrite(value)
local exists = value ~= nil

bool(exists)

if exists then
valueWrite(value)
end
end,
}
end :: <T>(valueType: types.dataTypeInterface<T>) -> types.dataTypeInterface<T?>

0 comments on commit b569907

Please sign in to comment.