Skip to content

Commit

Permalink
Fix Merge*ObjectsArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Aug 1, 2022
1 parent 47fbac4 commit 5aa4bf5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"{}": false
}
}
],
"@typescript-eslint/no-this-alias": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "everscale-inpage-provider",
"version": "0.3.29",
"version": "0.3.30",
"description": "Web3-like interface to the Everscale blockchain",
"repository": "https://github.com/broxus/everscale-inpage-provider",
"main": "dist/index.js",
Expand Down
1 change: 0 additions & 1 deletion src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
DecodedAbiFunctionInputs,
DecodedAbiEventData,
TransactionId,
DelayedMessage,
serializeTokensObject,
parseTransaction,
parseTokensObject,
Expand Down
4 changes: 2 additions & 2 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,15 +543,15 @@ export type OutputTokenObject<O> = O extends { name: infer K, type: infer T, com
export type MergeInputObjectsArray<A> =
A extends readonly [infer T, ...infer Ts]
? (InputTokenObject<T> & MergeInputObjectsArray<[...Ts]>)
: A extends readonly [infer T] ? InputTokenObject<T> : A extends readonly [] ? Record<string, never> : never;
: A extends readonly [infer T] ? InputTokenObject<T> : A extends readonly [] ? {} : never;

/**
* @category Models
*/
export type MergeOutputObjectsArray<A> =
A extends readonly [infer T, ...infer Ts]
? (OutputTokenObject<T> & MergeOutputObjectsArray<[...Ts]>)
: A extends readonly [infer T] ? OutputTokenObject<T> : A extends readonly [] ? Record<string, never> : never;
: A extends readonly [infer T] ? OutputTokenObject<T> : A extends readonly [] ? {} : never;

type AbiFunction<C> = C extends { functions: infer F } ? F extends readonly unknown[] ? ArrayItemType<F> : never : never;
type AbiEvent<C> = C extends { events: infer E } ? E extends readonly unknown[] ? ArrayItemType<E> : never : never;
Expand Down
2 changes: 1 addition & 1 deletion src/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export type Delayed<P, T, F extends boolean> = {
} & (F extends true ? {
fold: MakeDelayedPromise<Stream<P, T, F>['fold']>,
finished: MakeDelayedPromise<Stream<P, T, F>['finished']>,
} : Record<string, never>);
} : {});

/**
* @category Stream
Expand Down

0 comments on commit 5aa4bf5

Please sign in to comment.