mirror of
https://github.com/S2-/gitlit
synced 2025-08-04 05:10:05 +02:00
add node modules to repo
This commit is contained in:
50
node_modules/xmlbuilder/lib/XMLDTDAttList.js
generated
vendored
Normal file
50
node_modules/xmlbuilder/lib/XMLDTDAttList.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
// Generated by CoffeeScript 1.10.0
|
||||
(function() {
|
||||
var XMLDTDAttList, XMLNode,
|
||||
extend = 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; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
XMLNode = require('./XMLNode');
|
||||
|
||||
module.exports = XMLDTDAttList = (function(superClass) {
|
||||
extend(XMLDTDAttList, superClass);
|
||||
|
||||
function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
|
||||
XMLDTDAttList.__super__.constructor.call(this, parent);
|
||||
if (elementName == null) {
|
||||
throw new Error("Missing DTD element name");
|
||||
}
|
||||
if (attributeName == null) {
|
||||
throw new Error("Missing DTD attribute name");
|
||||
}
|
||||
if (!attributeType) {
|
||||
throw new Error("Missing DTD attribute type");
|
||||
}
|
||||
if (!defaultValueType) {
|
||||
throw new Error("Missing DTD attribute default");
|
||||
}
|
||||
if (defaultValueType.indexOf('#') !== 0) {
|
||||
defaultValueType = '#' + defaultValueType;
|
||||
}
|
||||
if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
|
||||
throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
|
||||
}
|
||||
if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
|
||||
throw new Error("Default value only applies to #FIXED or #DEFAULT");
|
||||
}
|
||||
this.elementName = this.stringify.eleName(elementName);
|
||||
this.attributeName = this.stringify.attName(attributeName);
|
||||
this.attributeType = this.stringify.dtdAttType(attributeType);
|
||||
this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
|
||||
this.defaultValueType = defaultValueType;
|
||||
}
|
||||
|
||||
XMLDTDAttList.prototype.toString = function(options) {
|
||||
return this.options.writer.set(options).dtdAttList(this);
|
||||
};
|
||||
|
||||
return XMLDTDAttList;
|
||||
|
||||
})(XMLNode);
|
||||
|
||||
}).call(this);
|
Reference in New Issue
Block a user