attempt
install
$ npm install bloody-attempt
require
var attempt =
api
attempt(fn) > boolean
returns whether or not fn
execution has been without error.
attempt.withValue(fn) > value
returns the result of fn()
or the error it threw.
attempt.all(object) > key || null
tries to execute functions in object until one does not error. returns the key matching the error free function. if none executed properly, null is returned.
attemptall { document } { "attempt" bubbles: false cancelable: false detail: {} }// => "CUSTOM_EVENT"