@strapi/typescript-utils
Version:
Typescript support for Strapi
18 lines (13 loc) • 429 B
JavaScript
;
const fse = require('fs-extra');
const getConfigPath = require('./get-config-path');
/**
* Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)
* @param {string} dir
* @param {string | undefined} filename
* @returns {Promise<boolean>}
*/
module.exports = (dir, filename = undefined) => {
const filePath = getConfigPath(dir, { filename });
return fse.pathExists(filePath);
};