tachybase_todo/packages/core/data-source-manager/src/utils.ts

10 lines
310 B
TypeScript
Raw Normal View History

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