Fix doc gen

This commit is contained in:
Amish Shah
2016-08-21 17:47:12 +01:00
parent 985681f1f6
commit ac7c543dfe
5 changed files with 11 additions and 12 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
{
"GEN_VERSION": 10,
"COMPRESS": false
"COMPRESS": true
}

View File

@@ -11,10 +11,13 @@ const docScanner = new DocumentationScanner(this);
function parseDocs(json) {
console.log(`${json.length} items found`);
const documentation = new Documentation(json);
console.log('serializing');
let output = JSON.stringify(documentation.serialize(), null, 0);
if (compress) {
console.log('compressing');
output = zlib.deflateSync(output).toString('utf8');
}
console.log('writing to docs.json');
fs.writeFileSync('./docs/docs.json', output);
}

View File

@@ -37,19 +37,19 @@ class DocumentedClass extends DocumentedItem {
this.classConstructor = item;
} else if (item instanceof DocumentedFunction) {
if (this.methods.get(item.directData.name)) {
throw new Error(`Doc ${this.directData.name} already has method ${item.name}`);
throw new Error(`Doc ${this.directData.name} already has method ${item.directData.name}`);
}
this.methods.set(item.name, item);
this.methods.set(item.directData.name, item);
} else if (item instanceof DocumentedMember) {
if (this.props.get(item.directData.name)) {
throw new Error(`Doc ${this.directData.name} already has prop ${item.name}`);
throw new Error(`Doc ${this.directData.name} already has prop ${item.directData.name}`);
}
this.props.set(item.name, item);
this.props.set(item.directData.name, item);
} else if (item instanceof DocumentedEvent) {
if (this.props.get(item.directData.name)) {
throw new Error(`Doc ${this.directData.name} already has event ${item.name}`);
if (this.events.get(item.directData.name)) {
throw new Error(`Doc ${this.directData.name} already has event ${item.directData.name}`);
}
this.events.set(item.name, item);
this.events.set(item.directData.name, item);
}
}

View File

@@ -52,10 +52,6 @@ class WebSocketManager {
* @returns {null}
*/
connect(gateway) {
/**
* The status of the Client's connection, a type of Constants.Status
* @type {Number}
*/
this.status = Constants.Status.CONNECTING;
/**
* The WebSocket connection to the gateway