fix: enforce asset naming convention
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
export const ASSET_FAMILIES = [
|
||||
'baseColor',
|
||||
'color',
|
||||
'roughness',
|
||||
'normal',
|
||||
'normalOpengl',
|
||||
'metallic',
|
||||
'metalness',
|
||||
'occlusionRoughnessMetallic',
|
||||
'height',
|
||||
'opacity',
|
||||
] as const
|
||||
|
||||
export type AssetFamily = typeof ASSET_FAMILIES[number]
|
||||
|
||||
const ASSET_FAMILY_BY_KEY = new Map(ASSET_FAMILIES.map((family) => [family.toLowerCase(), family]))
|
||||
|
||||
export function getAssetFamily(value: string): AssetFamily | undefined {
|
||||
return ASSET_FAMILY_BY_KEY.get(value.toLowerCase())
|
||||
}
|
||||
|
||||
export function formatAssetFamilies() {
|
||||
return ASSET_FAMILIES.join(', ')
|
||||
}
|
||||
Reference in New Issue
Block a user