Comparing version 0.9.0-canary.20230609T231621 to 0.9.0-canary.20230612T180914
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CircularReferenceError = exports.InvalidParenthesisError = exports.UnknownSignatureError = exports.InvalidSignatureError = exports.InvalidStructSignatureError = exports.InvalidAbiParameterError = exports.InvalidAbiParametersError = exports.InvalidParameterError = exports.SolidityProtectedKeywordError = exports.InvalidModifierError = exports.InvalidFunctionModifierError = exports.InvalidAbiTypeParameterError = exports.UnknownSolidityTypeError = exports.InvalidAbiItemError = exports.UnknownTypeError = exports.parseAbiParameters = exports.parseAbiParameter = exports.parseAbiItem = exports.parseAbi = exports.narrow = exports.BaseError = void 0; | ||
exports.CircularReferenceError = exports.InvalidParenthesisError = exports.UnknownSignatureError = exports.InvalidSignatureError = exports.InvalidStructSignatureError = exports.InvalidAbiParameterError = exports.InvalidAbiParametersError = exports.InvalidParameterError = exports.SolidityProtectedKeywordError = exports.InvalidModifierError = exports.InvalidFunctionModifierError = exports.InvalidAbiTypeParameterError = exports.UnknownSolidityTypeError = exports.InvalidAbiItemError = exports.UnknownTypeError = exports.parseAbiParameters = exports.parseAbiParameter = exports.parseAbiItem = exports.parseAbi = exports.formatAbiParameters = exports.formatAbiParameter = exports.formatAbiItem = exports.formatAbi = exports.narrow = exports.BaseError = void 0; | ||
var errors_js_1 = require("./errors.js"); | ||
@@ -8,2 +8,10 @@ Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return errors_js_1.BaseError; } }); | ||
Object.defineProperty(exports, "narrow", { enumerable: true, get: function () { return narrow_js_1.narrow; } }); | ||
var formatAbi_js_1 = require("./human-readable/formatAbi.js"); | ||
Object.defineProperty(exports, "formatAbi", { enumerable: true, get: function () { return formatAbi_js_1.formatAbi; } }); | ||
var formatAbiItem_js_1 = require("./human-readable/formatAbiItem.js"); | ||
Object.defineProperty(exports, "formatAbiItem", { enumerable: true, get: function () { return formatAbiItem_js_1.formatAbiItem; } }); | ||
var formatAbiParameter_js_1 = require("./human-readable/formatAbiParameter.js"); | ||
Object.defineProperty(exports, "formatAbiParameter", { enumerable: true, get: function () { return formatAbiParameter_js_1.formatAbiParameter; } }); | ||
var formatAbiParameters_js_1 = require("./human-readable/formatAbiParameters.js"); | ||
Object.defineProperty(exports, "formatAbiParameters", { enumerable: true, get: function () { return formatAbiParameters_js_1.formatAbiParameters; } }); | ||
var parseAbi_js_1 = require("./human-readable/parseAbi.js"); | ||
@@ -10,0 +18,0 @@ Object.defineProperty(exports, "parseAbi", { enumerable: true, get: function () { return parseAbi_js_1.parseAbi; } }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '0.9.0-canary.20230609T231621'; | ||
exports.version = '0.9.0-canary.20230612T180914'; | ||
//# sourceMappingURL=version.js.map |
export { BaseError } from './errors.js'; | ||
export { narrow } from './narrow.js'; | ||
export { formatAbi, } from './human-readable/formatAbi.js'; | ||
export { formatAbiItem, } from './human-readable/formatAbiItem.js'; | ||
export { formatAbiParameter, } from './human-readable/formatAbiParameter.js'; | ||
export { formatAbiParameters, } from './human-readable/formatAbiParameters.js'; | ||
export { parseAbi } from './human-readable/parseAbi.js'; | ||
@@ -4,0 +8,0 @@ export { parseAbiItem, } from './human-readable/parseAbiItem.js'; |
@@ -1,2 +0,2 @@ | ||
export const version = '0.9.0-canary.20230609T231621'; | ||
export const version = '0.9.0-canary.20230612T180914'; | ||
//# sourceMappingURL=version.js.map |
@@ -7,2 +7,6 @@ export type { Abi, AbiConstructor, AbiError, AbiEvent, AbiEventParameter, AbiFallback, AbiFunction, AbiInternalType, AbiItemType, AbiParameter, AbiParameterKind, AbiReceive, AbiStateMutability, AbiType, Address, SolidityAddress, SolidityArray, SolidityArrayWithoutTuple, SolidityArrayWithTuple, SolidityBool, SolidityBytes, SolidityFixedArrayRange, SolidityFixedArraySizeLookup, SolidityFunction, SolidityInt, SolidityString, SolidityTuple, TypedData, TypedDataDomain, TypedDataParameter, TypedDataType, } from './abi.js'; | ||
export type { AbiParameterToPrimitiveType, AbiParametersToPrimitiveTypes, AbiTypeToPrimitiveType, ExtractAbiError, ExtractAbiErrorNames, ExtractAbiErrors, ExtractAbiEvent, ExtractAbiEventNames, ExtractAbiEvents, ExtractAbiFunction, ExtractAbiFunctionNames, ExtractAbiFunctions, IsAbi, IsTypedData, TypedDataToPrimitiveTypes, } from './utils.js'; | ||
export { formatAbi, type FormatAbi, } from './human-readable/formatAbi.js'; | ||
export { formatAbiItem, type FormatAbiItem, } from './human-readable/formatAbiItem.js'; | ||
export { formatAbiParameter, type FormatAbiParameter, } from './human-readable/formatAbiParameter.js'; | ||
export { formatAbiParameters, type FormatAbiParameters, } from './human-readable/formatAbiParameters.js'; | ||
export { parseAbi, type ParseAbi } from './human-readable/parseAbi.js'; | ||
@@ -9,0 +13,0 @@ export { parseAbiItem, type ParseAbiItem, } from './human-readable/parseAbiItem.js'; |
@@ -29,2 +29,23 @@ /** | ||
/** | ||
* Checks if {@link T} can be narrowed further than {@link U} | ||
* | ||
* @param T - Type to check | ||
* @param U - Type to against | ||
* | ||
* @example | ||
* type Result = IsNarrowable<'foo', string> | ||
* // ^? true | ||
*/ | ||
export type IsNarrowable<T, U> = IsNever<(T extends U ? true : false) & (U extends T ? false : true)> extends true ? false : true; | ||
/** | ||
* Checks if {@link T} is `never` | ||
* | ||
* @param T - Type to check | ||
* | ||
* @example | ||
* type Result = IsNever<never> | ||
* // ^? type Result = true | ||
*/ | ||
export type IsNever<T> = [T] extends [never] ? true : false; | ||
/** | ||
* Checks if {@link T} is `unknown` | ||
@@ -41,2 +62,14 @@ * | ||
/** | ||
* Joins array into string | ||
* | ||
* @param T - Array to join | ||
* @param U - Separator | ||
* @returns string | ||
* | ||
* @example | ||
* type Result = Join<['a', 'b', 'c'], '-'> | ||
* // ^? type Result = 'a-b-c' | ||
*/ | ||
export type Join<T extends readonly unknown[], U extends string | number> = T extends readonly [infer F, ...infer R] ? R['length'] extends 0 ? `${F & string}` : `${F & string}${U}${Join<R, U>}` : never; | ||
/** | ||
* Merges two object types into new type | ||
@@ -43,0 +76,0 @@ * |
@@ -1,2 +0,2 @@ | ||
export declare const version = "0.9.0-canary.20230609T231621"; | ||
export declare const version = "0.9.0-canary.20230612T180914"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "0.9.0-canary.20230609T231621", | ||
"version": "0.9.0-canary.20230612T180914", | ||
"files": [ | ||
@@ -16,0 +16,0 @@ "dist", |
@@ -63,2 +63,22 @@ export type { | ||
export { | ||
formatAbi, | ||
type FormatAbi, | ||
} from './human-readable/formatAbi.js' | ||
export { | ||
formatAbiItem, | ||
type FormatAbiItem, | ||
} from './human-readable/formatAbiItem.js' | ||
export { | ||
formatAbiParameter, | ||
type FormatAbiParameter, | ||
} from './human-readable/formatAbiParameter.js' | ||
export { | ||
formatAbiParameters, | ||
type FormatAbiParameters, | ||
} from './human-readable/formatAbiParameters.js' | ||
export { parseAbi, type ParseAbi } from './human-readable/parseAbi.js' | ||
@@ -65,0 +85,0 @@ |
@@ -44,2 +44,29 @@ /** | ||
/** | ||
* Checks if {@link T} can be narrowed further than {@link U} | ||
* | ||
* @param T - Type to check | ||
* @param U - Type to against | ||
* | ||
* @example | ||
* type Result = IsNarrowable<'foo', string> | ||
* // ^? true | ||
*/ | ||
export type IsNarrowable<T, U> = IsNever< | ||
(T extends U ? true : false) & (U extends T ? false : true) | ||
> extends true | ||
? false | ||
: true | ||
/** | ||
* Checks if {@link T} is `never` | ||
* | ||
* @param T - Type to check | ||
* | ||
* @example | ||
* type Result = IsNever<never> | ||
* // ^? type Result = true | ||
*/ | ||
export type IsNever<T> = [T] extends [never] ? true : false | ||
/** | ||
* Checks if {@link T} is `unknown` | ||
@@ -57,2 +84,22 @@ * | ||
/** | ||
* Joins array into string | ||
* | ||
* @param T - Array to join | ||
* @param U - Separator | ||
* @returns string | ||
* | ||
* @example | ||
* type Result = Join<['a', 'b', 'c'], '-'> | ||
* // ^? type Result = 'a-b-c' | ||
*/ | ||
export type Join< | ||
T extends readonly unknown[], | ||
U extends string | number, | ||
> = T extends readonly [infer F, ...infer R] | ||
? R['length'] extends 0 | ||
? `${F & string}` | ||
: `${F & string}${U}${Join<R, U>}` | ||
: never | ||
/** | ||
* Merges two object types into new type | ||
@@ -59,0 +106,0 @@ * |
@@ -1,1 +0,1 @@ | ||
export const version = '0.9.0-canary.20230609T231621' | ||
export const version = '0.9.0-canary.20230612T180914' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1135454
243
23510