mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-06 02:24:25 +00:00
perf[ts]: suppress warning of typescript long.ts
This commit is contained in:
@@ -691,11 +691,8 @@ export class Long {
|
||||
if ((numBits &= 63) === 0) {
|
||||
return this;
|
||||
} else if (numBits < 32) {
|
||||
return Long.fromBits(
|
||||
this.low << numBits,
|
||||
(this.high << numBits) | (this.low >>> (32 - numBits)),
|
||||
this.unsigned
|
||||
);
|
||||
const lowNum: number = this.low << numBits;
|
||||
return Long.fromBits(lowNum, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
|
||||
} else {
|
||||
return Long.fromBits(0, this.low << (numBits - 32), this.unsigned);
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ class Longbits {
|
||||
/**
|
||||
* Constructs new long bits from the specified number.
|
||||
*/
|
||||
static from(value) {
|
||||
static from(value: any) {
|
||||
if (typeof value === 'number') {
|
||||
return Longbits.fromNumber(value);
|
||||
return Longbits.fromNumber(value as number);
|
||||
}
|
||||
if (typeof value === 'string' || value instanceof String) {
|
||||
value = Long.fromString(value);
|
||||
value = Long.fromString(value as string);
|
||||
}
|
||||
return value.low || value.high ? new Longbits(value.low >>> 0, value.high >>> 0) : zero;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class Longbits {
|
||||
/**
|
||||
* Constructs new long bits from the specified number.
|
||||
*/
|
||||
static fromNumber(value): Longbits {
|
||||
static fromNumber(value: number): Longbits {
|
||||
if (value === 0) {
|
||||
return zero;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user