Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
update numbro.d.ts to use export = instead of export default #232
As https://github.com/foretagsplatsen/numbro/blob/develop/dist/numbro.js shows the module is exported as a namespace (
This discrepancy makes it impossible to use in TS:
This commit changes numbro.d.ts to use
@smajl, what module loader are you using? I know that babel and SystemJS do some magic vodoo to hide the differences but this 'feature' is being reconsidered as mentioned here: microsoft/TypeScript#5565
@BenjaminVanRyseghem, in general in ES2016:
As I said some loaders/bundlers hack it arround to make things simpler, but actually they make it more confusing...
TS is strict about it an, since numbro.js is not using
It works in my machine (TM) and is the same that moment.d.ts is doing: https://github.com/moment/moment/blob/develop/moment.d.ts
We're al in the business of unrecognized and unpayed work in github.
The thing is that numbro is currently unusable for me (and probably like half of the TS users) because of a change that only needs to get merged.
If you think that maintaining the d.ts file is a big burden because there is no contributor using TS and it is seen as an alien technology, just delete the file and let it evolve independently in DefinitelyTyped. They currently don't accept my pull request there (DefinitelyTyped/DefinitelyTyped#14412) because they think the d.ts is maintained here.
The parsing problem was when trying to do this:
The same worked with numeral.js unformat method/constructor, but I didn't found the equivalence in numbro.js docs .
I didn't bothered to add the issue since you looked busy.
After the fix of the parse problem (just using
Any change of this PR to be merged?
We have our own copy of the d.ts file so we can live without the merge, but I'm quite sure the current implementation is wrong and will create problems by any other developers using TS. It's also the same that moment or numeral are doing...