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
docs: how to use utility-types in deno #141
Comments
Hey @FaberVitale Thanks for creating PR. I'll take a look ASAP and come back to you. |
up |
I'm not familiar with Deno and would like to use some help here. |
I developed this PR 3 years ago. It's possible that these changes are obsolete: |
It works! I've just tested it using the following test file: // deno_test.ts
import * as utilityTypes from 'npm:utility-types@3.9.0'
console.log('\nutility-types module', utilityTypes)
console.log('\nisPrimitive', utilityTypes.isPrimitive({}), utilityTypes.isPrimitive(2)) $ deno run deno_test.ts
utility-types module Module {
__esModule: true,
default: {
isFalsy: [Function],
isPrimitive: [Function],
getReturnOfExpression: [Function: getReturnOfExpression]
},
getReturnOfExpression: [Function: getReturnOfExpression],
isFalsy: [Function],
isPrimitive: [Function]
}
isPrimitive false true
deno --version
deno 1.30.3 (release, x86_64-apple-darwin)
v8 10.9.194.5
typescript 4.9.4 @piotrwitek you probably just need to add deno specific tests and document how to run the library in deno. |
Thanks a lot for your help @FaberVitale! |
Is your feature request related to a real problem or use-case?
It is not currently possible to import/run
utility-types
in deno due todifferent way node and deno resolve imports (aka module resolution).
Describe a solution including usage in code example
2 Suggested solutions
Use a compiler like denoify to emit a compiled output that deno understands.
Refactor: remove all imports.
Who does this impact? Who is this for?
deno users.
Describe alternatives you've considered (optional)
Additional context (optional)
https://deno.land/manual
https://github.com/garronej/denoify
https://deno.land/manual/getting_started/typescript
https://www.typescriptlang.org/docs/handbook/module-resolution.html
2023-02-20 Update
#141 (comment)
The text was updated successfully, but these errors were encountered: