@api3/airnode-abi
Advanced tools
Comparing version 0.10.1 to 0.11.0
@@ -12,5 +12,5 @@ import { ValueOf, TypeTransformation } from './types'; | ||
}; | ||
export declare type ParameterType = ValueOf<typeof PARAMETER_SHORT_TYPES>; | ||
export declare type ParameterTypeShort = keyof typeof PARAMETER_SHORT_TYPES; | ||
export type ParameterType = ValueOf<typeof PARAMETER_SHORT_TYPES>; | ||
export type ParameterTypeShort = keyof typeof PARAMETER_SHORT_TYPES; | ||
export declare const TYPE_TRANSFORMATIONS: TypeTransformation; | ||
//# sourceMappingURL=constants.d.ts.map |
@@ -24,6 +24,6 @@ "use strict"; | ||
if (!transform) { | ||
return Object.assign(Object.assign({}, acc), { [name]: encodedValue }); | ||
return { ...acc, [name]: encodedValue }; | ||
} | ||
const parsedValue = transform(encodedValue); | ||
return Object.assign(Object.assign({}, acc), { [name]: parsedValue }); | ||
return { ...acc, [name]: parsedValue }; | ||
}, {}); | ||
@@ -52,5 +52,4 @@ } | ||
const decodingTypes = fullParameterTypes.reduce((acc, type) => { | ||
var _a; | ||
// Each parameter is expected to have a `bytes32` name | ||
return [...acc, 'bytes32', (_a = constants_1.TYPE_TRANSFORMATIONS[type]) !== null && _a !== void 0 ? _a : type]; | ||
return [...acc, 'bytes32', constants_1.TYPE_TRANSFORMATIONS[type] ?? type]; | ||
}, initialDecodedTypes); | ||
@@ -57,0 +56,0 @@ // It's important to leave the `encodedData` intact here and not try to trim off the first |
@@ -45,3 +45,3 @@ "use strict"; | ||
const transformedType = constants_1.TYPE_TRANSFORMATIONS[type]; | ||
return ['bytes32', transformedType !== null && transformedType !== void 0 ? transformedType : type]; | ||
return ['bytes32', transformedType ?? type]; | ||
}); | ||
@@ -48,0 +48,0 @@ // The first type is always a bytes32 as it represents the schema header |
import { ParameterType } from './constants'; | ||
export declare type ValueOf<T> = T[keyof T]; | ||
export type ValueOf<T> = T[keyof T]; | ||
export interface DecodedMap { | ||
@@ -11,8 +11,8 @@ readonly [key: string]: string; | ||
} | ||
export declare type ValueTransformation = { | ||
export type ValueTransformation = { | ||
readonly [key in ParameterType]?: (value: any) => string; | ||
}; | ||
export declare type TypeTransformation = { | ||
export type TypeTransformation = { | ||
readonly [key in ParameterType]?: ParameterType; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@api3/airnode-abi", | ||
"license": "MIT", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"private": false, | ||
@@ -13,3 +13,3 @@ "main": "dist/index", | ||
"build": "yarn run clean && yarn run compile", | ||
"clean": "rimraf -rf *.tsbuildinfo ./dist ./build *.tgz", | ||
"clean": "rimraf -g *.tsbuildinfo ./dist ./build *.tgz", | ||
"compile": "tsc --build tsconfig.json", | ||
@@ -25,7 +25,7 @@ "pack": "yarn pack", | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.186", | ||
"jest": "^29.2.2", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.8.4" | ||
"@types/lodash": "^4.14.191", | ||
"jest": "^29.5.0", | ||
"rimraf": "^5.0.0", | ||
"typescript": "^4.9.5" | ||
} | ||
} |
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
19437
211