// at-uri helpers: at://<authority>/<collection>/<rkey>

export const didFromUri = (uri: string): string => {
	const rest = uri.startsWith('at://') ? uri.slice(5) : uri;
	const slash = rest.indexOf('/');
	return slash === -1 ? rest : rest.slice(0, slash);
};

export const rkeyFromUri = (uri: string): string => uri.slice(uri.lastIndexOf('/') + 1);
