1
Fork 0

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:
Matei Adriel 2019-12-23 14:25:10 +02:00 committed by prescientmoon
parent 445bab939e
commit ff81096e6f
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -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>