strapi-ts
Version:
An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite
16 lines (13 loc) • 371 B
JavaScript
;
const path = require('path');
const { templateConfiguration } = require('strapi-utils');
/**
* Requires a file and eval expression if it is a json
* @param {string} filePath - file path
*/
module.exports = filePath => {
if (path.extname(filePath) === '.json') {
return templateConfiguration(require(filePath));
}
return require(filePath);
};