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

es6-deps

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-deps - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

36

index.js

@@ -22,2 +22,12 @@ 'use strict';

function suffix_path(p) {
var pt;
var _arr = ['', '.js', '.jsx', '.es6'];
for (var _i = 0; _i < _arr.length; _i++) {
var suffix = _arr[_i];
var pt = p + suffix;
if (fs.existsSync(pt)) return pt;
}
}
function _resolve(current, relpath) {

@@ -32,15 +42,16 @@ var dirname = path.dirname(current);

var p = parts.join('/');
if (fs.existsSync(path.join(p, 'node_modules'))) {
nmdir = path.join(p, 'node_modules');
break;
var temp = suffix_path(path.join(p, 'node_modules', relpath));
if (temp) {
if (!isdir(temp)) return temp;else {
nmdir = temp;
break;
}
}
parts.pop();
}
if (!nmdir) throw new Error('cannot find node_modules from ', current, ' when requiring ', relpath);
var file = path.join(nmdir, relpath);
if (!isdir(file)) return file;
var pkg = require(path.join(file, 'package.json'));
if (!nmdir) throw new Error('cannot parse ' + relpath + ' when processing ' + current);
var pkg = require(path.join(nmdir, 'package.json'));
var main = pkg.main || "index";
return path.join(file, main);
return path.join(nmdir, main);
}

@@ -50,9 +61,4 @@

var p = _resolve(current, filepath);
var pt;
var _arr = ['', '.js', '.jsx', '.es6'];
for (var _i = 0; _i < _arr.length; _i++) {
var suffix = _arr[_i];
var pt = p + suffix;
if (fs.existsSync(pt)) return pt;
}
var pt = suffix_path(p);
if (pt) return pt;
throw new Error(p + " not exist when processing " + current + " and requiring " + filepath);

@@ -59,0 +65,0 @@ }

{
"name": "es6-deps",
"version": "1.0.4",
"version": "1.0.5",
"description": "a simple util to get es6/jsx dependencies",

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

@@ -17,2 +17,10 @@ var isdir = require('isdir');

function suffix_path(p) {
var pt;
for (let suffix of ['', '.js', '.jsx', '.es6']) {
var pt = p + suffix;
if (fs.existsSync(pt)) return pt;
}
}
function _resolve(current, relpath) {

@@ -27,15 +35,17 @@ var dirname = path.dirname(current);

var p = parts.join('/');
if (fs.existsSync(path.join(p, 'node_modules'))) {
nmdir = path.join(p, 'node_modules');
break;
var temp = suffix_path(path.join(p, 'node_modules', relpath));
if (temp) {
if (!isdir(temp)) return temp;
else {
nmdir = temp;
break;
}
}
parts.pop();
}
if (!nmdir) throw new Error('cannot find node_modules from ', current, ' when requiring ', relpath);
var file = path.join(nmdir, relpath);
if (!isdir(file)) return file;
var pkg = require(path.join(file, 'package.json'));
if (!nmdir) throw new Error('cannot parse ' + relpath + ' when processing ' + current);
var pkg = require(path.join(nmdir, 'package.json'));
var main = pkg.main || "index";
return path.join(file, main);
return path.join(nmdir, main);
}

@@ -45,7 +55,4 @@

var p = _resolve(current, filepath);
var pt;
for (let suffix of ['', '.js', '.jsx', '.es6']) {
var pt = p + suffix;
if (fs.existsSync(pt)) return pt;
}
var pt = suffix_path(p);
if (pt) return pt;
throw new Error(p + " not exist when processing " + current + " and requiring " + filepath);

@@ -52,0 +59,0 @@ }

require('babel/register');
var assert = require('assert');
var Dep = require('../');
var Dep = require('../src');
var file = function (name) {

@@ -5,0 +5,0 @@ return __dirname + "/files/" + name;

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