• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

scriptype / writ-cms / 21229485266

21 Jan 2026 11:25PM UTC coverage: 38.719% (-0.5%) from 39.202%
21229485266

push

github

scriptype
Add tap-nyan back

621 of 3672 branches covered (16.91%)

Branch coverage included in aggregate %.

2171 of 3539 relevant lines covered (61.35%)

1769.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/cms/api/models/contentTypes.js
1
const { join } = require('path')
×
2
const { mkdir, writeFile } = require('fs/promises')
×
3
const { stringify } = require('yaml')
×
4

5
const createContentTypesModel = ({ getSettings, getContentTypes }) => {
×
6
  const createContentType = async ({ name, description = '', attributes, ...config }) => {
×
7
    const { rootDirectory } = getSettings()
×
8
    const schemaDirectory = join(rootDirectory, 'schema')
×
9
    const filePath = join(schemaDirectory, `${name}.md`)
×
10
    const frontMatter = stringify({
×
11
      name,
12
      attributes,
13
      ...config
14
    })
15
    const fileContent = ['---', frontMatter.replace(/\s+$/, ''), '---', description].join('\n')
×
16
    await mkdir(schemaDirectory, { recursive: true })
×
17
    await writeFile(filePath, fileContent)
×
18
    return { ok: true }
×
19
  }
20

21
  return {
×
22
    get: getContentTypes,
23
    create: createContentType
24
  }
25
}
26

27
module.exports = createContentTypesModel
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc