Skip to content

More meaningful name for invariant function #153

@cjoecker

Description

@cjoecker

I would like to have a more meaningful name for the function than invariant. Something like throwOnFalsy is for me easier to understand.

While working with developers that don’t know what tiny-invariant is, I realized that is not easy understand at first sight what the invariant function does. To improve this, it would be nice to rename the function with something more descriptive. I would still keep the original function to avoid breaking changes but also allow to import the new function with the descriptive name.

What do you think? Is throwOnFalsy good for you or maybe you have a better name?
If you think it is a good idea, I would submit a PR for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions