Packages

t

dynamics.common

JSDataHelpers

trait JSDataHelpers extends AnyRef

Helpers when working with scalajs data, specifically, js.Object, js.Dynamic and js.Dictionary. Most of these mutate the input source so create a copy of the data prior to calling if you want.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JSDataHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def deepCopy(obj: Object): Object

    Slow but steady deep copy using JSON.stringify and JSON.parse.

    Slow but steady deep copy using JSON.stringify and JSON.parse.

    Annotations
    @inline()
  7. def doIfDefined(obj: JsAnyDict, p: String, f: (Dictionary[Any]) ⇒ Unit): obj.type

    If property is defined, do something to object, otherwise return original object.

    If property is defined, do something to object, otherwise return original object. Mutating!

    Annotations
    @inline()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def getAndZap[A](j: JsAnyDict, p: String): Option[A]

    Get a value in the js object and return it wrapped in Option.

    Get a value in the js object and return it wrapped in Option. If found, it is removed from the object, a mutating operation.

    Annotations
    @inline()
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def isBlank(obj: JsAnyDict, p: String): Boolean

    If property is present, return true if its value is js truthy true else return false.

    If property is present, return true if its value is js truthy true else return false.

    Annotations
    @inline()
  15. def isDefined(obj: Dictionary[_], p: String): Boolean

    True if property is defined on the object.

    True if property is defined on the object. Shouldn't we use hasOwnProperty?

    Annotations
    @inline()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def keepOnly(obj: JsAnyDict, names: String*): obj.type
    Annotations
    @inline()
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def omit(j: Dictionary[_], keys: String*): j.type

    Removes keys if present.

    Removes keys if present. Mutates input object. lodash naming.

    Annotations
    @inline()
  22. def omitIfMatch(j: Dictionary[_], patterns: Seq[String]): j.type

    Removes keys if the field name contains the pattern substring.

    Removes keys if the field name contains the pattern substring. This does not use regex.

    Annotations
    @inline()
    To do

    Make this more efficient.

  23. def pruneIfBlank(obj: JsAnyDict, p: String*): obj.type

    Assuming a property is a string, omit the property from the object if its blank.

    Assuming a property is a string, omit the property from the object if its blank. This is a mutating action.

    Annotations
    @inline()
  24. def rename(j: JsAnyDict, renames: (String, String)*): j.type

    Rename keys.

    Rename keys. Mutates input object. Old keys are removed as they are moved. If a key is not found, that property is not renamed.

    Annotations
    @inline()
  25. def replaceIfBlank(obj: JsAnyDict, p: String, f: (Any) ⇒ Any): obj.type

    If the property is present and is not blank, apply f to it.

    If the property is present and is not blank, apply f to it.

    Annotations
    @inline()
  26. def roundAt(p: Int)(n: Double): Double
    Annotations
    @inline()
  27. def setTo(obj: JsAnyDict, p: String, value: Any): obj.type

    If property is present, replace with value regardless of the current value.

    If property is present, replace with value regardless of the current value.

    Annotations
    @inline()
  28. def stdConverter(keeps: Option[String], drops: Option[String], renames: Option[String]): (Object) ⇒ Object

    Given some string definitions of keep, drop and rename, create a function that that mutates a js.Object.

    Given some string definitions of keep, drop and rename, create a function that that mutates a js.Object. This parses the "dsl" and returns a function to perform the conversion without needing to reparse the "dsl".

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. def updateObject[A](drops: Seq[String], renames: Seq[(String, String)], obj: JsAnyDict): Dictionary[Any]

    Update an object.

    Update an object. Mutates in place! Processng order is drops then renames.

    Annotations
    @inline()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  35. def xfObj[A](obj: JsAnyDict, p: String, pf: PartialFunction[A, Unit]): obj.type

    If property is present, apply partial function.

    If property is present, apply partial function.

    Annotations
    @inline()

Inherited from AnyRef

Inherited from Any

Ungrouped