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 2.0.0 to 2.1.0

33

index.js

@@ -36,2 +36,16 @@ 'use strict';

function cacheFile(filePath, babel, contents, namespace) {
if (!namespace) {
return;
}
namespace = namespace === true ? 'default' : namespace;
if (!cache[namespace]) {
cache[namespace] = {};
}
cache[namespace][filePath] = {
babel: babel,
contents: contents
};
}
function clearCache() {

@@ -65,2 +79,10 @@ cache = {};

function getCached(filePath, namespace) {
namespace = namespace === true ? 'default' : namespace;
if (!namespace || !cache[namespace]) {
return null;
}
return cache[namespace][filePath];
}
function getFullPath(source, filename) {

@@ -80,4 +102,4 @@ var fullPath = source;

var cached = cache[filePath];
if (options.cache && cached && (!file.contents || cached.contents === file.contents)) {
var cached = getCached(filePath, options.cache);
if (cached && (!file.contents || cached.contents === file.contents)) {
// We have the file on cache and its contents didn't change.

@@ -98,8 +120,3 @@ return options.skipCachedFiles ? null : cached.babel;

var result = babel.transform(file.contents, currOptions);
if (options.cache) {
cache[filePath] = {
babel: result,
contents: file.contents
};
}
cacheFile(filePath, result, file.contents, options.cache);
return result;

@@ -106,0 +123,0 @@ }

{
"name": "babel-deps",
"version": "2.0.0",
"version": "2.1.0",
"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