@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
19 lines • 638 B
JavaScript
import Command from '../../command.js';
export default class ListForwardsCommand extends Command {
async execute(serial) {
await this._send(`host-serial:${serial}:list-forward`);
await this.readOKAY();
const value = await this.parser.readValue('utf8');
return this._parseForwards(value);
}
_parseForwards(value) {
return value
.split('\n')
.filter((e) => e)
.map((forward) => {
const [serial, local, remote] = forward.split(/\s+/);
return { serial, local, remote };
});
}
}
//# sourceMappingURL=listforwards.js.map