object Utils
- Alphabetic
- By Inheritance
- Utils
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
CRMGUID(): String
Generate a new CRM GUID.
Generate a new CRM GUID.
- Annotations
- @inline()
-
val
GUID_r: RegExp
JS version.
JS version. @see https://stackoverflow.com/questions/7905929/how-to-test-valid-uuid-guid
-
def
addMinutes(d: Date, n: Int): Date
Add minutes to a date.
-
def
cleanId(id: String): String
Clean an id that has braces around it.
Clean an id that has braces around it.
- Annotations
- @inline()
-
def
filterForMatches[A](wr: Traversable[(A, Seq[String])], filters: Traversable[String] = Nil): Seq[A]
Given a sequence of data items and related "use these strings for comparison" values, return the data items that matched.
Given a sequence of data items and related "use these strings for comparison" values, return the data items that matched. If filters is empty, every item matches.
-
def
filterOneForMatches[A](f: (A) ⇒ Seq[String], filters: Traversable[String] = Nil): (A) ⇒ Boolean
Factory to create a matcher.
Factory to create a matcher.
- returns
A => Boolean
-
def
getStackTraceAsString(t: Throwable): String
Given a throwable, convert the stacktrace to a string for printing.
-
def
inferWebResourceType(ext: String): Option[Int]
Infer a resource type based on the filename extension.
Infer a resource type based on the filename extension. Return none if it does not match any known Web Resource resource types.
-
def
jsonParse(content: String, reviver: Option[Reviver] = None): Dynamic
Parse some json.
Parse some json.
- Annotations
- @inline()
-
def
matchCount(filters: Traversable[String]): (String) ⇒ Int
Given a set of regex filters, return String => Int that counts matches.
-
def
maybeId(identifier: String): Boolean
Return true if the identifier matches a GUId format, false otherwise.
Return true if the identifier matches a GUId format, false otherwise.
- See also
https://www.ietf.org/rfc/rfc4122.txt
-
def
merge[T <: Object](objs: |[T, Dynamic]*): T
Merge objects and Ts together.
Merge objects and Ts together. Good for merging props with data- attributes. Handles null inputs. See the note from mergeJSObjects. Last object's fields win.
- Annotations
- @inline()
-
def
mergeJSObjects(objs: Dynamic*): Dynamic
This is really just a Semigroup "combine" operation but it does *not* use "combine" at lower levels of the structure i.e.
This is really just a Semigroup "combine" operation but it does *not* use "combine" at lower levels of the structure i.e. a shallow copy. Last object's fields wins. Handles null inputs.
- Annotations
- @inline()
- See also
https://stackoverflow.com/questions/36561209/is-it-possible-to-combine-two-js-dynamic-objects
-
def
options(): Object with Dynamic
Empty dynamics object read to add options in a javascript way.
-
def
strip(in: String): String
Strip a string suitable for a text attribute in dynamics.
Strip a string suitable for a text attribute in dynamics. Essentially, it preserves some ASCII characters and leaves a few whitespace control characters (newline, cr, tab).
-
def
stripUpTo(path: String, prefix: String): String
Return the tail of the path from the prefix forward.
Return the tail of the path from the prefix forward. It does not matter if the prefix is a directory segment or part of a filename.