Huge News!Announcing our $40M Series B led by Abstract Ventures.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 0.0.17 to 0.0.18

lib/findNodeModulesPaths.js

7

History.md
v0.0.17 / 2016-01-03
==================
v0.0.18 / 2016-01-05
====================
* v0.0.18
* search all node_modules paths
* changelog
* v0.0.17

@@ -6,0 +9,0 @@ * Merge pull request #3 from dotfold/fix/windows-path-separator

@@ -1,15 +0,11 @@

var findNodeModulesPath = require('./findNodeModulesPath');
var findNodeModulesPaths = require('./findNodeModulesPaths');
var resolveModuleSource = require('./resolveModuleSource');
module.exports = function createBabelResolver() {
var moduleDirsToCheck = Array.prototype.slice.call(arguments);
var nodeModulesPath = findNodeModulesPath(__dirname);
var nodeModulesPaths = findNodeModulesPaths(__dirname);
var moduleDirsToCheck = nodeModulesPaths.concat(Array.prototype.slice.call(arguments));
var extensionsToTry = ['.js', '.json', '.jsx'];
if (nodeModulesPath && moduleDirsToCheck.indexOf(nodeModulesPath) === -1) {
moduleDirsToCheck.unshift(nodeModulesPath);
}
return function (source) { return resolveModuleSource(source, moduleDirsToCheck, extensionsToTry); };
};
{
"name": "babel-resolver",
"version": "0.0.17",
"version": "0.0.18",
"description": "Resolve modules from any directory.",

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

var assert = require('assert');
var resolve = require('path').resolve;
var findNodeModulesPath = require('../lib/findNodeModulesPath');
var findNodeModulesPaths = require('../lib/findNodeModulesPaths');

@@ -9,6 +9,6 @@ function getFullPath(relativePath) {

describe('findNodeModulesPath()', function () {
describe('findNodeModulesPaths()', function () {
it('finds node_modules', function () {
assert(findNodeModulesPath(__dirname) === getFullPath('../node_modules'));
assert(findNodeModulesPaths(__dirname)[0] === getFullPath('../node_modules'));
});
});
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