New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dennisdigital/polaris-components-link

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dennisdigital/polaris-components-link - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

31

index.test.js

@@ -160,2 +160,33 @@ import React, { Fragment } from 'react';

});
/**
* Checks the target props
*/
it('checks target props', () => {
const component = mount(
<Router>
<Fragment>
<Route exact path="/" render={() => <Link href="test" target="_blank" />} />
</Fragment>
</Router>,
);
expect(component.find('a').prop('target')).toEqual('_blank');
expect(component.find('a').prop('rel')).toEqual('noopener noreferrer');
});
/**
* Checks the target props
*/
it('checks rel props', () => {
const component = mount(
<Router>
<Fragment>
<Route exact path="/" render={() => <Link href="test" rel="nofollow" />} />
</Fragment>
</Router>,
);
expect(component.find('a').prop('rel')).toEqual('nofollow');
});
});

13

Link.js

@@ -66,3 +66,10 @@ /**

{
children, href, onClick, loadStyles, extraClassNames, context: { cssPrefix, LinkComponent }, target,
children,
href,
onClick,
loadStyles,
extraClassNames,
context: { cssPrefix, LinkComponent },
target,
rel,
},

@@ -91,3 +98,3 @@ ) => {

target={target || '_blank'}
rel={target === '_blank' ? 'noopener noreferrer' : undefined}
rel={rel || ((target === '_blank') ? 'noopener noreferrer' : undefined)}
onClick={onClick}

@@ -132,2 +139,3 @@ className={classNames({

target: PropTypes.string,
rel: PropTypes.string,
};

@@ -143,4 +151,5 @@

target: '',
rel: '',
};
export default withPolaris(Link);

4

package.json
{
"name": "@dennisdigital/polaris-components-link",
"version": "1.0.12",
"version": "1.0.13",
"main": "index.js",

@@ -28,3 +28,3 @@ "license": "MIT",

},
"gitHead": "b5a8625fd1c846e18951b83f2f927fa6d77af710"
"gitHead": "e714a08ab9ff9284a6cb7d3921a413045593b31d"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc