scratch
/bower_components/yaml.js/lib/Utils.js |
@@ -1,5 +1,6 @@ |
// Generated by CoffeeScript 1.10.0 |
var Pattern, Utils; |
// Generated by CoffeeScript 1.12.4 |
var Pattern, Utils, |
hasProp = {}.hasOwnProperty; |
|
Pattern = require('./Pattern'); |
|
@@ -27,7 +28,6 @@ |
if (_char == null) { |
_char = '\\s'; |
} |
return str.trim(); |
regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; |
if (regexLeft == null) { |
this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); |
@@ -68,9 +68,22 @@ |
}; |
|
Utils.isEmpty = function(value) { |
return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0); |
return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0) || this.isEmptyObject(value); |
}; |
|
Utils.isEmptyObject = function(value) { |
var k; |
return value instanceof Object && ((function() { |
var results; |
results = []; |
for (k in value) { |
if (!hasProp.call(value, k)) continue; |
results.push(k); |
} |
return results; |
})()).length === 0; |
}; |
|
Utils.subStrCount = function(string, subString, start, length) { |
var c, i, j, len, ref, sublen; |
c = 0; |
@@ -200,7 +213,7 @@ |
} |
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); |
if (tz_offset) { |
date.setTime(date.getTime() + tz_offset); |
date.setTime(date.getTime() - tz_offset); |
} |
return date; |
}; |
@@ -231,7 +244,7 @@ |
name = ref[j]; |
try { |
xhr = new ActiveXObject(name); |
} catch (undefined) {} |
} catch (error) {} |
} |
} |
} |