Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed typescript typing for sandbox#113

Open
joepjoosten wants to merge 2 commits intoJSONPath-Plus:main from
joepjoosten:master
Open

Fixed typescript typing for sandbox #113
joepjoosten wants to merge 2 commits intoJSONPath-Plus:main from
joepjoosten:master

Conversation

@joepjoosten
Copy link

@joepjoosten joepjoosten commented Jan 14, 2020

I was using jsonpath plus in my typescript app, and noticed that the sandbox has the wrong typing. This will result in a compilation error in typescript, and makes using the sandbox setting impossible.

Could you release this asap? Otherwise using the sandbox settings with typescript is not possible.

Copy link
Author

#114
I also created an issue for this pull request

Copy link
Collaborator

brettz9 commented Jan 14, 2020
edited
Loading

Ok, sure. But could you start us off with a sample TS file which adds a sandbox? We already have typescript as a devDep, so we should be able to add an npm script to test such a sample file (as we do against the declaration file itself), and I'd ultimately like to confirm all our type mappings against this sample file.

Copy link
Author

Yes, i'll add one.

brettz9 reacted with thumbs up emoji

Copy link
Collaborator

brettz9 commented Jan 14, 2020

FYI, I've made some tweaks to types at #115 . I can merge after your PR, but just letting you know, as I think those changes add some more specificity than just "any" (or greater clarity in the case where "JSON" or "any" can be returned (on JS objects)).

Copy link
Author

Tried to create a typescript test with this code:
https://gist.github.com/joepjoosten/9d59145b9d9337ec43ed47488cc035ef
It compiles, but i can't get it to run. It keeps failing to resolve jsonpath-plus.

Copy link
Collaborator

brettz9 commented Jan 15, 2020

Can you use a relative path instead?

Copy link
Author

Also tried that, but doesn't work...
Tried allot in a couple of hours. But nothing seems to work.
We could have a look together, if you have time?

Copy link
Collaborator

brettz9 commented Jan 15, 2020

I'm afraid I'm really falling behind on my other projects, and I have close to no experience in using TS.

Copy link

k-jay-c commented Jul 29, 2021

Hi,

I was having the same issue, for the time being, I've updated the jsonpath.d.ts and set the sandbox type to any. This will allow typescript to compile and also run.

Can I recommend this update be made in the interim for typescript.

sandbox?: any

Thanks.

Copy link
Collaborator

brettz9 commented Jul 29, 2021

I've added some further commits to #115 . Would you mind trying that out? I think that should solve the sandbox issue, but would be nice to check the greater specificity now that I think the sandbox issue has been worked out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /