"use strict";
/*
 * @poppinss/utils
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isScriptFile = void 0;
const path_1 = require("path");
const JS_MODULES = ['.js', '.json'];
/**
 * Returns `true` when file ends with `.js`, `.json` or
 * `.ts` but not `.d.ts`.
 */
function isScriptFile(file) {
    const ext = (0, path_1.extname)(file);
    if (JS_MODULES.includes(ext)) {
        return true;
    }
    if (ext === '.ts' && !file.endsWith('.d.ts')) {
        return true;
    }
    return false;
}
exports.isScriptFile = isScriptFile;
