Closed LasaleFamine closed 2 years ago
Hi @LasaleFamine, thanks for making me aware of that regression.
I have to admit that I don't fully know what the difference is but now it seems to work. Instead of checking if something extends IDataObject
the code does now separately check if the keys are valid and if the values are valid. Somehow that makes a difference to TypeScript. 🤷
But you would still need to adjust your INewUplink
definition. Using unknown
doesn't work. It needs to be any
if you don't know the type ahead of time.
interface INewUplink {
device: number;
providerDeviceId: string;
fPort: number;
fCnt: number;
payload: Record<string, any>;
consumedAirtime: string;
rxMetadataRaw: Array<Record<string, any>>;
settingsRaw: Record<string, any>;
receivedAt: string;
}
Hi @chrisguttandin, thanks for the quick response.
I want to add the actually I have solved the problem before your fix using a type
instead of an interface
 for my NewUplink
 data structure and it worked well.
Thanks for letting me know. Although it confuses me why using a type
works but using an interface
doesn't. 🤷
Hello, firstly I want to thank you for the awesome work on these converters.
I'm upgrading from v5 and I'm having a problem of types. The situation is the follow:
I have an interface like so:
And I'm using the object uplink as param for
dataToItem
function but it returnsnever
as type, so I can't use the returned value as data for the Dynamo SDK function to create a new record:Instead it works if I use a simple object like:
I'm thinking that can be a problem with the check here: https://github.com/chrisguttandin/dynamo-converters/blob/master/src/types/derived-item-object.ts#L4