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

type jsluice.object has no field or method getKeys #4

Closed
YouGina opened this issue Jul 4, 2023 · 2 comments
Closed

type jsluice.object has no field or method getKeys #4

YouGina opened this issue Jul 4, 2023 · 2 comments

Comments

@YouGina
Copy link

YouGina commented Jul 4, 2023

When I try to use jsluice as a package I get the error message: type jsluice.object has no field or method getKeys when I do something like:

secondArg := arguments.NamedChild(1)
if secondArg.Type() == "object" {
    params := secondArg.AsObject().getKeys()
    m.Method = "POST"
    m.BodyParams = params
} 

I've used url-match-jquery.go as a reference to create a custom url matcher for a project that uses a custom function to call api endpoints.

I likely am doing something wrong myself as I do not have that much experience with go, what could be the problem here?

@bf-tomnomnom
Copy link
Contributor

Hey @YouGina! Thank you for raising an issue!

This looks to be an oversight on my part with not exporting some of the types that jsluice uses internally.

As of this commit, you should be able to call secondArg.AsObject().GetKeys() (note the capital G on GetKeys).

Thanks for bringing this to my attention!

@YouGina
Copy link
Author

YouGina commented Sep 4, 2023

Hi @bf-tomnomnom , thank you for taking the time to look into this issue!

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