10 lines
310 B
TypeScript
10 lines
310 B
TypeScript
|
export function parseCollectionName(collection: string) {
|
||
|
if (!collection) {
|
||
|
return [];
|
||
|
}
|
||
|
const dataSourceCollection = collection.split(':');
|
||
|
const collectionName = dataSourceCollection.pop();
|
||
|
const dataSourceName = dataSourceCollection[0] ?? 'main';
|
||
|
return [dataSourceName, collectionName];
|
||
|
}
|