important build stuff (#1663)

This commit is contained in:
Gus Caplan
2017-07-08 00:16:46 -05:00
committed by Crawl
parent 116fcbd54e
commit 4e5556ba09
2 changed files with 28 additions and 25 deletions

View File

@@ -18,7 +18,7 @@ module.exports = {
SnowflakeUtil: require('./util/Snowflake'), SnowflakeUtil: require('./util/Snowflake'),
Util: Util, Util: Util,
util: Util, util: Util,
version: require('../package').version, version: require('../package.json').version,
// Shortcuts to Util methods // Shortcuts to Util methods
escapeMarkdown: Util.escapeMarkdown, escapeMarkdown: Util.escapeMarkdown,

View File

@@ -383,9 +383,8 @@ class TextBasedChannel {
this.messages.set(message.id, message); this.messages.set(message.id, message);
return message; return message;
} }
}
exports.applyToClass = (structure, full = false, ignore = []) => { static applyToClass(structure, full = false, ignore = []) {
const props = ['send']; const props = ['send'];
if (full) { if (full) {
props.push( props.push(
@@ -406,6 +405,10 @@ exports.applyToClass = (structure, full = false, ignore = []) => {
} }
for (const prop of props) { for (const prop of props) {
if (ignore.includes(prop)) continue; if (ignore.includes(prop)) continue;
Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop)); Object.defineProperty(structure.prototype, prop,
Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop));
} }
}; }
}
module.exports = TextBasedChannel;