File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
- import { Txt } from './Txt' ;
2
- import { Hex } from './Hex' ;
3
1
import { InvalidDataType } from '@vechain/sdk-errors' ;
2
+ import { Hex } from './Hex' ;
4
3
import { HexUInt } from './HexUInt' ;
4
+ import { Txt } from './Txt' ;
5
5
6
6
/**
7
7
* Represents a revision for a Thor transaction or block.
@@ -62,10 +62,14 @@ class Revision extends Txt {
62
62
let txt : string ;
63
63
if ( value instanceof Hex ) {
64
64
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
+ ) {
68
70
txt = `${ value } ` ;
71
+ } else {
72
+ txt = Txt . of ( value ) . toString ( ) ;
69
73
}
70
74
if ( Revision . isValid ( txt ) ) {
71
75
return new Revision ( txt ) ;
You can’t perform that action at this time.
0 commit comments