"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TargetFile = exports.SourceFile = void 0;
const path_type_1 = require("path-type");
// const { isDirectorySync } = require('path-type');
class SourceFile {
    // private _targetPath: string;
    // private _sourceCode: string;
    constructor(originalName, fullPath) {
        this._originalName = originalName;
        this._fullPath = fullPath;
    }
    isDirectory() {
        return path_type_1.isDirectorySync(this._fullPath);
    }
    get originalName() {
        return this._originalName.substring(0, this._originalName.lastIndexOf('.'));
    }
    get prefixName() {
        let nameList = this.originalName.split('-');
        if (nameList.length > 2) {
            return this.originalName.split('-').slice(0, 2).join('-');
        }
        else {
            return this.originalName.split('-').slice(0, 1).join('-');
        }
    }
    get lastName() {
        let nameList = this.originalName.split('-');
        if (nameList.length > 2) {
            return this.originalName.split('-').slice(2).join('-');
        }
        else {
            return this.originalName.split('-').slice(1).join('-');
        }
    }
    get filePath() {
        return this._fullPath;
    }
    isTestFile() {
        let ext = this._fullPath.substring(this._fullPath.lastIndexOf('.'));
        this.ext = ext;
        return ext === '.html' || ext === '.xht' || ext === '.htm';
    }
}
exports.SourceFile = SourceFile;
class TargetFile {
    constructor(name, filePath) {
        this.fileName = name;
        this.filePath = filePath;
    }
}
exports.TargetFile = TargetFile;
