UNPKG

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