Socket
Socket
Sign inDemoInstall

browser-resolve

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-resolve - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

test/fixtures/node_modules/false/fake.js

4

index.js

@@ -177,3 +177,5 @@ // builtin

var replace_main = info.browser[info.main || './index.js'];
var replace_main = info.browser[info.main || './index.js'] ||
info.browser['./' + info.main || './index.js'];
info.main = replace_main || info.main;

@@ -180,0 +182,0 @@ return info;

{
"name": "browser-resolve",
"version": "1.2.3",
"version": "1.2.4",
"description": "resolve which handles browser field support in package.json",

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

@@ -64,2 +64,14 @@ var assert = require('assert');

// package.json has browser field as object
// one of the keys replaces the main file
// however the main has no prefix and browser uses ./ prefix for the same file
test('object browser field as main', function(done) {
resolve('module-k', { paths: [ fixtures_dir ], package: { main: 'fixtures' } }, function(err, path, pkg) {
assert.ifError(err);
assert.equal(path, require.resolve('./fixtures/node_modules/module-k/browser'));
assert.equal(pkg.main, './browser.js');
done();
});
});
// browser field in package.json maps ./foo.js -> ./browser.js

@@ -66,0 +78,0 @@ // when we resolve ./foo while in module-e, this mapping should take effect

Sorry, the diff of this file is not supported yet

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