Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default ({ children, scopes, roles }: Object): React.Node => {
const checks = {
scopes: scopes ? hasScopes(scopes) : true,
roles: roles ? hasRoles(roles) : true
};
if (typeof children === "function") {
return children(checks);
}
return checks.scopes && checks.roles ? children : null;
};