1 | _ = require 'underscore'
|
2 |
|
3 | module.exports =
|
4 | die_fn: (cb) ->
|
5 | (err_txt) ->
|
6 | return cb new Error err_txt if _(cb).isFunction()
|
7 | throw Error err_txt # only option if no cb
|
8 |
|
9 | is_email: (str) ->
|
10 | return false if not str?
|
11 | return str.match /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i
|