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

babel-deps

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-deps - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

28

index.js

@@ -35,15 +35,9 @@ 'use strict';

function fetchDependency(source, filename) {
var dep = source;
if (dep.substr(dep.length - 3) !== '.js') {
dep += '.js';
}
if (dep[0] === '.') {
dep = path.resolve(path.dirname(filename), dep);
}
if (!hasFile[dep]) {
var fullPath = getFullPath(source, filename);
if (!hasFile[fullPath]) {
filesToCompile.push({
contents: fs.readFileSync(dep, 'utf8'),
options: {filename: dep}
contents: fs.readFileSync(fullPath, 'utf8'),
options: {filename: fullPath}
});
hasFile[dep] = true;
hasFile[fullPath] = true;
}

@@ -53,2 +47,13 @@ return source;

function getFullPath(source, filename) {
var fullPath = source;
if (fullPath.substr(fullPath.length - 3) !== '.js') {
fullPath += '.js';
}
if (fullPath[0] === '.') {
fullPath = path.resolve(path.dirname(filename), fullPath);
}
return fullPath;
}
function normalizeOptions(options) {

@@ -67,1 +72,2 @@ if (options.resolveModuleSource) {

module.exports = compileFiles;
module.exports.getFullPath = getFullPath;
{
"name": "babel-deps",
"version": "0.1.0",
"version": "0.1.1",
"description": "Compiles javascript files and all their dependencies with babel.",

@@ -5,0 +5,0 @@ "license": "MIT",

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