Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static getMosaicId(rawMosaicId: string): MosaicId | NamespaceId {
let mosaicId: MosaicId | NamespaceId;
if (rawMosaicId.charAt(0) === MosaicService.ALIAS_TAG) {
mosaicId = new NamespaceId(rawMosaicId.substring(1));
} else {
mosaicId = new MosaicId(rawMosaicId);
}
return mosaicId;
}