@openreplay/tracker-assist
Version:
Tracker plugin for screen assistance through the WebRTC
28 lines (27 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DOCS_HOST = void 0;
exports.deprecationWarn = deprecationWarn;
exports.hasOpenreplayAttribute = hasOpenreplayAttribute;
exports.DOCS_HOST = 'https://docs.openreplay.com';
const warnedFeatures = {};
function deprecationWarn(nameOfFeature, useInstead, docsPath = '/') {
if (warnedFeatures[nameOfFeature]) {
return;
}
console.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ''} Visit ${exports.DOCS_HOST}${docsPath} for more information.`);
warnedFeatures[nameOfFeature] = true;
}
function hasOpenreplayAttribute(e, attr) {
const newName = `data-openreplay-${attr}`;
if (e.hasAttribute(newName)) {
// @ts-ignore
if (DEPRECATED_ATTRS[attr]) {
deprecationWarn(`"${newName}" attribute`,
// @ts-ignore
`"${DEPRECATED_ATTRS[attr]}" attribute`, '/en/sdk/sanitize-data');
}
return true;
}
return false;
}