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

babel-resolver

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

babel-resolver - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

example-app/views/MultipleFileExtensions.react.js

2

example-app/controllers/User.js

@@ -5,2 +5,3 @@ import assert from 'assert';

import UserList from 'views/UserList';
import MultipleFileExtensions from 'views/MultipleFileExtensions.react';

@@ -10,3 +11,4 @@ assert(utils === 'utils');

assert(UserList === 'UserList');
assert(MultipleFileExtensions === 'MultipleFileExtensions');
export default 'UserController';
v1.1.0 / 2016-09-13
===================
* version 1.1.0
* Multiple file extensions (#7)
v1.0.0 / 2016-08-20

@@ -3,0 +9,0 @@ ===================

12

lib/autoExtensionedPathExists.js

@@ -1,9 +0,11 @@

var extname = require('path').extname;
var pathExists = require('./pathExists');
module.exports = function autoExtensionedPathExists(pathOrFile, extensionsToTry) {
return pathExists(pathOrFile) ? true :
extname(pathOrFile).length ? false :
extensionsToTry.find(function (ext) { return pathExists(pathOrFile + ext); }) ? true :
false;
var findByExtension = function () {
return extensionsToTry.find(function (ext) {
return pathExists(pathOrFile + ext);
});
};
return pathExists(pathOrFile) || findByExtension();
};
{
"name": "babel-resolver",
"version": "1.0.0",
"version": "1.1.0",
"description": "Resolve modules from any directory.",

@@ -5,0 +5,0 @@ "main": "lib/createBabelResolver.js",

@@ -53,2 +53,10 @@ var assert = require('assert');

});
it('existing file with .react.js extension (multiple file extensions)', function () {
assert(pathExists(getFullPath('../example-app/views/MultipleFileExtensions.react.js')));
});
it('non-existing file with .react.js extension (multiple file extensions)', function () {
assert(!pathExists(getFullPath('../example-app/views/foo.react.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