Amareis / another-rest-client

Simple pure TypeScript REST API client that makes your code lesser and more beautiful than without it.
MIT License
174 stars 17 forks source link

Users can add shortcut rules for resources as an option #16

Closed felixlinker closed 6 years ago

felixlinker commented 6 years ago

This allows users to supply functions that add additional shortcuts for resources. This might come in handy for resources that could otherwise only be accessed by using api[...]. For example have a look at the test case. This rule adds shortcuts for resources like long-string-with-dashes in the form of their camel-case counterpart longStringWithDashes making this resource accessible via api.longStringWithDashes.

felixlinker commented 6 years ago

Amended the README.md update as well as the usage of rule(resourceName) instead of rule.call(undefined, resourceName).

Amareis commented 6 years ago

Thanks for your work, I'll upload it to npm in hours.

Amareis commented 6 years ago

Published as 0.5.0.