-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
26 lines (20 loc) · 938 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
/** @ignore */
let utils = require('./lib/utils');
module.exports.EmbedEngine = require('./lib/classes/EmbedEngine');
module.exports.URLEmbedProvider = require('./lib/classes/URLEmbedProvider');
module.exports.OEmbedProvider = require('./lib/classes/OEmbedProvider');
module.exports.Embed = require('./lib/classes/Embed');
module.exports.defaultProviderClasses = {};
module.exports.errorClasses = {};
let providerList = utils.loadClassesFromDirectory(__dirname + '/lib/classes/default_providers');
for (let i = 0; i < providerList.length; i++) {
let Provider = providerList[i];
module.exports.defaultProviderClasses[Provider.name] = Provider;
}
let errorList = utils.loadClassesFromDirectory(__dirname + '/lib/classes/errors');
for (let i = 0; i < errorList.length; i++) {
let ErrorClass = errorList[i];
let errorInstance = new ErrorClass();
module.exports.errorClasses[typeof errorInstance] = ErrorClass;
}