@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
25 lines • 909 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __importDefault(require("../../command"));
class ListForwardsCommand extends command_1.default {
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 };
});
}
}
exports.default = ListForwardsCommand;
//# sourceMappingURL=listforwards.js.map