Innovenergy_trunk/frontend/node_modules/testcafe-hammerhead/lib/utils/get-asset-path.js

19 lines
841 B
JavaScript

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const get_client_script_suffix_1 = __importDefault(require("./get-client-script-suffix"));
function default_1(originPath, developmentMode) {
if (!developmentMode)
return originPath;
const filename = (0, path_1.basename)(originPath);
const otherPathPart = originPath.replace(filename, '');
const filenameParts = filename.split('.');
const resultFilename = `${filenameParts[0]}${(0, get_client_script_suffix_1.default)(developmentMode)}.${filenameParts[1]}`;
return otherPathPart + resultFilename;
}
exports.default = default_1;module.exports = exports.default;