---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/content](../index.md) / detectTypeFromPath

# Function: detectTypeFromPath()

> **detectTypeFromPath**(`filePath`): `"image"` \| `"pagetype"` \| `"componenttype"` \| `"aspecttype"` \| `"cmsrecord"` \| `"customeditortype"` \| `"contentassetpageconfig"` \| `"contentassetcomponentconfig"` \| `"contentassetstructuredcontentdata"` \| `null`

Defined in: [packages/b2c-tooling-sdk/src/operations/content/validate.ts:98](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/operations/content/validate.ts#L98)

Detect the metadefinition schema type from a file path using Page Designer conventions.

- `experience/pages/` → `pagetype`
- `experience/components/` → `componenttype`

## Parameters

### filePath

`string`

## Returns

`"image"` \| `"pagetype"` \| `"componenttype"` \| `"aspecttype"` \| `"cmsrecord"` \| `"customeditortype"` \| `"contentassetpageconfig"` \| `"contentassetcomponentconfig"` \| `"contentassetstructuredcontentdata"` \| `null`
