Skip to content

FRONTEND: Normalize Asset IDs (Utility Function) #303

@yusuftomilola

Description

@yusuftomilola

Description:
Create a utility function that ensures all asset IDs are transformed into a consistent format across the application. Assets may come with UUIDs, numeric IDs, or custom prefixed IDs.

Tasks:

  • Add a new file lib/utils/normalizeAssetId.ts.
  • Accept strings or numbers as input.
  • Convert numeric IDs to string, strip unnecessary prefixes, and return a standardized ID format.
  • Write unit tests for multiple input cases.

Acceptance Criteria:

  • normalizeAssetId("123")"123".
  • normalizeAssetId("asset-456")"456".
  • normalizeAssetId(789)"789".
  • Tests cover at least 5 cases.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions