Skip to content

Commit

Permalink
Print defs also in pretty tring mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
lapo-luchini committed Apr 1, 2024
1 parent dc57878 commit cce28c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion asn1.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,16 @@ export class ASN1 {
}
toPrettyString(indent) {
if (indent === undefined) indent = '';
let s = indent + this.typeName() + ' @' + this.stream.pos;
let s = indent;
if (this.def) {
if (this.def.id)
s += this.def.id + ' ';
if (this.def.name && this.def.name != this.typeName().replace(/_/g, ' '))
s+= this.def.name + ' ';
if (this.def.mismatch)
s += '[?] ';
}
s += this.typeName() + ' @' + this.stream.pos;
if (this.length >= 0)
s += '+';
s += this.length;
Expand Down

0 comments on commit cce28c5

Please sign in to comment.