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

chore: Small cleanup to internal core utils #13140

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

cshfang
Copy link
Member

@cshfang cshfang commented Mar 18, 2024

Description of changes

This PR introduces some minor cleanup to improve consistency and structural semantics in core:

  1. Export WordArray as module member so it can be re-exported directly by libraryUtils.ts
  2. Extract StrictUnion to core root level types since it is not actually coupled to Auth (and will be used by Storage in future PRs)

Description of how you validated changes

$ yarn clean && yarn && yarn build && yarn test

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@cshfang cshfang requested review from a team as code owners March 18, 2024 17:29
david-mcafee
david-mcafee previously approved these changes Mar 18, 2024
type StrictUnionHelper<T, TAll> = T extends any
? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>>
: never;

Copy link
Member

Choose a reason for hiding this comment

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

Nit: Should we add a comment to explain util function here?

israx
israx previously approved these changes Mar 18, 2024
@@ -4,3 +4,4 @@
export * from './core';
export * from './errors';
export * from './storage';
export * from './utils';
Copy link
Member

Choose a reason for hiding this comment

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

nit question,
Should these be updated to named exports later on to keep it uniform across all categories

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not opposed to it but we do this in various other places as well - including other packages - so I'm not sure this is the right PR to do this in

ashwinkumar6
ashwinkumar6 previously approved these changes Mar 18, 2024
Copy link
Member

@ashwinkumar6 ashwinkumar6 left a comment

Choose a reason for hiding this comment

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

thank you!!

@cshfang cshfang dismissed stale reviews from ashwinkumar6, israx, and david-mcafee via 9e69d97 March 18, 2024 18:20
@cshfang cshfang merged commit a254bb6 into aws-amplify:main Mar 18, 2024
30 checks passed
@cshfang cshfang deleted the chore/minor-refactoring branch March 18, 2024 18:50
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

Successfully merging this pull request may close these issues.

5 participants