primevue-mirror/packages/metadata/src/index.ts

24 lines
517 B
TypeScript
Raw Normal View History

2024-06-11 12:21:12 +00:00
export interface MetaType {
name?: string;
as?: string;
from?: string;
use?: {
as?: string;
};
}
export function toMeta(arr?: any[]): MetaType[] | undefined {
return arr?.map((item) => {
const it = typeof item === 'string' ? { name: item } : item;
2024-06-14 14:54:21 +00:00
it.as ??= it?.name;
2024-06-11 12:21:12 +00:00
it.from ??= `primevue/${it?.name?.toLowerCase()}`;
return it;
});
}
export * from './components/index';
export * from './composables/index';
export * from './directives/index';