diff --git a/classes/index.Option.html b/classes/index.Option.html index 18ffd1a..cd81e48 100644 --- a/classes/index.Option.html +++ b/classes/index.Option.html @@ -1,6 +1,6 @@
Returns an iterator over the possibly contained value.
+A function that returns an Option
Returns None
if the Option
is None
, otherwise calls predicate with the wrapped value and returns:
Returns None
if the Option
is None
, otherwise calls predicate with the wrapped value and returns:
Some(t)
if predicate returns true
(where t
is the wrapped value with inferred new type), andNone
if predicate returns false
.Returns None
if the Option
is None
, otherwise calls predicate with the wrapped value and returns:
Returns None
if the Option
is None
, otherwise calls predicate with the wrapped value and returns:
Some(t)
if predicate returns true
(where t
is the wrapped value), andNone
if predicate returns false
.A function that returns true
or false
.
Optional
thisArg: anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined
is used instead.
Converts from Option<Option<T>>
to Option<T>
Converts from Option<Option<T>>
to Option<T>
A function that returns true
if the value satisfies the predicate, otherwise false
A function that returns true
if the value satisfies the predicate, otherwise false
Optional
thisArg: anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined
is used instead.
true
if the Option
is a Some
and and the value inside of it matches a predicate.
Maps an Option<T>
to Option<U>
by applying a function to a contained value (if Some
) or returns None
(if None
).
Extract the value from an Option
in a way that handles both the Some
and None
cases.
Transforms the Option<T>
into a Result<T, E>
, mapping Some(v)
to Ok(v)
and None to Err(err)
.
Transforms the Option<T>
into a Result<T, E>
, mapping Some(v)
to Ok(v)
and None to Err(err)
.
Arguments passed to okOr
are eagerly evaluated; if you are passing the result of a function call, it is recommended to use okOrElse
, which is lazily evaluated.
The error value for Err
if the Option
is None
.
Transforms the Option<T>
into a Result<T, E>
, mapping Some(v)
to Ok(v)
and None
to Err(err())
.
A function that returns the error value for Err
if the Option
is None
.
Optional
thisArg: anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined
is used instead.
A function that returns an Option
Transposes an Option(Result)
into Result(Option)
.
Transposes an Option(Result)
into Result(Option)
.
None
will be mapped to Ok(None)
.Some(Ok(_))
and Some(Err(_))
will be mapped to Ok(Some(_))
and Err(_)
.Some(value)
will be mapped to Ok(Some(value))
.the contained Some
value or undefined
otherwise.
Arguments passed to unwrapOr
are eagerly evaluated; if you are passing the result of a function call, it is recommended to use unwrapOrElse
, which is lazily evaluated.
default value
+default value
the contained Some
value or a provided default.
Arguments passed to unwrapOr
are eagerly evaluated; if you are passing the result of a function call, it is recommended to use unwrapOrElse
, which is lazily evaluated.
A function that computes a default value.
+A function that computes a default value.
Optional
thisArg: anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined
is used instead.
the contained Some
value or computes it from a closure.
Unzips an Option
containing a tuple of two Option
s.
Unzips an Option
containing a tuple of two Option
s.
[Some(a), Some(b)]
if this
is Some([a, b])
, otherwise [None, None]
.
An Option
Zips this
with another Option
.
Zips this
and another Option
with function fn
.
Static
fromWrap a value in an Option
if the value is truthy.
Static
fromWrap a value in an Option
if the value is truthy.
A value of type T
Wrap a value in an Option
if the value satisfies the predicate.
Wrap a value in an Option
if the value satisfies the predicate.
Source value
A function that returns true
if the value satisfies the predicate, otherwise false
Optional
thisArg: anyIf provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined
is used instead.
Wrap a value in an Option
if the value satisfies the predicate.
Wrap a value in an Option
if the value satisfies the predicate.
Static
isStatic
isStatic
is
The
-Option
type is an immutable representation of an optional value: everyOption
is eitherSome
and contains a value, orNone
and does not.