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

core: Size class does not support bytes #24106

Assignees
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Feb 10, 2023

Describe the bug

Size.bytes() and size.toBytes() do not exist, but they should.

@rix0rrr rix0rrr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2023
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Feb 10, 2023
@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2023
@peterwoodworth
Copy link
Contributor

👍🏻

@mergify mergify bot closed this as completed in #24136 Feb 15, 2023
mergify bot pushed a commit that referenced this issue Feb 15, 2023
This PR adds Size.bytes(), which allows to specify a Size class from an amount of bytes. Within the Size class, `Size.bytes( )` is the additional method added here to enable support for bytes as well as conversion to bytes with `Size.toBytes`.

For example, 

```ts
const size = new Size.bytes(1024);
expect(size.toKibibytes).toEqual(1);
```

creates a new object of the Size class with a size of 1024 bytes and which is equivalent to 1 kibibyte.

Closes #24106.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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