Trying to Date(items.element) throws an error creating node

I got some errors when accessing to some elements inside of ‘items’ when creating a node. However all works fine but I would like to know a form to perfom these access with no errors.

this is the error when trying to transform a IDataObject to Date (If I first try to ‘stringify’) that element it doesn’t work but the error dissapears. Otherwise, the error persists, but the function works.

No overload matches this call.
Overload 1 of 4, ‘(value: string | number | Date): Date’, gave the following error.
Argument of type ‘IDataObject | IBinaryKeyData | undefined’ is not assignable to parameter of type ‘string | number | Date’.
Type ‘undefined’ is not assignable to type ‘string | number | Date’.
Overload 2 of 4, ‘(value: string | number): Date’, gave the following error.
Argument of type ‘IDataObject | IBinaryKeyData | undefined’ is not assignable to parameter of type ‘string | number’.
Type ‘undefined’ is not assignable to type ‘string | number’.ts(2769)

Anybody knows how to amend this?
Thank you very much

Sorry not sure I understand. An IDataObject is an object. So something like { a: 'b' } that can not be transformed to a Date. You can transform a property of it.
So if you have an IDataObject named “test” which looks like this: { d: '2021-06-24' } you can do:
new Date(test.d).

Yeah, you are right, that was what I wanted to say exactly, maybe I can send DM with a screenshot of the problem for a better clarification.