Innovenergy_trunk/frontend/node_modules/testcafe/lib/browser/provider/parse-provider-name.js

18 lines
2.3 KiB
JavaScript
Raw Permalink Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BROWSER_PROVIDER_NAME_RE = /^(@(?:[^/]+)\/)?(.+)$/;
const BROWSER_PROVIDER_MODULE_NAME_PREFIX = 'testcafe-browser-provider-';
function default_1(providerName) {
let [, scope, name] = BROWSER_PROVIDER_NAME_RE.exec(providerName);
if (!scope)
scope = '';
if (name.indexOf(BROWSER_PROVIDER_MODULE_NAME_PREFIX) === 0)
name = name.replace(BROWSER_PROVIDER_MODULE_NAME_PREFIX, '');
return {
providerName: scope + name,
moduleName: scope + BROWSER_PROVIDER_MODULE_NAME_PREFIX + name,
};
}
exports.default = default_1;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyc2UtcHJvdmlkZXItbmFtZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9icm93c2VyL3Byb3ZpZGVyL3BhcnNlLXByb3ZpZGVyLW5hbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLHdCQUF3QixHQUFjLHVCQUF1QixDQUFDO0FBQ3BFLE1BQU0sbUNBQW1DLEdBQUcsNEJBQTRCLENBQUM7QUFHekUsbUJBQXlCLFlBQVk7SUFDakMsSUFBSSxDQUFFLEFBQUQsRUFBRyxLQUFLLEVBQUUsSUFBSSxDQUFFLEdBQUcsd0JBQXdCLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxDQUFDO0lBRXBFLElBQUksQ0FBQyxLQUFLO1FBQ04sS0FBSyxHQUFHLEVBQUUsQ0FBQztJQUVmLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxtQ0FBbUMsQ0FBQyxLQUFLLENBQUM7UUFDdkQsSUFBSSxHQUFHLElBQUksQ0FBQy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