Comparing version 0.1.3 to 0.1.4
@@ -5,3 +5,3 @@ /** | ||
* @param T - Type to check | ||
* @returns `true` if `T` is `unknown`, otherwise `false` | ||
* @returns `true` if {@link T} is `unknown`, otherwise `false` | ||
* | ||
@@ -17,2 +17,3 @@ * @example | ||
* @param Object2 - Object to merge and override keys from {@link Object1} | ||
* @returns New object type with keys from {@link Object1} and {@link Object2}. If a key exists in both {@link Object1} and {@link Object2}, the key from {@link Object2} will be used. | ||
* | ||
@@ -19,0 +20,0 @@ * @example |
@@ -193,6 +193,6 @@ import { Abi, AbiParameter, AbiStateMutability, AbiType, MBits, SolidityAddress, SolidityArray, SolidityBool, SolidityBytes, SolidityFixedArrayRange, SolidityFixedArraySizeLookup, SolidityFunction, SolidityInt, SolidityString, SolidityTuple, TypedData, TypedDataParameter, TypedDataType } from './abi'; | ||
[K in keyof TTypedData]: { | ||
[K2 in TTypedData[K][number] as K2['name']]: K2['type'] extends keyof TTypedData ? TypedDataToPrimitiveTypes<Exclude<TTypedData, K>>[K2['type']] : K2['type'] extends `${infer TType extends keyof TTypedData & string}[${infer Tail}]` ? AbiParameterToPrimitiveType<Merge<K2, { | ||
[K2 in TTypedData[K][number] as K2['name']]: K2['type'] extends K ? `Error: Cannot convert self-referencing struct '${K2['type']}' to primitive type.` : K2['type'] extends keyof TTypedData ? TypedDataToPrimitiveTypes<Exclude<TTypedData, K>>[K2['type']] : K2['type'] extends `${infer TType extends keyof TTypedData & string}[${infer Tail}]` ? AbiParameterToPrimitiveType<Merge<K2, { | ||
type: `tuple[${Tail}]`; | ||
components: _TypedDataParametersToAbiParameters<TTypedData[TType], TTypedData>; | ||
}>> : AbiParameterToPrimitiveType<K2>; | ||
}>> : K2['type'] extends TypedDataType ? AbiParameterToPrimitiveType<K2> : `Error: Cannot convert unknown type '${K2['type']}' to primitive type.`; | ||
}; | ||
@@ -205,3 +205,3 @@ }; | ||
} ? TTypedDataParameter['type'] extends keyof TTypedData ? Merge<TTypedDataParameter, { | ||
type: `tuple`; | ||
type: 'tuple'; | ||
components: _TypedDataParametersToAbiParameters<TTypedData[TTypedDataParameter['type']], TTypedData>; | ||
@@ -208,0 +208,0 @@ }> : TTypedDataParameter['type'] extends `${infer TType extends keyof TTypedData & string}[${infer Tail}]` ? Merge<TTypedDataParameter, { |
@@ -5,3 +5,3 @@ { | ||
"license": "WAGMIT", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -16,3 +16,3 @@ # ABIType | ||
Works great for adding blazing fast [autocomplete](https://twitter.com/awkweb/status/1555678944770367493) and type checking to functions, variables, or your own types ([see examples](/src/examples.ts)). No need to generate types with third-party tools – just use your ABI and let TypeScript do the rest! | ||
Works great for adding blazing fast [autocomplete](https://twitter.com/awkweb/status/1555678944770367493) and type checking to functions, variables, or your own types ([see examples](/src/examples/examples.ts)). No need to generate types with third-party tools – just use your ABI and let TypeScript do the rest! | ||
@@ -19,0 +19,0 @@ ## Installation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34382
454