c

jshelpers

JsDynamicOps

final class JsDynamicOps extends AnyVal

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

Instance Constructors

  1. new JsDynamicOps(jsdyn: Dynamic)

Value Members

  1. def as[T]: T

    Short version of .asInstanceOf.

  2. def asArray[A]: Array[A]
  3. def asBoolean: Boolean
  4. def asDict[A]: Dictionary[A]
  5. def asInt: Int
  6. def asJSDate: Date
  7. def asJsAny: Any
  8. def asJsArray[A <: Object]: Array[A]
  9. def asJsObj: Object
  10. def asJsObjSub[A <: Object]: A
  11. def asOrNull[T]: |[T, Null]

    This value could be T or null.

    This value could be T or null. This does not check if its undefined.

  12. def asString: String
  13. def asUndefOrNull[T]: UndefOr[|[T, Null]]

    As potentially T, null or undefined.

    As potentially T, null or undefined. The safest cast.

  14. def combine(that: Dynamic): Dynamic

    Shallow combine into existing value.

  15. def combineGeneric(that: UndefOr[Object]): Dynamic

    Combine with general js.Object

  16. def combineGenericTo[B](that: UndefOr[Object]): B

    Combine with general js.Object and cast.

  17. def combineTo[B](that: Dynamic): B

    Combine and cast.

  18. def duplicate: Dynamic

    Duplicate using js.Object.assign

  19. def duplicateCombine(that: Dynamic): Dynamic

    Duplicate and combine.

  20. def duplicateCombineTo[B](that: Dynamic): B

    Duplicate, combine and cast!

  21. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  22. def toNonNullOption[T <: Object]: Option[T]

    Null and undefined => None, otherwise Some.

    Null and undefined => None, otherwise Some. The safest conversion.

  23. def toOption[T <: Object]: Option[T]

    Uses truthiness to determine None, you may not want this.

  24. def toTruthy: Boolean

    Determine if truthy.

    Determine if truthy. Very tricky!