mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 23:49:20 +01:00
Use protopiler for protocol buffers
Co-authored-by: Jamie Kyle <jamie@signal.org>
This commit is contained in:
35
codemods/protopiler-migration/01-remove-finish.js
Normal file
35
codemods/protopiler-migration/01-remove-finish.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2026 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
export default function transform() {
|
||||
return {
|
||||
visitor: {
|
||||
CallExpression(path) {
|
||||
const { node } = path;
|
||||
if (node.arguments.length !== 0) {
|
||||
return;
|
||||
}
|
||||
if (node.callee.type !== 'MemberExpression') {
|
||||
return;
|
||||
}
|
||||
const { object, property } = node.callee;
|
||||
if (object.type !== 'CallExpression') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (property.type !== 'Identifier' || property.name !== 'finish') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
object.callee.type !== 'MemberExpression' ||
|
||||
object.callee.property.type !== 'Identifier' ||
|
||||
object.callee.property.name !== 'encode'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
path.replaceWith(object);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user