14 lines
315 B
JavaScript
14 lines
315 B
JavaScript
import { split, last } from "lodash/fp"
|
|
import { pipe } from "../../../helpers"
|
|
|
|
export const splitName = fullname => {
|
|
const componentName = pipe(fullname, [split("/"), last])
|
|
|
|
const libName = fullname.substring(
|
|
0,
|
|
fullname.length - componentName.length - 1
|
|
)
|
|
|
|
return { libName, componentName }
|
|
}
|