crow/js/util.crow
(source)
cast-option
[t
] t
?
(a
js-any
) unsafe
Converts a JS nullable / undefined-able value to 't'.
deep-equals
bool
(a
js-any
, b
js-any
) unsafe
Compares two JS objects deeply.
This won't work on opaque types.
make-class
js-any
(super-class
js-any
, constructor
mut
js-any
((js-any
, js-any
array
) tuple2
), methods
symbol
[
mut
js-any
((js-any
, js-any
array
) tuple2
)]
) unsafe
Creates a new JavaScript class.
This currently does not support fields, getters/setters, or calling 'super' with arguments.
method
alias
json-parse
js-any
(a
string
) unsafe
Same as JSON.parse(a)
in JS.
Returns a JS object, not a json
value.
json-stringify
string
(a
js-any
) unsafe
Same as JSON.stringify(a)
in JS.