Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update hasReact conditional (#982)

* Update hasReact conditional

- Prevent error when a dependency key doesn't exist
- Check `optionalDependencies`

* Update index.js

* Update scripts/prepare/index.js

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

authored by

Andy Richardson
Phil Pluckthun
and committed by
GitHub
c1e72a67 9208ad41

+1 -1
+1 -1
scripts/prepare/index.js
··· 7 7 const cwd = process.cwd(); 8 8 const workspaceRoot = path.resolve(__dirname, '../../'); 9 9 const pkg = require(path.resolve(cwd, 'package.json')); 10 - const hasReact = !!pkg.dependencies.react || !!pkg.peerDependencies.react; 10 + const hasReact = ['dependencies', 'optionalDependencies', 'peerDependencies'].some((dep) => dep in pkg && "react" in pkg[dep]); 11 11 12 12 const normalize = name => name 13 13 .replace(/[@\s\/\.]+/g, ' ')