Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const defaultPlaceholderFn = ({ kind = 'nodejs:default', template }) => {
if (!template) {
// if the command didn't specify a template to start with, we
// will use one of the built-in placeholders, based on the
// kind of code being created
return placeholders[language(kind)]
} else {
// otherwise, we will open the editor showing a template file
return new Promise((resolve, reject) => {
const readViaImport = () => {
debug(
'readViaImport',
Util.findFile(template),
Util.findFile(template).replace(/^.*plugin-apache-composer\/samples(.*)$/, '$1')
)
resolve(
require('raw-loader!@kui-shell/plugin-apache-composer/samples' +
Util.findFile(template).replace(/^.*plugin-apache-composer\/samples(.*)$/, '$1')).default
)
}
const readViaFilesystem = () => {
const makePlaceholderCode = placeholderFn || (() => placeholder || placeholders[language(kind)])
const makePlaceholderCode = placeholderFn || (() => placeholder || placeholders[language(kind)])