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

@putout/compare

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/compare - npm Package Compare versions

Comparing version 9.10.0 to 9.11.0

2

lib/comparators.js

@@ -14,2 +14,3 @@ 'use strict';

isJSXChildren,
isJSXAttributes,
isLinkedArgs,

@@ -54,2 +55,3 @@ isLinkedId,

second(isJSXChildren),
second(isJSXAttributes),
addObject,

@@ -56,0 +58,0 @@ compareArrays,

@@ -14,2 +14,4 @@ 'use strict';

isJSXText,
isJSXIdentifier,
isJSXAttribute,
} = require('@babel/types');

@@ -25,2 +27,3 @@

const JSX_CHILDREN = '__jsx_children';
const JSX_ATTRIBUTES = '__jsx_attributes';
const NOP = '__nop';

@@ -39,2 +42,3 @@ const ANY = '__';

JSX_CHILDREN,
JSX_ATTRIBUTES,
IMPORTS,

@@ -129,2 +133,11 @@ BODY,

module.exports.isJSXAttributes = (a) => {
if (!isJSXAttribute(a))
return false;
return isJSXIdentifier(a.name, {
name: JSX_ATTRIBUTES,
});
};
module.exports.isLinkedId = (a, b) => {

@@ -229,2 +242,5 @@ if (!isIdentifier(b) || !LINKED_ID.test(b.name))

if (isJSXIdentifier(a) && LINKED_NODE.test(a.name))
return true;
if (isTemplateElement(a) && LINKED_NODE.test(a.value.raw))

@@ -231,0 +247,0 @@ return true;

2

lib/vars.js

@@ -57,3 +57,3 @@ 'use strict';

noScope: true,
'Identifier|StringLiteral|TemplateElement|RegExpLiteral|JSXText'(path) {
'Identifier|StringLiteral|TemplateElement|RegExpLiteral|JSXText|JSXAttribute'(path) {
const {node} = path;

@@ -60,0 +60,0 @@ const way = [];

{
"name": "@putout/compare",
"version": "9.10.0",
"version": "9.11.0",
"type": "commonjs",

@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

@@ -191,2 +191,13 @@ # @putout/compare [![NPM version][NPMIMGURL]][NPMURL]

##### __jsx_attributes
Any count of attributes of `JSXElement`:
```js
compare('<div hello="world"></div>', '<__a __jsx_attributes/>');
// returns
true;
```
##### __nop

@@ -193,0 +204,0 @@

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