adminjs
Version:
Admin panel for apps written in node.js
14 lines (12 loc) • 427 B
text/typescript
import { DELIMITER } from '../../../../utils/flat/constants.js'
import { PropertyJSON, BasePropertyJSON } from '../../../interfaces/index.js'
export function convertToSubProperty(
property: PropertyJSON,
subProperty: BasePropertyJSON,
): PropertyJSON {
const [subPropertyPath] = subProperty.name.split(DELIMITER).slice(-1)
return {
...subProperty,
path: [property.path, subPropertyPath].join(DELIMITER),
}
}