final class JsUndefOrNullOps[T] extends AnyVal
Handled js.UndefOr[T|Null] directly vs needing to flatmap into it. Don't forget that
scala.js has anUndefOr.orNull
to extract the value or return null which is *not*
what the methods below do.
- Alphabetic
- By Inheritance
- JsUndefOrNullOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def !: T
Alias for
.get
Alias for
.get
- Annotations
- @inline()
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- def !?[B >: T](default: => T): T
- Annotations
- @inline()
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def ??[B >: T](default: => T): T
Alias for getOrElse.
Alias for getOrElse.
- Annotations
- @inline()
- val a: UndefOr[|[T, Null]]
- def absorbNull: UndefOr[T]
Treat null as undefined and change type from T|Null to T.
Treat null as undefined and change type from T|Null to T.
- Annotations
- @inline()
- def absorbNullKeepTruthy: UndefOr[T]
T|Null may still have T not being truthy, so absorb null and non-truthiness => js.undefined.
T|Null may still have T not being truthy, so absorb null and non-truthiness => js.undefined.
- Annotations
- @inline()
- def absorbUndef: |[T, Null]
Absorb the
js.UndefOr
leavingT|Null
.Absorb the
js.UndefOr
leavingT|Null
.- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def flatten: UndefOr[T]
Flatten the UndefOr and Null to UndefOr only.
Flatten the UndefOr and Null to UndefOr only.
- Annotations
- @inline()
- def flattenUndefOr: |[T, Null]
flatten
but leave the UndefOr.flatten
but leave the UndefOr. Same asabsorbUndef
.- Annotations
- @inline()
- def get: T
May be undefined or null or something.
May be undefined or null or something. Throws exception.
- Annotations
- @inline()
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def getOrElse[B >: T](default: => T): T
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def swap: |[UndefOr[T], Null]
Natural transformation.
Natural transformation.
- Annotations
- @inline()
- def toString(): String
- Definition Classes
- Any