-
Notifications
You must be signed in to change notification settings - Fork 2
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
deno support? #97
Comments
Deno is based 100 so I intent to add full support. I'm embarrassed that we don't have support already. |
Have you tried esm.sh? |
no good
|
@andykais might be because there's no This means you have to import from individual files directly, so your second example in the OP should work with esm.sh. Let me know if it doesn't |
what you are saying makes sense but I dont know what the paths are on esm.sh. Is it |
the npm package has built import {exactly} from 'http://esm.sh/@detachhead/ts-helpers/src/utilityFunctions/misc.ts' |
no such luck:
retrying gives 500 at different imports
|
i'm not sure then sorry. unfortunately i've experienced lots of issues running & debuging with deno on my machines which is why i've stuck with node. if you or anyone else figures out how to get it working i'd happily accept a PR. it may be something that fixes itself with #76, who knows |
So the actual import is import { exactly } from 'http://esm.sh/@detachhead/ts-helpers/dist/utilityFunctions/misc' but ts-ignore comments aren't included in the |
I'm going to try and add deno support. |
i've removed all of the can you try importing this version from esm.sh and let me know if it works? import { exactly } from 'http://esm.sh/@detachhead/[email protected]/dist/utilityFunctions/misc' |
It works! The following snippet seems to do error on everything I throw at it import { exactly } from 'http://esm.sh/@detachhead/[email protected]/dist/utilityFunctions/misc'
import * as z from 'https://deno.land/x/[email protected]/mod.ts'
interface Foo {
bar: string
baz?: string // removing this line gives an error
bot: 'a' | 'b'
}
const FooValidator = z.object({
bar: z.string(),
baz: z.string().optional(), // removing this line gives the error
bot: z.union([z.literal('a'), z.literal('b')]), // adding/removing a literal from the union gives the error
})
exactly({} as z.input<typeof FooValidator>, {} as Foo)
Is this opt-out though? These are definitely not two runtime equivalent values would you plan to publish to the deno repository (https://deno.land/x)? |
if you only want to test the types, you can do it like this: exactly<z.input<typeof FooValidator>, Foo>() or if you're checking a value against a type: exactly<z.input<typeof FooValidator>>()({} as Foo) as for the type errors, those are happening because assertType<z.input<typeof FooValidator>>({} as Foo) that way, you'll no longer get errors when removing those properties from
i'll leave that up to @KotlinIsland, i'm not much of a deno user so what are the benefits of publishing there over using esm.sh? |
oh actually I do want those errors! I was just pointing out that |
is it possible to use this module inside deno? Skypack imports dont seem to work
and importing the source from github isnt an option either because paths arent fully resolved
The text was updated successfully, but these errors were encountered: