-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: per review (API, wording, tests)
Co-authored-by: Angelo Ashmore <angeloashmore@users.noreply.github.com>
- Loading branch information
1 parent
ecce4da
commit d93d23f
Showing
29 changed files
with
730 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Checks if a string is an asset tag ID. | ||
* | ||
* @param maybeAssetTagID - A string that's maybe an asset tag ID. | ||
* | ||
* @returns `true` if the string is an asset tag ID, `false` otherwise. | ||
*/ | ||
export const isAssetTagID = (maybeAssetTagID: string): boolean => { | ||
// Taken from @sinclair/typebox which is the uuid type checker of the Asset API | ||
// See: https://github.com/sinclairzx81/typebox/blob/e36f5658e3a56d8c32a711aa616ec8bb34ca14b4/test/runtime/compiler/validate.ts#L15 | ||
// Tag is already a tag ID | ||
return /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test( | ||
maybeAssetTagID, | ||
) | ||
} |
Oops, something went wrong.