Code polish

This commit is contained in:
David Majdandžić
2023-04-05 19:29:26 +02:00
parent 694124a6b7
commit 42493aab50
9 changed files with 18 additions and 15 deletions

View File

@@ -14,15 +14,6 @@ export default class Job {
this._count = count;
}
static pduParseShortMessage(pdu: PDU) {
if (pdu.short_message && pdu.short_message.type === "Buffer") {
pdu.short_message = Buffer.from(pdu.short_message.data, 'ascii').toString();
}
if (typeof pdu.short_message === "object") {
pdu.short_message = pdu.short_message.toString();
}
}
private _pdu: PDU;
get pdu(): PDU {
@@ -56,6 +47,15 @@ export default class Job {
this.eventEmitter.emit(Job.STATE_CHANGED, {});
}
static pduParseShortMessage(pdu: PDU) {
if (pdu.short_message && pdu.short_message.type === "Buffer") {
pdu.short_message = Buffer.from(pdu.short_message.data, 'ascii').toString();
}
if (typeof pdu.short_message === "object") {
pdu.short_message = pdu.short_message.toString();
}
}
static createEmptySingle(command: string): Job {
let pdu1 = new smpp.PDU(command, {});
Job.pduParseShortMessage(pdu1);