Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / operations/content / 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

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

Released under the Apache-2.0 License.