}
export const RESOURCE_UUID_PATTERN = '[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}';
-export const RESOURCE_UUID_REGEX = new RegExp(RESOURCE_UUID_PATTERN);
-export const COLLECTION_PDH_REGEX = /[a-f0-9]{32}\+\d+/;
+export const RESOURCE_UUID_REGEX = new RegExp("^" + RESOURCE_UUID_PATTERN + "$");
+export const COLLECTION_PDH_REGEX = /^[a-f0-9]{32}\+\d+$/;
export const isResourceUuid = (uuid: string) =>
RESOURCE_UUID_REGEX.test(uuid);
return ResourceKind.LINK;
default:
const match = COLLECTION_PDH_REGEX.exec(uuid);
- console.log("matching " + match);
return match ? ResourceKind.COLLECTION : undefined;
}
};