1 | Utils = {}
|
2 |
|
3 | Utils.toString = Object.prototype.toString
|
4 |
|
5 | Utils.isUndefined = (value) ->
|
6 | value is 'undefined' or Utils.toString.call(value) is '[object Function]' or value.hash?
|
7 |
|
8 | Utils.safeString = (str) ->
|
9 | new Handlebars.SafeString str
|
10 |
|
11 | Utils.trim = (str) ->
|
12 | trim = if /\S/.test("\xA0") then /^[\s\xA0]+|[\s\xA0]+$/g else /^\s+|\s+$/g
|
13 | str.toString().replace trim, ''
|