panva / paseto

PASETO (Platform-Agnostic SEcurity TOkens) for Node.js with no dependencies
MIT License
428 stars 26 forks source link

Bugfix/correct object types #36

Closed kschaefe closed 1 year ago

kschaefe commented 1 year ago

Solves #35.

panva commented 1 year ago

What's 'PropertyKey'? Given it can only be a parsed JSON object the only key types would be strings.

kschaefe commented 1 year ago

I used PropertyKey, which is string | number | symbol for the inputs, but made the outputs use string. I didn't want to accidentally cause someone's code to fail to compile on input, so was being cautious there. I'm happy to use string as the key type for both inputs and outputs if that's what you'd like.

panva commented 1 year ago

I used PropertyKey, which is string | number | symbol for the inputs, but made the outputs use string. I didn't want to accidentally cause someone's code to fail to compile on input, so was being cautious there. I'm happy to use string as the key type for both inputs and outputs if that's what you'd like.

Makes sense. Thanks for the explanation.

panva commented 1 year ago

Please add - run: npm run test-types at the end of .github/workflows/test.yml