Skip to content

Home > fff-flavored-frontmatter > postTypeDiscovery

postTypeDiscovery variable

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Post Type Discovery

Signature:

typescript
postTypeDiscovery: (fm: FFFFlavoredFrontmatter) => PostType

Example

ts
import { postTypeDiscovery } from 'fff-flavored-frontmatter'

const helloWorld = {
  title: 'Hello',
  summary: 'World!',
}

const fooBar = {
  summary: 'foo',
  tags: ['bar'],
}

// 'article'
console.log(postTypeDiscovery(helloWorld))
// 'note'
console.log(postTypeDiscovery(fooBar))