MCPcopy Create free account
hub / github.com/webdriverio/webdriverio / normalizeSpec

Function normalizeSpec

scripts/utils/formatter.ts:18–33  ·  view source on GitHub ↗
(spec: Spec)

Source from the content-addressed store, hash-verified

16}
17
18function normalizeSpec(spec: Spec): TagType {
19 const ensureType = (currentType: string | undefined) => currentType || 'any'
20
21 const trimDescription = (desc: string) =>
22 desc && desc.endsWith('\n') ? desc.replace(/(\n)+$/, '') : desc
23
24 const string = spec.source[0].source.split(`@${spec.tag}`)[1].trim()
25
26 spec.type = ensureType(spec.type)
27 spec.description = trimDescription(spec.description)
28
29 return {
30 ...spec,
31 string,
32 }
33}
34
35export default function (docfile: {
36 filename: string;

Callers 1

formatter.tsFile · 0.85

Calls 2

ensureTypeFunction · 0.85
trimDescriptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…