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

watch-dependency-graph

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

watch-dependency-graph - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

26

index.js

@@ -96,14 +96,2 @@ const path = require('path')

init()
// const pointer = ids.indexOf(f)
// // delete from ids and register
// ids.splice(pointer, 1)
// delete register[f]
// // remove any references
// for (const filepath of Object.keys(register)) {
// const { entries, children } = register[filepath]
// entries.splice(entries.indexOf(pointer), 1)
// children.splice(children.indexOf(pointer), 1)
// }
} else {

@@ -114,5 +102,5 @@ watcher.unwatch(f)

const updatedFilepath = require.resolve(f)
const { entries } = register[updatedFilepath]
const { entries, children } = register[updatedFilepath]
const prev = require.cache[updatedFilepath]
const prev = require.cache[updatedFilepath] || require(updatedFilepath)
delete require.cache[updatedFilepath]

@@ -123,4 +111,4 @@ require(updatedFilepath)

// diff prev/next
const removedModuleIds = prev.children
.filter(c => !next.children.find(_c => _c.id === c.id))
const removedModuleIds = (prev.children || [])
.filter(c => !(next.children || []).find(_c => _c.id === c.id))
.map(c => c.id)

@@ -130,3 +118,3 @@

next.children
.filter(c => !prev.children.find(_c => _c.id === c.id))
.filter(c => !(prev.children || []).find(_c => _c.id === c.id))
.forEach(c => watcher.add(c.id))

@@ -179,2 +167,6 @@

const parentFile = ids[entryPointer]
// clear entries so users can re-require
delete require.cache[parentFile]
walk(

@@ -181,0 +173,0 @@ next.children,

{
"name": "watch-dependency-graph",
"version": "0.1.0",
"version": "0.2.0",
"description": "",

@@ -17,5 +17,12 @@ "main": "index.js",

},
"keywords": [],
"author": "",
"license": "ISC",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/sure-thing/watch-dependency-graph.git"
},
"author": "estrattonbailey",
"license": "MIT",
"bugs": {
"url": "https://github.com/sure-thing/watch-dependency-graph/issues"
},
"homepage": "https://github.com/sure-thing/watch-dependency-graph#readme",
"dependencies": {

@@ -22,0 +29,0 @@ "@arr/unique": "^1.0.1",

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