Bump dev (w/ ts-eslint updates) (#5691)
This commit is contained in:
@@ -10,9 +10,7 @@ import { mapToTypeMap, typesToMap } from '../utils/index.js';
|
||||
import { Null } from './Null.js';
|
||||
|
||||
// export interface, this is used in Enum.with, so required as public by TS
|
||||
export interface EnumCodecClass<T = Codec> {
|
||||
new(registry: Registry, value?: any, index?: number): T;
|
||||
}
|
||||
export type EnumCodecClass<T = Codec> = new(registry: Registry, value?: any, index?: number) => T;
|
||||
|
||||
interface Definition {
|
||||
def: TypesDef;
|
||||
@@ -90,7 +88,7 @@ function extractDef (registry: Registry, _def: Record<string, string | CodecClas
|
||||
function getEntryType (def: TypesDef, checkIdx: number): CodecClass {
|
||||
const values = Object.values(def);
|
||||
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
for (let i = 0, count = values.length; i < count; i++) {
|
||||
const { Type, index } = values[i];
|
||||
|
||||
if (index === checkIdx) {
|
||||
|
||||
@@ -10,9 +10,7 @@ import { decodeU8a, mapToTypeMap, typesToConstructors, typeToConstructor } from
|
||||
|
||||
type TupleType = (CodecClass | string);
|
||||
|
||||
type TupleTypes = TupleType[] | {
|
||||
[index: string]: CodecClass | string;
|
||||
};
|
||||
type TupleTypes = TupleType[] | Record<string, CodecClass | string>;
|
||||
|
||||
type Definition = [CodecClass[], string[]];
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ describe('Vec', (): void => {
|
||||
});
|
||||
|
||||
it('exposes a working forEach', (): void => {
|
||||
const result: { [index: number]: string } = {};
|
||||
const result: Record<number, string> = {};
|
||||
|
||||
vector.forEach((e, i): void => {
|
||||
result[i] = e.toString();
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Raw } from '../native/Raw.js';
|
||||
|
||||
/** @internal */
|
||||
function decodeBitVecU8a (value?: Uint8Array): [number, Uint8Array] {
|
||||
if (!value || !value.length) {
|
||||
if (!value?.length) {
|
||||
return [0, new Uint8Array()];
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export class OptionBool extends Option<Bool> {
|
||||
* @description The length of the value when encoded as a Uint8Array
|
||||
*/
|
||||
public override get encodedLength (): number {
|
||||
return 1;
|
||||
return 1 | 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ export class bool extends Boolean implements Codec {
|
||||
* @description The length of the value when encoded as a Uint8Array
|
||||
*/
|
||||
public get encodedLength (): number {
|
||||
return 1;
|
||||
return 1 | 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,7 +42,7 @@ export class Json extends Map<string, any> implements Codec {
|
||||
* @description Always 0, never encodes as a Uint8Array
|
||||
*/
|
||||
public get encodedLength (): number {
|
||||
return 0;
|
||||
return 0 | 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -225,7 +225,7 @@ export class Struct<
|
||||
/**
|
||||
* @description Returns the a types value by name
|
||||
*/
|
||||
public getT <T> (key: string): T {
|
||||
public getT <T = Codec> (key: string): T {
|
||||
return super.get(key) as unknown as T;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user