forked from sombochea/verdaccio-ui
chore: enable optional chaining and nullish (#306)
This commit is contained in:
committed by
Priscila Oliveira
parent
58cf730b98
commit
0a48906fc8
@@ -13,7 +13,7 @@ import node from './img/node.png';
|
||||
const Engine: React.FC = () => {
|
||||
const { packageMeta } = useContext(DetailContext);
|
||||
|
||||
const engines = packageMeta && packageMeta.latest && packageMeta.latest.engines;
|
||||
const engines = packageMeta?.latest?.engines;
|
||||
|
||||
if (!engines || (!engines.node && !engines.npm)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user