@backtest/framework
Version:
Backtesting trading strategies in TypeScript / JavaScript
16 lines • 742 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteResult = deleteResult;
const prisma_results_1 = require("../../helpers/prisma-results");
const error_1 = require("../../helpers/error");
async function deleteResult(resultsName) {
if (!resultsName) {
throw new error_1.BacktestError('Results name is required', error_1.ErrorCode.MissingInput);
}
const allResults = await (0, prisma_results_1.getAllStrategyResultNames)();
if (!allResults.includes(resultsName)) {
throw new error_1.BacktestError(`Results ${resultsName} not found`, error_1.ErrorCode.NotFound);
}
return (0, prisma_results_1.deleteStrategyResult)(resultsName);
}
//# sourceMappingURL=remove.js.map