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

Alias .of for .ofType #162

Open
Riim opened this issue Oct 19, 2019 · 1 comment
Open

Alias .of for .ofType #162

Riim opened this issue Oct 19, 2019 · 1 comment

Comments

@Riim
Copy link

Riim commented Oct 19, 2019

ow.array.of(ow.string)
clearly better than
ow.array.ofType(ow.string)

@sindresorhus
Copy link
Owner

I'm not interested in adding aliases. That just leads to inconsistent code.

I don't remember exactly why we went with .ofType. It might have been because ofType accepts any predicate, so ow.array.ofType(() => …) is clearer than ow.array.of(() => …).

I'll leave this open for other people to comment their opinion.

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

No branches or pull requests

2 participants