const fs = require('fs');
const resolvePath = require('./resolvePath');

module.exports = (filePath, type) => {
    try {
        const content = fs.readFileSync(resolvePath(filePath)).toString();

        return type === 'json' ? JSON.parse(content) : content;
    }
    catch(e) {}
};
