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

Fix number pattern of stringify to support exponential log value #749

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

samchon
Copy link
Owner

@samchon samchon commented Aug 8, 2023

When typia.stringify<T>() be used for an object type which has template typed key containing a number type, and exponential log being used in the template key type, typia could not write the property because regex pattern for numeric value of typia had not supported the exponential log value.

This is an extremely rare case, but fixed for extensionality.

export interface ISomething {
    [key: `value_${number}`]: boolean | string | number;
}

const something: ISomething = {
    "5.175933557310941e-7": -0.170261004873707,
};
typia.stringify(something);

… value.

When `typia.stringify<T>()` be used for an object type which has template typed key containing a number type, and exponential log being used in the template key type, `typia` could not write the property because regex pattern for numeric value of ` typia` had not supported the exponential log value.

This is an extremely rare case, but fixed for extensionality.

```typescript
export interface ISomething {
    [key: `value_${number}`]: boolean | string | number;
}

const something: ISomething = {
    "5.175933557310941e-7": -0.170261004873707,
};
typia.stringify(something);
```
@samchon samchon added bug Something isn't working enhancement New feature or request labels Aug 8, 2023
@samchon samchon self-assigned this Aug 8, 2023
@samchon samchon added this to In progress in v4.2 Update via automation Aug 8, 2023
@samchon samchon merged commit 820da76 into master Aug 8, 2023
3 checks passed
v4.2 Update automation moved this from In progress to Done Aug 8, 2023
samchon added a commit to samchon/nestia that referenced this pull request Aug 8, 2023
@samchon samchon deleted the features/exponential branch August 8, 2023 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant