-
From the documentation, I'm curious what I should expect "types" to refer to. I was expecting each type to have a corresponding Typescript https://docs.ethers.io/v5/api/utils/bytes/#byte-manipulation--types I am a bit green to how libraries handle Typescript type exports, so I was wondering why this is. If it seems like a worthwhile addition to the codebase, I would be open to adding these in a PR! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
There is no in-code alias for those, they are just strings. The main reason to break them out in the documentation is to provide a stricter guideline as to what the string should/will look like. A hex string would match But anywhere used in the docs, you can assume Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
(moving to discussions) |
Beta Was this translation helpful? Give feedback.
There is no in-code alias for those, they are just strings. The main reason to break them out in the documentation is to provide a stricter guideline as to what the string should/will look like.
A hex string would match
/^0x[0-9a-f]*$/i
and a data hex string/^0x([0-9a-f][0-9a-f])*$/I
(i.e. even length).But anywhere used in the docs, you can assume
string
, but which will adhere to those constraints.Does that make sense?