c

jshelpers

JsUndefOrStringOps

final case class JsUndefOrStringOps(a: UndefOr[String]) extends UndefOrCommon[String] with Product with Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsUndefOrStringOps
  2. Serializable
  3. Product
  4. Equals
  5. UndefOrCommon
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JsUndefOrStringOps(a: UndefOr[String])

Value Members

  1. def !?[B >: String](default: => B): B

    Same as .getOrElse just shorter.

    Same as .getOrElse just shorter.

    Definition Classes
    UndefOrCommon
    Annotations
    @inline()
  2. def ??[B >: String](default: => B): B

    Same as .getOrElse just shorter.

    Same as .getOrElse just shorter.

    Definition Classes
    UndefOrCommon
    Annotations
    @inline()
  3. val a: UndefOr[String]
    Definition Classes
    JsUndefOrStringOpsUndefOrCommon
  4. def as[B]: UndefOr[B]

    Changes what's inside but preserves UndefOr.

    Changes what's inside but preserves UndefOr.

    Definition Classes
    UndefOrCommon
  5. def filterEmpty: UndefOr[String]

    Filter out empty string and null.

    Filter out empty string and null.

    Annotations
    @inline()
  6. def filterNull: UndefOr[String]

    null => undefined, else the value remains.

    null => undefined, else the value remains.

    Definition Classes
    UndefOrCommon
  7. def filterTruthy: UndefOr[String]

    Keep the value if its truthy, otherwise return undefined.

    Keep the value if its truthy, otherwise return undefined.

    Definition Classes
    UndefOrCommon
  8. def isNull: Boolean

    Tests for overall nullness which is different than .isEmpty|.nonEmpty.

    Tests for overall nullness which is different than .isEmpty|.nonEmpty.

    Definition Classes
    UndefOrCommon
  9. def isTotalEmpty: Boolean

    This may override UndefOr.isEmpty but this checks for null as well.

    This may override UndefOr.isEmpty but this checks for null as well.

    Definition Classes
    UndefOrCommon
  10. def orEmpty: String

    Return string's "zero" which is an empty string.

    Return string's "zero" which is an empty string.

    Annotations
    @inline()
  11. def productElementNames: Iterator[String]
    Definition Classes
    Product
  12. def toNonNullOption: Option[String]

    This could also be _.toOption.filter(_ != null) but below is slightly faster.

    This could also be _.toOption.filter(_ != null) but below is slightly faster.

    Definition Classes
    UndefOrCommon
  13. def toNull: |[String, Null]

    Convert UndefOr[A] => A|Null

    Convert UndefOr[A] => A|Null

    Definition Classes
    UndefOrCommon
  14. def toStringJs: String

    Calls toString.

    Calls toString. I'm not sure this is needed at all.

    Definition Classes
    UndefOrCommon
  15. def toTruthy: Boolean

    Equivalent to !!someJSValue

    Equivalent to !!someJSValue

    Definition Classes
    UndefOrCommon
  16. def toUndefOrNull: UndefOr[|[String, Null]]

    Uh-oh, thought it was js.UndefOr[A] but you need to say its a js.UndefOr[A|Null] because the docs were wrong :-).

    Uh-oh, thought it was js.UndefOr[A] but you need to say its a js.UndefOr[A|Null] because the docs were wrong :-).

    Definition Classes
    UndefOrCommon
    Annotations
    @inline()