Skip to content

feat: add source maps#6

Open
castarco wants to merge 3 commits intomacor161:masterfrom
castarco:add-source-maps
Open

feat: add source maps#6
castarco wants to merge 3 commits intomacor161:masterfrom
castarco:add-source-maps

Conversation

@castarco
Copy link
Copy Markdown

@castarco castarco commented Jul 5, 2021

  • add source maps to help developers to debug problems (that's my main reason to push this PR)
  • upgrade direct & indirect dependencies
  • specify stricter interface types
  • use const when possible

- add source maps to help developers to debug problems
- upgrade direct & indirect dependencies
- specify stricter interface types
Comment thread index.ts
Object.freeze(this)
}

static fromInteger(amount: number|any, currency?: string): Money {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a "minor" breaking change, but we're still below 1.x.x, and I bumped versions. This change it might seem too radical 2 years ago, but today most TypeScript code bases are much stricter than before, and this can help developers to spot bugs at "build time", instead of runtime.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No controversy at all, I think it's a very welcomed change!

@macor161 macor161 self-requested a review July 5, 2021 13:14
@macor161
Copy link
Copy Markdown
Owner

Thanks for the contribution @castarco ! I just came back from vacation and should be able to review the PR over the weekend.

Copy link
Copy Markdown
Owner

@macor161 macor161 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for your PR! The added interface makes the library much cleaner!

I suggested a minor change, let me know what you think.

Comment thread index.ts
}

static fromDecimal(amount: number|any, currency: string|any, rounder?: string|Function): Money {
static fromDecimal(amount: number | Partial<IMoney>, currency: string|any, rounder?: string|Function): Money {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably use IMoney directly since none of its properties are optional for this function.

Suggested change
static fromDecimal(amount: number | Partial<IMoney>, currency: string|any, rounder?: string|Function): Money {
static fromDecimal(amount: number | IMoney, currency: string|any, rounder?: string|Function): Money {

Comment thread index.ts
}

static fromInteger(amount: number|any, currency?: string): Money {
static fromInteger(amount: number | Partial<IMoney>, currency?: string): Money {
Copy link
Copy Markdown
Owner

@macor161 macor161 Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably use IMoney directly since none of its properties are optional for this function. (See line 87)

Suggested change
static fromInteger(amount: number | Partial<IMoney>, currency?: string): Money {
static fromInteger(amount: number | IMoney, currency?: string): Money {

Comment thread index.ts
Object.freeze(this)
}

static fromInteger(amount: number|any, currency?: string): Money {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No controversy at all, I think it's a very welcomed change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants