-
Notifications
You must be signed in to change notification settings - Fork 9
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
The exports signatures are different between cjs and esm #13
Comments
Right require and import have different syntax...
would you also want it as the default so you can
or do you want to have to do
|
I'd prefer import { JSOX } from 'jsox'
const { JSOX } = require('jsox') Besides, can we add export const JSOX: typeof JSON |
I'd like to PR if you agree. |
I can easily add export.JSOX=JSOX (and JSOX=exports) so it ends up being recursive... |
Because I don't have to figure out how to name the default import identifier.
|
thought it was more on the other side but you can |
https://github.com/d3x0r/JSOX/blob/master/lib/jsox.d.mts I added a couple make type scripts - but it only exports a blank from jsox.js https://github.com/d3x0r/JSOX/blob/master/lib/jsox.js#L16 Added JSOX as a self member so {JSOX} = require( "jsox" ) would work... (maybe that's confusing the tsc) Maybe I just need to make a copy of the .d.mts to .d.ts ? |
You can try with a version on the dependency of "git://github.com/d3x0r/JSOX.git" if all is well, I can publish... I just don't want to entirely break the existing usage of |
@d3x0r Thanks for your quick fix, I tried and believe it's working now. Any schedule to release? |
I can fixup the any's... it really doesn't know what types things are. I'll massage those, and get back to you on a publish... I know some things are definitely 'string'... |
I suggest to use |
This is a sort of advanced question that I don't find a quick answer for - is there a way to specify the type is a type?
where really I'm passing just a type as the argument... it's not exactly an 'object' and it's not 'any' but I can leave it as any for the simple parse/stringify I can certainly do the fixups...
And then like reviver and replace get passed 'holder' as the |
updated types... |
I think you mean jsdoc based typings. |
Added optional indicators |
@d3x0r Thanks for your work! Are you open to accept a PR to add jsdoc based typings support later? |
Sure - but I might consult it for the desired changes and just implement them? Depends on how it looks when it's done :) |
@d3x0r Shall we release a new version? |
Ok - was waiting for a PR. Done. 1.2.119 published. |
I meant to PR later, I'm a bit busy these days, sorry. |
JSOX/package.jsox
Lines 20 to 24 in 44d2c55
JSOX/lib/jsox.mjs
Line 3018 in 44d2c55
See also un-ts/prettier#332
The text was updated successfully, but these errors were encountered: