mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
14 lines
324 B
TypeScript
14 lines
324 B
TypeScript
import { REFINE_PACKAGE_FILEPATH_REGEXP } from "./constants";
|
|
|
|
export const getPackageNameFromFilename = (filename?: string) => {
|
|
if (!filename) return;
|
|
|
|
const match = filename.match(REFINE_PACKAGE_FILEPATH_REGEXP);
|
|
|
|
const name = match?.groups?.name;
|
|
|
|
if (!name) return;
|
|
|
|
return `@refinedev/${name}`;
|
|
};
|