UNPKG

@strapi/typescript-utils

Version:

Typescript support for Strapi

18 lines (13 loc) 424 B
'use strict'; 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 {boolean} */ module.exports = (dir, filename = undefined) => { const filePath = getConfigPath(dir, { filename }); return fse.pathExistsSync(filePath); };