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

When using a string for the selector using TypeScript it doe snot compile. Please help I am not very familiar with TypeScript #45

Open
ferodom opened this issue Jan 5, 2018 · 2 comments

Comments

@ferodom
Copy link

ferodom commented Jan 5, 2018

Like doing this
Enumerable.from(dataVals).where("$.indexOf("" + parameterName + "") !== -1").singleOrDefault("", "$").replace(/+/g, " ").split("=")[1];

instead of doing
return Enumerable.from(dataVals).where(p=> p.indexOf(parameterName) !== -1).singleOrDefault().replace(/+/g, " ").split("=")[1];

for most cases I can rewrite but I have a few specific that it is easier to use the string selector

Thanks

@mihaifm
Copy link
Owner

mihaifm commented Jan 7, 2018

I haven't tried this, but I notice that you have some double quotes in there. Not sure what that is about...shouldn't it be: where("$.indexOf(" + parameterName + ") !== -1") ?

@ferodom
Copy link
Author

ferodom commented Jan 18, 2018

I looked at the typescript definitions and if I want to use the "$." syntax all I have to do is
add the following typing.
select(selector: string): IEnumerable; in addition to
select(selector: (element: T, index: number) => TResult): IEnumerable;

What do you think? I could submit a pull request

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