sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.8k stars 105 forks source link

Alias `.of` for `.ofType` #162

Open Riim opened 4 years ago

Riim commented 4 years ago

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

sindresorhus commented 4 years ago

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.