Skip to content

Commit

Permalink
feat: export isS3Reference
Browse files Browse the repository at this point in the history
  • Loading branch information
zirkelc committed Oct 17, 2024
1 parent aad227d commit e016cc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-panthers-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"middy-store-s3": patch
---

feat: export `isS3Reference`
6 changes: 6 additions & 0 deletions packages/store-s3/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export const isS3Object = (obj: unknown): obj is S3Object => {
);
};

export const isS3Reference = (reference: unknown): reference is S3Reference => {
return (
isS3Object(reference) || isS3ObjectArn(reference) || isS3Url(reference)
);
};

export const parseS3Reference = (reference: unknown): S3Object => {
if (isS3Object(reference)) return reference;
if (isS3ObjectArn(reference)) return parseS3ObjectArn(reference);
Expand Down

0 comments on commit e016cc1

Please sign in to comment.