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

fix: isProvider returns a boolean #444

Merged
merged 4 commits into from
Sep 19, 2018

Conversation

bitflower
Copy link

Hi Eddy,

as discussed on Slack, I think the isProvider method is returning a boolean.

The usage of it should therefore be changed in the docs as well I guess to something like:

iff(
        (context) => isProvider('external'), ...

types/index.d.ts Outdated
@@ -210,7 +210,7 @@ export function getItems(context: HookContext): any; // any[] | any | undefined;
* Check which transport provided the service call.
* {@link https://feathers-plus.github.io/v1/feathers-hooks-common/index.html#IsProvider}
*/
export function isProvider(...transports: TransportName[]): PredicateFn;
export function isProvider(...transports: TransportName[]): boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not correct, it should return "SyncPredicateFn", would you also please fix the test?

@j2L4e
Copy link
Contributor

j2L4e commented Sep 18, 2018

test still needs fixing, change the expected type to SyncContextFunction<boolean>

@bitflower
Copy link
Author

I'm such a noob, sorry for steeling your time...

@bitflower
Copy link
Author

Now I think I understand what you mean with "fix the tests"

@j2L4e
Copy link
Contributor

j2L4e commented Sep 18, 2018

don't worry. I was referring to tests.ts, you can inspect the error by clicking on the red cross on the right hand side of your commit.
Right now the test still expects PredicateFn which is wrong, we'd need it to expect SyncContextFunction<boolean> (which SyncPredicateFn is basically an alias for)

@bitflower
Copy link
Author

Fixed tests.ts. Travis looks good?

@j2L4e
Copy link
Contributor

j2L4e commented Sep 18, 2018

Great, thanks :)
@eddyystop lgtm

@eddyystop eddyystop merged commit f34bc10 into feathersjs-ecosystem:master Sep 19, 2018
@eddyystop
Copy link
Collaborator

eddyystop commented Sep 19, 2018

Published as v4.17.6

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

Successfully merging this pull request may close these issues.

3 participants