Skip to content
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

Cannot assign to 'unit' because it is a read-only property. #62

Closed
Smidul opened this issue Feb 11, 2025 · 1 comment
Closed

Cannot assign to 'unit' because it is a read-only property. #62

Smidul opened this issue Feb 11, 2025 · 1 comment

Comments

@Smidul
Copy link

Smidul commented Feb 11, 2025

In typescript, I'm unable to reassign parse.unit to switch locales as documented, since it's declared as a const in the typings:

declare namespace parse {
const unit: Units;
}

Declaring it as a let works fine:

declare namespace parse { 
   let unit: Units; 
 }
@dy
Copy link
Collaborator

dy commented Feb 11, 2025

You can extend units Object.assign(parse.unit, {...}) before v2.1.3.
Fixed in 2.1.3

@dy dy closed this as completed Feb 11, 2025
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

No branches or pull requests

2 participants