@openreplay/tracker-assist
Version:
Tracker plugin for screen assistance through the WebRTC
23 lines (22 loc) • 851 B
JavaScript
export const DOCS_HOST = 'https://docs.openreplay.com';
const warnedFeatures = {};
export function deprecationWarn(nameOfFeature, useInstead, docsPath = '/') {
if (warnedFeatures[nameOfFeature]) {
return;
}
console.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ''} Visit ${DOCS_HOST}${docsPath} for more information.`);
warnedFeatures[nameOfFeature] = true;
}
export 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;
}