Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!fields) { fields = [] }
const packument = await libnpm.packument(spec, opts.concat({
fullMetadata: true
}))
const { rawSpec } = libnpm.parseArg(spec)
const options = {
packument,
fields,
spec: rawSpec && rawSpec !== '.' ? rawSpec : null,
json: opts.json
}
try {
const view = h(
fields.length ? PackageFields : PackageView,
options
)
console.log(renderToString(view))
} catch (e) {
opts.log.error('view', e.message)
opts.log.error('view', e.stack)
}
}
getIndicator(target) {
if (this.state[target].compiling) {
return h(Spinner, { yellow: true });
} else if (this.state[target].hasErrors) {
return h(Text, { red: true }, '✘');
} else {
return h(
Text,
!this.state[target].hasWarnings ? { green: true } : { yellow: true },
'✔︎'
);
}
}
static startRender(compilers) {
render(h(CompilationStatus, { compilers }));
}
getIndicator(target) {
if (this.state[target].compiling) {
return h(Spinner, { yellow: true });
} else if (this.state[target].hasErrors) {
return h(Text, { red: true }, '✘');
} else {
return h(
Text,
!this.state[target].hasWarnings ? { green: true } : { yellow: true },
'✔︎'
);
}
}
render(props, state) {
if (!this.state.parrot) {
return h(
'div',
null,
h(Spinner, { green: true }),
' Busy generating your parrot'
);
}
return h(Image, { src: `${this.state.parrot}` });
}
render() {
const props = blacklist(this.props, PROPS);
return h(Text, props, this.getString());
}
}
render() {
return h(
'div',
null,
this.getIndicator('web'),
' Client',
h('br'),
this.getIndicator('node'),
' Server',
h('br'),
h('br'),
h(Console, {
lines: 15,
logCatcher: logCatcher,
})
);
}
getIndicator(target) {
if (this.state[target].compiling) {
return h(Spinner, { yellow: true });
} else if (this.state[target].hasErrors) {
return h(Text, { red: true }, '✘');
} else {
return h(
Text,
!this.state[target].hasWarnings ? { green: true } : { yellow: true },
'✔︎'
);
}
}