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 3.0.0 to 3.0.1

4

dist/index.js
var M=Object.create;var d=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var O=r=>d(r,"__esModule",{value:!0});var D=(r,n)=>{O(r);for(var t in n)d(r,t,{get:n[t],enumerable:!0})},F=(r,n,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of _(n))!$.call(r,o)&&o!=="default"&&d(r,o,{get:()=>n[o],enumerable:!(t=k(n,o))||t.enumerable});return r},m=r=>F(O(d(r!=null?M(q(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);D(exports,{cleanCodeForParsing:()=>T,clearCacheUp:()=>v,create:()=>V,createEmitter:()=>R,findTopmostParents:()=>y,getChildrenModuleIds:()=>j,remove:()=>g,resolveAliases:()=>A,walk:()=>p});var E=m(require("fs")),h=m(require("path")),C=m(require("module")),x=m(require("es-module-lexer")),P=m(require("strip-comments")),b=m(require("filewatcher")),w=m(require("lodash")),S=/(?<![^;\n])[ ]*import(?:["'\s]*([\w*${}\n\r\t, ]+)\s*from\s*)?\s*["'](.*?)["']/gm,G=/(?<!\.)\bimport\((?:['"].+['"]|`[^$]+`)\)/gm;function R(){let r={};function n(i,c){r[i]&&r[i].forEach(e=>e(c)),r["*"]&&r["*"].forEach(e=>e(c))}function t(i,c){return r[i]=r[i]?r[i].concat(c):[c],()=>{r[i].splice(r[i].indexOf(c),1)}}function o(){r={}}function s(i){return r[i]||[]}return{clear:o,emit:n,on:t,listeners:s}}function A(r,n={}){for(let t of Object.keys(n))if(r.indexOf(t)===0)return(n[t]+r.replace(t,"")).replace(/\/+/g,"/");return r}function T(r){r=(0,P.default)(r);let n=[],t,o=new RegExp(S);for(;t=o.exec(r);)n.push(t);let s=new RegExp(G);for(;t=s.exec(r);)n.push(t);return n.map(([i])=>i).join(`
`)}async function j(r,n={}){let t=E.default.readFileSync(r,"utf-8"),o=[];try{o=(await(0,x.parse)(t))[0].map(s=>s.n)}catch{o=(await(0,x.parse)(T(t)))[0].map(i=>i.n)}return o.map(s=>{let i=(0,C.createRequire)(r),c;try{c=i.resolve(s)}catch{try{c=i.resolve(A(s,n.alias))}catch{c=require.resolve(s)}}return c===s?void 0:c}).filter(Boolean)}async function p(r,n,t={}){let o=/^\.(j|t)sx?$/.test(h.default.extname(r));n[r]=n[r]||{entry:!0,parents:[],children:[]};let s=n[r].children,i=o?await j(r,t):[],c=(0,w.difference)(s,i);for(let e of c)n[e].parents.splice(n[e].parents.indexOf(r),1),!n[e].parents.length&&!n[e].entry&&g(e,n);n[r].children=i;for(let e of n[r].children)n[e]=n[e]||{entry:!1,parents:[],children:[]},!n[e].parents.includes(r)&&(n[e].parents.push(r),await p(e,n,t));return n}function g(r,n){let{parents:t,children:o}=n[r];for(let s of t)n[s].children.splice(n[s].children.indexOf(r),1);for(let s of o)n[s].parents.splice(n[s].parents.indexOf(r),1),n[s].parents.length||g(s,n);delete n[r]}function v(r,n){delete require.cache[r];for(let t of n[r].parents)v(t,n)}function y(r,n,t=[]){if(t.includes(r))return t;let{entry:o,parents:s}=n[r];o&&t.push(r);for(let i of s)y(i,n,t);return t}function V(r={}){let n={},t=(0,b.default)(),o=R();function s(e){o.emit("error",e),o.listeners("error").length||console.error(e)}function i(e){return h.default.isAbsolute(e)?!0:(s(`Cannot add or remove relative path ${e}`),!1)}async function c(e){let a=t.list();if(a.includes(e))return;t.add(e);let l=Date.now();await new Promise((f,u)=>{let I=setInterval(()=>{t.list().length>a.length&&(clearInterval(I),f(!0)),Date.now()-l>2e3&&u(!1)},10)})}return t.on("change",async(e,a)=>{if(v(e,n),a.deleted){n[e].entry?o.emit("remove",[e]):o.emit("change",y(e,n)),t.remove(e);try{g(e,n)}catch(f){s(f)}}else{let l=Object.keys(n);try{await p(e,n,r)}catch(u){s(u)}let f=Object.keys(n);(0,w.difference)(l,f).forEach(u=>t.remove(u)),await Promise.all(f.map(c)),o.emit("change",y(e,n))}}),{get tree(){return Object.assign({},n)},on(e,a){return o.on(e,a)},onAdd(e){return o.on("add",e)},onRemove(e){return o.on("remove",e)},onChange(e){return o.on("change",e)},onError(e){return o.on("error",e)},close(){o.clear(),t.removeAll()},async add(e){let a=[].concat(e).filter(l=>!n[l]&&i(l));if(!!a.length){for(let l of a)try{await p(l,n,r)}catch(f){s(f)}await Promise.all(Object.keys(n).map(c)),o.emit("add",a)}},remove(e){let a=[].concat(e).filter(l=>n[l]&&i(l));for(let l of a)!n[l].entry||g(l,n);o.emit("remove",a)}}}0&&(module.exports={cleanCodeForParsing,clearCacheUp,create,createEmitter,findTopmostParents,getChildrenModuleIds,remove,resolveAliases,walk});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vaW5kZXgudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCBmcyBmcm9tICdmcydcbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXG5pbXBvcnQgeyBjcmVhdGVSZXF1aXJlIH0gZnJvbSAnbW9kdWxlJ1xuaW1wb3J0IHsgcGFyc2UgfSBmcm9tICdlcy1tb2R1bGUtbGV4ZXInXG4vLyBAdHMtaWdub3JlXG5pbXBvcnQgc3RyaXBDb21tZW50cyBmcm9tICdzdHJpcC1jb21tZW50cydcbi8vIEB0cy1pZ25vcmVcbmltcG9ydCBmaWxld2F0Y2hlciBmcm9tICdmaWxld2F0Y2hlcidcbmltcG9ydCB7IGRpZmZlcmVuY2UgfSBmcm9tICdsb2Rhc2gnXG5cbmV4cG9ydCB0eXBlIEFsaWFzID0geyBbYWxpY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yxDQUNoRCxNQUFPLEdBQVEsR0FBRyxRQUFTLElBRTdCLE9BQVEsQ0FDTixFQUFRLFFBQ1IsRUFBUSxrQkFFSixLQUFJLEVBQThCLENBQ3RDLEdBQU0sR0FBUyxHQUFnQixPQUFPLEdBQVcsT0FBTyxBQUFDLEdBQU8sQ0FBQyxFQUFLLElBQU8sRUFBZSxJQUU1RixHQUFJLEVBQUMsRUFBTSxPQUVYLFFBQVcsS0FBUSxHQUNqQixHQUFJLENBQ0YsS0FBTSxHQUFLLEVBQU0sRUFBTSxTQUNoQixFQUFQLENBQ0EsRUFBWSxHQUloQixLQUFNLFNBQVEsSUFBSSxPQUFPLEtBQUssR0FBTSxJQUFJLElBRXhDLEVBQVEsS0FBSyxNQUFPLEtBRXRCLE9BQU8sRUFBOEIsQ0FDbkMsR0FBTSxHQUFTLEdBQWdCLE9BQU8sR0FBVyxPQUFPLEFBQUMsR0FBTyxFQUFLLElBQU8sRUFBZSxJQUUzRixPQUFXLEtBQVEsR0FDakIsQUFBSSxDQUFDLEVBQUssR0FBTSxPQUVoQixFQUFPLEVBQU0sR0FHZixFQUFRLEtBQUssU0FBVSIsCiAgIm5hbWVzIjogW10KfQo=
`)}async function j(r,n={}){let t=E.default.readFileSync(r,"utf-8"),o=[];try{o=(await(0,x.parse)(t))[0].map(s=>s.n)}catch{o=(await(0,x.parse)(T(t)))[0].map(i=>i.n)}return o.map(s=>{let i=(0,C.createRequire)(r),c;try{c=i.resolve(s)}catch{try{c=i.resolve(A(s,n.alias))}catch{c=require.resolve(s)}}return c===s?void 0:c}).filter(Boolean)}async function p(r,n,t={}){let o=/^\.(j|t)sx?$/.test(h.default.extname(r));n[r]=n[r]||{entry:!0,parents:[],children:[]};let s=n[r].children,i=o?await j(r,t):[],c=(0,w.difference)(s,i);for(let e of c)n[e].parents.splice(n[e].parents.indexOf(r),1),!n[e].parents.length&&!n[e].entry&&g(e,n);n[r].children=i;for(let e of n[r].children)n[e]=n[e]||{entry:!1,parents:[],children:[]},!n[e].parents.includes(r)&&(n[e].parents.push(r),await p(e,n,t));return n}function g(r,n){let{parents:t,children:o}=n[r];for(let s of t)n[s].children.splice(n[s].children.indexOf(r),1);for(let s of o)!n[s]||(n[s].parents.splice(n[s].parents.indexOf(r),1),n[s].parents.length||g(s,n));delete n[r]}function v(r,n){delete require.cache[r];for(let t of n[r].parents)v(t,n)}function y(r,n,t=[]){if(t.includes(r))return t;let{entry:o,parents:s}=n[r];o&&t.push(r);for(let i of s)y(i,n,t);return t}function V(r={}){let n={},t=(0,b.default)(),o=R();function s(e){o.emit("error",e),o.listeners("error").length||console.error(e)}function i(e){return h.default.isAbsolute(e)?!0:(s(`Cannot add or remove relative path ${e}`),!1)}async function c(e){let a=t.list();if(a.includes(e))return;t.add(e);let l=Date.now();await new Promise((f,u)=>{let I=setInterval(()=>{t.list().length>a.length&&(clearInterval(I),f(!0)),Date.now()-l>2e3&&u(!1)},10)})}return t.on("change",async(e,a)=>{if(v(e,n),a.deleted){n[e].entry?o.emit("remove",[e]):o.emit("change",y(e,n)),t.remove(e);try{g(e,n)}catch(f){s(f)}}else{let l=Object.keys(n);try{await p(e,n,r)}catch(u){s(u)}let f=Object.keys(n);(0,w.difference)(l,f).forEach(u=>t.remove(u)),await Promise.all(f.map(c)),o.emit("change",y(e,n))}}),{get tree(){return Object.assign({},n)},on(e,a){return o.on(e,a)},onAdd(e){return o.on("add",e)},onRemove(e){return o.on("remove",e)},onChange(e){return o.on("change",e)},onError(e){return o.on("error",e)},close(){o.clear(),t.removeAll()},async add(e){let a=[].concat(e).filter(l=>!n[l]&&i(l));if(!!a.length){for(let l of a)try{await p(l,n,r)}catch(f){s(f)}await Promise.all(Object.keys(n).map(c)),o.emit("add",a)}},remove(e){let a=[].concat(e).filter(l=>n[l]&&i(l));for(let l of a)!n[l].entry||g(l,n);o.emit("remove",a)}}}0&&(module.exports={cleanCodeForParsing,clearCacheUp,create,createEmitter,findTopmostParents,getChildrenModuleIds,remove,resolveAliases,walk});
//# s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IsT0FBTyxFQUE4QixDQUNuQyxHQUFNLEdBQVMsR0FBZ0IsT0FBTyxHQUFXLE9BQU8sQUFBQyxHQUFPLEVBQUssSUFBTyxFQUFlLElBRTNGLE9BQVcsS0FBUSxHQUNqQixBQUFJLENBQUMsRUFBSyxHQUFNLE9BRWhCLEVBQU8sRUFBTSxHQUdmLEVBQVEsS0FBSyxTQUFVIiwKICAibmFtZXMiOiBbXQp9Cg==

@@ -185,2 +185,7 @@ import fs from 'fs'

for (const fp of children) {
if (!tree[fp]) {
// child may already have been taken care of
continue
}
tree[fp].parents.splice(tree[fp].parents.indexOf(filepath), 1)

@@ -187,0 +192,0 @@

{
"name": "watch-dependency-graph",
"version": "3.0.0",
"version": "3.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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