Skip to content

Commit b5a2307

Browse files
committed
fix: first commit
1 parent e18f275 commit b5a2307

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/core/src/vcdm/Revision.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Txt } from './Txt';
2-
import { Hex } from './Hex';
31
import { InvalidDataType } from '@vechain/sdk-errors';
2+
import { Hex } from './Hex';
43
import { HexUInt } from './HexUInt';
4+
import { Txt } from './Txt';
55

66
/**
77
* Represents a revision for a Thor transaction or block.
@@ -62,10 +62,14 @@ class Revision extends Txt {
6262
let txt: string;
6363
if (value instanceof Hex) {
6464
txt = value.bi.toString();
65-
} else if (value instanceof Uint8Array) {
66-
txt = Txt.of(value).toString();
67-
} else {
65+
} else if (
66+
typeof value === 'bigint' ||
67+
typeof value === 'number' ||
68+
typeof value === 'string'
69+
) {
6870
txt = `${value}`;
71+
} else {
72+
txt = Txt.of(value).toString();
6973
}
7074
if (Revision.isValid(txt)) {
7175
return new Revision(txt);

0 commit comments

Comments
 (0)