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

improv(commons): expand type utils functions #2189

Merged
merged 8 commits into from
Mar 12, 2024
Merged

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Mar 8, 2024

Description of your changes

This PR adds a series of helper functions to the commons utility to get the type of a value at runtime and perform strict equality.

The helper functions existing before this PR are used across many of the Powertools utilities while the ones added in the PR are mainly for the upcoming JMESPath utility. Overtime we can adopt some of the newer ones wherever necessary on the existing codebase.

Related issues, RFCs

Issue number: #2191

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Mar 8, 2024
@dreamorosi dreamorosi requested review from a team as code owners March 8, 2024 17:27
@boring-cyborg boring-cyborg bot added commons This item relates to the Commons Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. tests PRs that add or change tests labels Mar 8, 2024
@pull-request-size pull-request-size bot added the size/XL PRs between 500-999 LOC, often PRs that grown with feedback label Mar 8, 2024
@dreamorosi dreamorosi linked an issue Mar 8, 2024 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added the enhancement PRs that introduce minor changes, usually to existing features label Mar 8, 2024
@dreamorosi dreamorosi linked an issue Mar 8, 2024 that may be closed by this pull request
2 tasks
@dreamorosi dreamorosi removed dependencies Changes that touch dependencies, e.g. Dependabot, etc. tests PRs that add or change tests labels Mar 8, 2024
@boring-cyborg boring-cyborg bot added dependencies Changes that touch dependencies, e.g. Dependabot, etc. tests PRs that add or change tests labels Mar 11, 2024
Copy link
Contributor

@am29d am29d left a comment

Choose a reason for hiding this comment

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

Nice packaged PR, just a minor question on the NaN edge case.

packages/commons/src/typeUtils.ts Outdated Show resolved Hide resolved
packages/commons/src/typeUtils.ts Show resolved Hide resolved
packages/commons/tests/unit/typeUtils.test.ts Outdated Show resolved Hide resolved
packages/commons/src/typeUtils.ts Show resolved Hide resolved
Co-authored-by: Alexander Schueren <sha@amazon.com>
am29d
am29d previously approved these changes Mar 11, 2024
am29d
am29d previously approved these changes Mar 11, 2024
@dreamorosi
Copy link
Contributor Author

Had to resolve some merge conflicts since both this & #2190 were touching the same section of the packages/commons/package.json file.

It's now ready for approve & merge.

Thanks a lot for the review on both!

@dreamorosi dreamorosi requested a review from am29d March 11, 2024 16:16
Copy link

sonarcloud bot commented Mar 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@am29d am29d merged commit 9208393 into main Mar 12, 2024
11 checks passed
@am29d am29d deleted the improv/commons/typeutils branch March 12, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commons This item relates to the Commons Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. enhancement PRs that introduce minor changes, usually to existing features size/XL PRs between 500-999 LOC, often PRs that grown with feedback tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: expand shared type utilities
2 participants