filter
Option.filter
returns the Some
if the contained value satisfies the predicated, returning None
otherwise.
Option<T>.filter = (predicate: (value: T) => boolean) => Option<T>;
Example
find(people, person => person.name === 'Tom') // => Some({ name: "Tom", age: 28 })
.filter(person => person.name === 'Carson') // => None