c

jshelpers

JsUndefOrNullOps

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsUndefOrNullOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JsUndefOrNullOps(a: UndefOr[|[T, Null]])

Value Members

  1. def !: T

    Alias for .get

    Alias for .get

    Annotations
    @inline()
  2. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  3. def !?[B >: T](default: => T): T
    Annotations
    @inline()
  4. final def ##: Int
    Definition Classes
    Any
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  6. def ??[B >: T](default: => T): T

    Alias for getOrElse.

    Alias for getOrElse.

    Annotations
    @inline()
  7. val a: UndefOr[|[T, Null]]
  8. 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()
  9. 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()
  10. def absorbUndef: |[T, Null]

    Absorb the js.UndefOr leaving T|Null.

    Absorb the js.UndefOr leaving T|Null.

    Annotations
    @inline()
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def flatten: UndefOr[T]

    Flatten the UndefOr and Null to UndefOr only.

    Flatten the UndefOr and Null to UndefOr only.

    Annotations
    @inline()
  13. def flattenUndefOr: |[T, Null]

    flatten but leave the UndefOr.

    flatten but leave the UndefOr. Same as absorbUndef.

    Annotations
    @inline()
  14. def get: T

    May be undefined or null or something.

    May be undefined or null or something. Throws exception.

    Annotations
    @inline()
  15. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  16. def getOrElse[B >: T](default: => T): T
    Annotations
    @inline()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def swap: |[UndefOr[T], Null]

    Natural transformation.

    Natural transformation.

    Annotations
    @inline()
  19. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped