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

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.5.0 to 1.6.0

47

index.js

@@ -146,33 +146,32 @@ // builtin

function build_resolve_opts(opts, base) {
return {
paths: opts.paths,
extensions: opts.extensions,
basedir: base,
package: opts.package,
packageFilter: function (info, pkgdir) {
if (opts.packageFilter) info = opts.packageFilter(info, pkgdir);
var packageFilter = opts.packageFilter;
// support legacy browserify field
if (typeof info.browserify === 'string' && !info.browser) {
info.browser = info.browserify;
}
opts.basedir = base;
opts.packageFilter = function (info, pkgdir) {
if (packageFilter) info = packageFilter(info, pkgdir);
// no browser field, keep info unchanged
if (!info.browser) {
return info;
}
// support legacy browserify field
if (typeof info.browserify === 'string' && !info.browser) {
info.browser = info.browserify;
}
// replace main
if (typeof info.browser === 'string') {
info.main = info.browser;
return info;
}
// no browser field, keep info unchanged
if (!info.browser) {
return info;
}
var replace_main = info.browser[info.main || './index.js'] ||
info.browser['./' + info.main || './index.js'];
info.main = replace_main || info.main;
// replace main
if (typeof info.browser === 'string') {
info.main = info.browser;
return info;
}
var replace_main = info.browser[info.main || './index.js'] ||
info.browser['./' + info.main || './index.js'];
info.main = replace_main || info.main;
return info;
};
return opts;
}

@@ -179,0 +178,0 @@

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

@@ -5,0 +5,0 @@ "main": "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