Logs Automatically purges themselves
This commit is contained in:
1 parent
fda24f934c
commit
a42174b233
632 files changed
+19952
-20039
No files matched your search
+20
-29
@@ -1,9 +1,9 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
// Generated by CoffeeScript 1.6.1
|
||||
(function() {
|
||||
var events, isEmpty, sax,
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
_this = this;
|
||||
|
||||
sax = require('sax');
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
};
|
||||
|
||||
exports.ValidationError = (function(_super) {
|
||||
|
||||
__extends(ValidationError, _super);
|
||||
|
||||
function ValidationError(message) {
|
||||
@@ -66,15 +67,18 @@
|
||||
})(Error);
|
||||
|
||||
exports.Parser = (function(_super) {
|
||||
|
||||
__extends(Parser, _super);
|
||||
|
||||
function Parser(opts) {
|
||||
this.parseString = __bind(this.parseString, this);
|
||||
this.reset = __bind(this.reset, this);
|
||||
var key, value, _ref;
|
||||
if (!(this instanceof exports.Parser)) {
|
||||
return new exports.Parser(opts);
|
||||
}
|
||||
var key, value, _ref,
|
||||
_this = this;
|
||||
this.parseString = function(str, cb) {
|
||||
return Parser.prototype.parseString.apply(_this, arguments);
|
||||
};
|
||||
this.reset = function() {
|
||||
return Parser.prototype.reset.apply(_this, arguments);
|
||||
};
|
||||
this.options = {};
|
||||
_ref = exports.defaults["0.2"];
|
||||
for (key in _ref) {
|
||||
@@ -94,7 +98,7 @@
|
||||
}
|
||||
|
||||
Parser.prototype.reset = function() {
|
||||
var attrkey, charkey, err, ontext, stack,
|
||||
var attrkey, charkey, err, stack,
|
||||
_this = this;
|
||||
this.removeAllListeners();
|
||||
this.saxParser = sax.parser(this.options.strict, {
|
||||
@@ -142,15 +146,12 @@
|
||||
return stack.push(obj);
|
||||
};
|
||||
this.saxParser.onclosetag = function() {
|
||||
var cdata, emptyStr, node, nodeName, obj, old, s, xpath;
|
||||
var node, nodeName, obj, old, s, xpath;
|
||||
obj = stack.pop();
|
||||
nodeName = obj["#name"];
|
||||
delete obj["#name"];
|
||||
cdata = obj.cdata;
|
||||
delete obj.cdata;
|
||||
s = stack[stack.length - 1];
|
||||
if (obj[charkey].match(/^\s*$/) && !cdata) {
|
||||
emptyStr = obj[charkey];
|
||||
if (obj[charkey].match(/^\s*$/)) {
|
||||
delete obj[charkey];
|
||||
} else {
|
||||
if (_this.options.trim) {
|
||||
@@ -163,8 +164,8 @@
|
||||
obj = obj[charkey];
|
||||
}
|
||||
}
|
||||
if (isEmpty(obj)) {
|
||||
obj = _this.options.emptyTag !== void 0 ? _this.options.emptyTag : emptyStr;
|
||||
if ((isEmpty(obj)) && stack.length > 0) {
|
||||
obj = _this.options.emptyTag !== void 0 ? _this.options.emptyTag : '';
|
||||
}
|
||||
if (_this.options.validator != null) {
|
||||
xpath = "/" + ((function() {
|
||||
@@ -178,8 +179,7 @@
|
||||
})()).concat(nodeName).join("/");
|
||||
try {
|
||||
obj = _this.options.validator(xpath, s && s[nodeName], obj);
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
} catch (err) {
|
||||
_this.emit("error", err);
|
||||
}
|
||||
}
|
||||
@@ -225,20 +225,11 @@
|
||||
return _this.emit("end", _this.resultObject);
|
||||
}
|
||||
};
|
||||
ontext = function(text) {
|
||||
return this.saxParser.ontext = this.saxParser.oncdata = function(text) {
|
||||
var s;
|
||||
s = stack[stack.length - 1];
|
||||
if (s) {
|
||||
s[charkey] += text;
|
||||
return s;
|
||||
}
|
||||
};
|
||||
this.saxParser.ontext = ontext;
|
||||
return this.saxParser.oncdata = function(text) {
|
||||
var s;
|
||||
s = ontext(text);
|
||||
if (s) {
|
||||
return s.cdata = true;
|
||||
return s[charkey] += text;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user