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

@conduitry/defiler

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@conduitry/defiler - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.eslintrc.yaml

16

package.json
{
"name": "@conduitry/defiler",
"version": "0.0.1",
"version": "0.0.2",
"description": "A small, strange building block",
"main": "index.js",
"main": "./dist/index.cjs.js",
"module": "./src/index.es.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "rollup -c",
"eslint": "eslint",
"prettier": "prettier",
"lint": "eslint src",
"format": "prettier --write --print-width 160 --use-tabs --no-semi --single-quote --trailing-comma es5 \"src/**/*.js\""
},
"devDependencies": {
"eslint": "^3.19.0",
"prettier": "^1.2.2",
"rollup": "^0.41.6"
},
"repository": {

@@ -10,0 +20,0 @@ "type": "git",

22

src/Defiler.js
import EventEmitter from 'events'
import { readFile, stat } from 'fs.promise'
import { readFile, stat } from 'fs'
import { relative } from 'path'
import File from './File.js'

@@ -12,3 +13,2 @@

export default class Defiler extends EventEmitter {
constructor() {

@@ -45,3 +45,3 @@ super()

get origPaths() {
return [ ...(this._filePromises || this._origFiles).keys() ].sort()
return [...(this._filePromises || this._origFiles).keys()].sort()
}

@@ -54,3 +54,3 @@

this._gazes.push({ gaze, rootPath, read })
this._gazePromises.push(new Promise(resolve => gaze.on('ready', resolve)))
this._gazePromises.push(new Promise(res => gaze.on('ready', res)))
return this

@@ -93,4 +93,3 @@ }

this._checkBeforeExec('exec')
this._ready = new Promise(async resolve => {
this._ready = new Promise(async res => {
await Promise.all(this._gazePromises)

@@ -135,3 +134,3 @@ this._gazePromises = null

let origins = new Set()
for (let [ origin, deps ] of this._dependencies.entries()) {
for (let [origin, deps] of this._dependencies.entries()) {
if (deps.has(file.path)) {

@@ -148,3 +147,3 @@ origins.add(origin)

this._filePromises = null
resolve()
res()
})

@@ -166,3 +165,3 @@

} else {
this._dependencies.set(origin, new Set([ path ]))
this._dependencies.set(origin, new Set([path]))
}

@@ -215,3 +214,3 @@ }

async _processPhysicalFile(absolutePath, rootPath, read) {
let fileStat = await stat(absolutePath)
let fileStat = await new Promise((res, rej) => stat(absolutePath, (err, data) => (err ? rej(err) : res(data))))
if (!fileStat.isFile()) {

@@ -224,3 +223,3 @@ return

if (read) {
origFile.bytes = await readFile(absolutePath)
origFile.bytes = await new Promise((res, rej) => readFile(absolutePath, (err, data) => (err ? rej(err) : res(data))))
}

@@ -286,3 +285,2 @@ this._origFiles.set(path, origFile)

}
}
export default class File {
constructor(path) {

@@ -52,3 +51,2 @@ this.path = path

}
}
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