mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-02 00:07:56 +01:00
35 lines
787 B
JavaScript
35 lines
787 B
JavaScript
// Copyright 2026 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
export default function transform(babel) {
|
|
const { types: t } = babel;
|
|
|
|
return {
|
|
visitor: {
|
|
TSQualifiedName(path) {
|
|
const { node } = path;
|
|
if (
|
|
node.right.type !== 'Identifier' ||
|
|
!/^I[A-Z][a-z]/.test(node.right.name)
|
|
) {
|
|
return;
|
|
}
|
|
|
|
// Don't touch fuse.js
|
|
if (node.left.type === 'Identifier' && node.left.name === 'Fuse') {
|
|
return;
|
|
}
|
|
|
|
path.replaceWith(
|
|
t.TSQualifiedName(
|
|
t.TSQualifiedName(
|
|
node.left,
|
|
t.Identifier(node.right.name.slice(1))
|
|
),
|
|
t.Identifier('Params')
|
|
)
|
|
);
|
|
},
|
|
},
|
|
};
|
|
}
|