-
-
Notifications
You must be signed in to change notification settings - Fork 197
Fixed typescript typing for sandbox#113
Fixed typescript typing for sandbox #113joepjoosten wants to merge 2 commits intoJSONPath-Plus:main from
Conversation
joepjoosten
commented
Jan 14, 2020
#114
I also created an issue for this pull request
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.
joepjoosten
commented
Jan 14, 2020
Yes, i'll add one.
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)).
joepjoosten
commented
Jan 14, 2020
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.
brettz9
commented
Jan 15, 2020
Can you use a relative path instead?
joepjoosten
commented
Jan 15, 2020
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?
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.
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.
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.
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.