import { Helpers } from 'tnp-core/lib';
export function codeCuttFn(cutIftrue) {
    return function (expression, reservedExpOne, reservedExpSec) {
        const exp = `(function(ENV,relativeOrAbsFilePath){
        return ${expression.trim()};
      })(reservedExpOne,reservedExpSec)`;
        try {
            return eval(exp);
        }
        catch (error) {
            const errMsg = (error instanceof Error && error.message) || String(error);
            Helpers.log(`Expression Failed ${errMsg}`);
            Helpers.error(`[codecutFn] Eval failed `, true, true);
            return null;
        }
    };
}
//# sourceMappingURL=cut-fn.js.map