Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const providerTemplatePath = resolve(TEMPLATES_DIR, "provider.hbs")
const { markdownReference, yaml } = renderConfigReference(schema)
const moduleOutputsReference =
moduleOutputsSchema &&
renderTemplateStringReference({
schema: joi.object().keys({
outputs: moduleOutputsSchema.required(),
}),
prefix: "providers",
placeholder: "",
exampleName: "my-provider",
})
const template = handlebars.compile(readFileSync(providerTemplatePath).toString())
const frontmatterTitle = titleize(humanize(name))
return template({ name, frontmatterTitle, markdownReference, yaml, moduleOutputsReference })
}
const getInitialTitle = (pkg: any): string => {
const name = get('name', pkg) || 'MyDoc'
return titleize(humanize(name.replace(/^@.*\//, '')))
}
function Header({groupBy, group}) {
const slugger = new GithubSlugger();
switch(groupBy) {
case 'release':
return (
<li>
<h3>{titleize(group)}</h3>
</li>
);
break;
case 'type':
let icon = null;
let label = pluralize(titleize(group));
let textColor = null;
switch(group) {
case 'breaking change':
icon = 'alert-triangle';
textColor = 'danger';
break;
case 'enhancement':
const getInitialTitle = (pkg: any): string => {
const name = get(pkg, 'name') || 'MyDoc'
return titleize(humanize(removeScope(name)))
}
children={spacingProperties.map(prop => {
const props = properties[prop] || []
const resets = props.filter(v => v === '0')
return (
)
})}
/>
}),
prefix: "runtime.services",
placeholder: "",
exampleName: "my-service",
})
const taskOutputsReference = renderTemplateStringReference({
schema: TaskRuntimeContext.getSchema().keys({
outputs: getOutputsSchema(desc, "taskOutputsSchema").required(),
}),
prefix: "runtime.tasks",
placeholder: "",
exampleName: "my-tasks",
})
const frontmatterTitle = titleize(humanize(name))
const template = handlebars.compile(readFileSync(moduleTemplatePath).toString())
return template({
frontmatterTitle,
name,
docs,
markdownReference,
yaml,
hasOutputs: moduleOutputsReference || serviceOutputsReference || taskOutputsReference,
moduleOutputsReference,
serviceOutputsReference,
taskOutputsReference,
})
}
function Header({groupBy, group}) {
const slugger = new GithubSlugger();
switch(groupBy) {
case 'release':
return (
<li>
<h3>{titleize(group)}</h3>
</li>
);
break;
case 'type':
let icon = null;
let label = pluralize(titleize(group));
let textColor = null;
switch(group) {
case 'breaking change':
icon = 'alert-triangle';
textColor = 'danger';
break;
case 'enhancement':
icon = 'arrow-up-circle';
textColor = 'pink';
break;
case 'new feature':
icon = 'gift';
textColor = 'primary';
/*
* Parent Directory:
* Child Directory: File Path
*
* Basic:
* Getting Started: 'basic/getting-started.md'
*
*/
if (toc.hasOwnProperty(dir)) {
toc[dir] = Object.assign(toc[dir], {
[titleize(name)]: file
})
} else {
toc = Object.assign(toc, {
[titleize(dir)]: {
[titleize(name)]: file
}
})
}
})