Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vkontakte/graph-cache-js

Package Overview
Dependencies
Maintainers
6
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vkontakte/graph-cache-js - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

tests/fixtures/test-core.js

16

lib/parser.js

@@ -130,2 +130,10 @@ const Graph = require('graphlib').Graph;

function _addEdge(resolveName, g, filePath, edgePath) {
try {
if (require.resolve.paths(edgePath) === null) {
return;
}
} catch (err) {
}
return resolveName(filePath, edgePath).then(async (newName) => {

@@ -165,5 +173,5 @@ const exist = await fileExist(newName);

ExpressionStatement(node, state) {
const { expression } = node;
const { expression } = node;
if (node.expression.callee.name === 'require') {
if (expression && expression.callee && expression.callee.name === 'require') {
state.push(addEdge(filePath, expression.arguments[0].value));

@@ -173,5 +181,5 @@ }

VariableDeclaration(node, state) {
const expression = node.declarations[0].init;
const { init: expression } = node.declarations[0];
if (expression.callee && expression.callee.name === 'require') {
if (expression && expression.callee && expression.callee.name === 'require') {
state.push(addEdge(filePath, expression.arguments[0].value));

@@ -178,0 +186,0 @@ }

{
"name": "@vkontakte/graph-cache-js",
"version": "2.0.1",
"version": "2.1.0",
"description": "",

@@ -27,1 +27,2 @@ "main": "index.js",

}

@@ -210,3 +210,12 @@ /* eslint-env mocha */

});
it('supports core node js modules', () => {
return createGraphFromFile(createPath('test-core'), s, {})
.then((g) => verifyGraph(g, [
'test-core', 'test-core2'
], [
{ v: 'test-core2', w: 'test-core' }
]));
});
});
});
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