The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/apps-engine/deno-runtime/lib/sanitizeDeprecatedUsage.ts

20 lines
569 B

import { fixBrokenSynchronousAPICalls } from './ast/mod.ts';
function hasPotentialDeprecatedUsage(source: string) {
return (
// potential usage of Room.usernames getter
source.includes('.usernames') ||
// potential usage of LivechatRead.isOnline method
source.includes('.isOnline(') ||
// potential usage of LivechatCreator.createToken method
source.includes('.createToken(')
);
}
export function sanitizeDeprecatedUsage(source: string) {
if (!hasPotentialDeprecatedUsage(source)) {
return source;
}
return fixBrokenSynchronousAPICalls(source);
}