2013-06-25 06:43:15 -05:00
|
|
|
var when = require('when');
|
2013-06-15 15:52:03 -05:00
|
|
|
|
2013-06-25 06:43:15 -05:00
|
|
|
module.exports = function (version, data) {
|
|
|
|
var importer;
|
2013-06-15 15:52:03 -05:00
|
|
|
|
2013-06-25 06:43:15 -05:00
|
|
|
try {
|
2013-09-24 05:46:30 -05:00
|
|
|
importer = require('./' + version);
|
2013-06-25 06:43:15 -05:00
|
|
|
} catch (ignore) {
|
|
|
|
// Zero effs given
|
|
|
|
}
|
2013-06-15 15:52:03 -05:00
|
|
|
|
2013-06-25 06:43:15 -05:00
|
|
|
if (!importer) {
|
|
|
|
return when.reject("No importer found");
|
|
|
|
}
|
2013-06-15 15:52:03 -05:00
|
|
|
|
2013-09-18 17:24:26 -05:00
|
|
|
return importer.importData(data);
|
2013-06-25 06:43:15 -05:00
|
|
|
};
|