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

Support much more type comment tags. #769

Merged
merged 1 commit into from
Aug 20, 2023
Merged

Support much more type comment tags. #769

merged 1 commit into from
Aug 20, 2023

Conversation

samchon
Copy link
Owner

@samchon samchon commented Aug 20, 2023

From v4.3 update, below type comment tags being supported.

Also, in the bigint case, it can use @type uint64 comment tag for unsigned bigint restriction.

For reference, such type comment tags are designed to prepare the next v5 update, Protocol Buffer supporting.

  • @type {string}
    • int: Math.floor(x) === x
    • uint: Math.floor(x) === x && x >= 0
      • int32: -2^31 <= x <= 2^31 - 1
      • uint32: 0 <= x <= 2^32 - 1
      • uint64: 0 <= x <= 2^64 - 1
      • int64: -2^63 <= x <= 2^63 - 1
    • float: -1.175494351e38 <= x <= 3.4028235e38

From v4.3 update, below type comment tags being supported. Also, in the `bigint` case, it can use `@type uint64` comment tag for `unsigned bigint` restriction.

For reference, such type comment tags are designed to prepare the next v5 update, Protocol Buffer supporting.

  - `@type {string}`
    - `int`: `Math.floor(x) === x`
    - `uint`: `Math.floor(x) === x && x >= 0`
      - `int32`: `-2^31 <= x <= 2^31 - 1`
      - `uint32`: `0 <= x <= 2^32 - 1`
      - `uint64`: `0 <= x <= 2^64 - 1`
      - `int64`: `-2^63 <= x <= 2^63 - 1`
    - `float`: `-1.175494351e38 <= x <= 3.4028235e38`
@samchon samchon added the enhancement New feature or request label Aug 20, 2023
@samchon samchon self-assigned this Aug 20, 2023
@samchon samchon merged commit 3cd0958 into master Aug 20, 2023
2 checks passed
@samchon samchon deleted the features/types branch August 20, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant