CartoDB-SQL-API/lib/models/formats/index.js
Daniel García Aubert fddc76b542 Eslint errors
2019-12-26 18:01:38 +01:00

24 lines
553 B
JavaScript

'use strict';
var fs = require('fs');
const path = require('path');
var formats = {};
function formatFilesWithPath (dir) {
var formatDir = path.join(__dirname, dir);
return fs.readdirSync(formatDir).map(function (formatFile) {
return path.join(formatDir, formatFile);
});
}
var formatFilesPaths = []
.concat(formatFilesWithPath('ogr'))
.concat(formatFilesWithPath('pg'));
formatFilesPaths.forEach(function (file) {
var format = require(file);
formats[format.prototype.id] = format;
});
module.exports = formats;