Skip to content

Commit

Permalink
single quote and fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Jun 7, 2024
1 parent b5ac417 commit dfdf37b
Show file tree
Hide file tree
Showing 246 changed files with 19,426 additions and 19,403 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"quotes": [
"error",
"double",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
Expand Down
2 changes: 0 additions & 2 deletions libs/cosmos-types/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion libs/cosmos-types/amino/amino.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {}
export {};
86 changes: 43 additions & 43 deletions libs/cosmos-types/binary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@
// standalone and requires a support library to be linked with it. This
// support library is itself covered by the above license.

import { utf8Length, utf8Read, utf8Write } from "./utf8";
import { utf8Length, utf8Read, utf8Write } from './utf8';
import {
int64FromString,
int64Length,
int64ToString,
readInt32,
readUInt32,
uInt64ToString,
varint32read,
varint64read,
writeByte,
writeFixed32,
writeVarint32,
writeVarint64,
int64FromString,
int64Length,
writeFixed32,
writeByte,
zzDecode,
zzEncode,
} from "./varint";
} from './varint';

export enum WireType {
Varint = 0,
Expand Down Expand Up @@ -100,7 +100,7 @@ export class BinaryReader implements IBinaryReader {
len: number;

assertBounds(): void {
if (this.pos > this.len) throw new RangeError("premature EOF");
if (this.pos > this.len) throw new RangeError('premature EOF');
}

constructor(buf?: ArrayLike<number>) {
Expand All @@ -116,13 +116,13 @@ export class BinaryReader implements IBinaryReader {
wireType = tag & 7;
if (fieldNo <= 0 || wireType < 0 || wireType > 5)
throw new Error(
"illegal tag: field no " + fieldNo + " wire type " + wireType
'illegal tag: field no ' + fieldNo + ' wire type ' + wireType
);
return [fieldNo, wireType, tag];
}

skip(length?: number) {
if (typeof length === "number") {
if (typeof length === 'number') {
if (this.pos + length > this.len) throw indexOutOfRange(this, length);
this.pos += length;
} else {
Expand All @@ -135,27 +135,27 @@ export class BinaryReader implements IBinaryReader {

skipType(wireType: number) {
switch (wireType) {
case WireType.Varint:
this.skip();
break;
case WireType.Fixed64:
this.skip(8);
break;
case WireType.Bytes:
this.skip(this.uint32());
break;
case 3:
while ((wireType = this.uint32() & 7) !== 4) {
this.skipType(wireType);
}
break;
case WireType.Fixed32:
this.skip(4);
break;
case WireType.Varint:
this.skip();
break;
case WireType.Fixed64:
this.skip(8);
break;
case WireType.Bytes:
this.skip(this.uint32());
break;
case 3:
while ((wireType = this.uint32() & 7) !== 4) {
this.skipType(wireType);
}
break;
case WireType.Fixed32:
this.skip(4);
break;

/* istanbul ignore next */
default:
throw Error("invalid wire type " + wireType + " at offset " + this.pos);
default:
throw Error('invalid wire type ' + wireType + ' at offset ' + this.pos);
}
return this;
}
Expand Down Expand Up @@ -214,11 +214,11 @@ export class BinaryReader implements IBinaryReader {
}

float(): number {
throw new Error("float not supported");
throw new Error('float not supported');
}

double(): number {
throw new Error("double not supported");
throw new Error('double not supported');
}

bool(): boolean {
Expand Down Expand Up @@ -334,7 +334,7 @@ export class BinaryWriter implements IBinaryWriter {
}

static alloc(size: number): Uint8Array | number[] {
if (typeof Uint8Array !== "undefined") {
if (typeof Uint8Array !== 'undefined') {
return pool(
(size) => new Uint8Array(size),
Uint8Array.prototype.subarray
Expand Down Expand Up @@ -410,12 +410,12 @@ export class BinaryWriter implements IBinaryWriter {
(value = value >>> 0) < 128
? 1
: value < 16384
? 2
: value < 2097152
? 3
: value < 268435456
? 4
: 5,
? 2
: value < 2097152
? 3
: value < 268435456
? 4
: 5,
value
)).len;
return this;
Expand Down Expand Up @@ -466,11 +466,11 @@ export class BinaryWriter implements IBinaryWriter {
sfixed32 = BinaryWriter.prototype.fixed32;

float(value: number): BinaryWriter {
throw new Error("float not supported" + value);
throw new Error('float not supported' + value);
}

double(value: number): BinaryWriter {
throw new Error("double not supported" + value);
throw new Error('double not supported' + value);
}

bytes(value: Uint8Array): BinaryWriter {
Expand All @@ -492,7 +492,7 @@ function writeBytes(
buf: Uint8Array | number[],
pos: number
) {
if (typeof Uint8Array !== "undefined") {
if (typeof Uint8Array !== 'undefined') {
(buf as Uint8Array).set(val, pos);
} else {
for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i];
Expand Down Expand Up @@ -524,11 +524,11 @@ function pool(

function indexOutOfRange(reader: BinaryReader, writeLength?: number) {
return RangeError(
"index out of range: " +
'index out of range: ' +
reader.pos +
" + " +
' + ' +
(writeLength || 1) +
" > " +
' > ' +
reader.len
);
}
Loading

0 comments on commit dfdf37b

Please sign in to comment.