typescript(option): refactor: rewrote Some as a typecasted identity
typescript(option): typescript(option): The Some function did nothing at runtime so a typecasted identity did the job Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
445bab939e
commit
ff81096e6f
|
@ -1,4 +1,4 @@
|
|||
import { none } from './internals'
|
||||
import { none, identity } from './internals'
|
||||
import { Brand } from 'utility-types'
|
||||
|
||||
// This is never actually used outside of typing so we can just declare it
|
||||
|
@ -13,4 +13,4 @@ export const None = {
|
|||
__brand: none,
|
||||
toString: () => 'None'
|
||||
} as None
|
||||
export const Some = <T>(value: T) => value as Option<T>
|
||||
export const Some = identity as <T>(value: T) => Option<T>
|
||||
|
|
Loading…
Reference in a new issue