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

dpacker

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dpacker - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

1

dist/index.js

@@ -1,2 +0,1 @@

#!/usr/bin/env node
"use strict";

@@ -3,0 +2,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

8

dist/unpack.js

@@ -141,3 +141,3 @@ var assert = require("assert");

var magicBindings = moduleWrapper.params.map(scan.getBinding);
var magicNames = ["module", "exports", "require"];
var magicNames = ["module", "exports", "$$dprequire$$"];
var edit = source ? multisplice(source) : null;

@@ -154,3 +154,7 @@ magicBindings.forEach(function (binding, i) {

});
return edit ? edit.toString() : null;
return edit
? edit.toString()
.replace(/\$\$dprequire\$\$\((\d+)\)/g, 'require("./$1.js")')
.replace(/\$\$dprequire\$\$/g, "require")
: null;
}

@@ -157,0 +161,0 @@ function getDependencies(moduleWrapper) {

{
"name": "dpacker",
"version": "1.2.5",
"version": "1.2.6",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -38,1 +38,9 @@ # DPacker

The files will be written into an `out` folder :)
## Features
Splits large webpack bundle files into their individual modules. Has de-duplication built in, but can be disabled with the `-d` flag.
Converts requires and module.exports to correct form, rather than webpack's (e, t, n) format
`require`s that point to a module ID will be mapped to `require("./moduleId.js")` for IDE compatibility, and should help with recompilation.
// webpack-unpack
// obtained from https://github.com/goto-bus-stop/webpack-unpack
// modified to allow for arrow functions & "use-strict" declarations
// modified to allow for arrow functions, "use-strict" declarations, & mapping require(123) to require("./123.js")

@@ -196,3 +196,3 @@ var assert = require("assert");

var magicBindings = moduleWrapper.params.map(scan.getBinding);
var magicNames = ["module", "exports", "require"];
var magicNames = ["module", "exports", "$$dprequire$$"];
var edit = source ? multisplice(source) : null;

@@ -204,3 +204,2 @@

if (ref === binding.definition) return;
ref.name = name;

@@ -211,3 +210,9 @@ if (edit) edit.splice(ref.start - offset, ref.end - offset, name);

return edit ? edit.toString() : null;
return edit
? edit.toString()
// replace $$dprequire$$(id) with require("./id.js")
.replace(/\$\$dprequire\$\$\((\d+)\)/g, 'require("./$1.js")')
// some requires are in a require.x = "..." format, so just turn these back to require
.replace(/\$\$dprequire\$\$/g, "require")
: null;
}

@@ -214,0 +219,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