Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typed.addType() fails if there is no Object type #155

Closed
gwhitney opened this issue Jul 22, 2022 · 1 comment · Fixed by #159
Closed

typed.addType() fails if there is no Object type #155

gwhitney opened this issue Jul 22, 2022 · 1 comment · Fixed by #159
Labels

Comments

@gwhitney
Copy link
Collaborator

To reproduce:

import typed from 'typed-function'

const pocomath_universe = typed.create()
pocomath_universe.clear()
pocomath_universe.addType({name: 'number', test: n => typeof n === 'number'})

This is my fault: I thought addType should reproduce the behavior from v2 of inserting before Object, but overlooked softening that to inserting before 'any' if there is no Object type. I do not think the above code should throw an error, although it can be worked around by supplying the 'beforeObjectTest = false' parameter.

@josdejong
Copy link
Owner

Thanks for reporting 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants