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

baby-tolk

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

baby-tolk - npm Package Compare versions

Comparing version 4.5.0 to 5.0.0

40

lib/baby-tolk.js

@@ -8,2 +8,3 @@ 'use strict';

var Path = require('path');
var when = require('when');
var node = require('when/node');

@@ -160,7 +161,9 @@ var fs = node.liftAll(require('fs'));

var file = fs.readFile(pathName, 'utf8');
var sourceFile = fs.readFile(pathName, 'utf8');
var sourceFileContents = null;
var continuation = file.then(function(result) {
var continuation = sourceFile.then(function(result) {
var obj = { result: result };
if (options.inputSha) { obj.inputSha = createHash(result); }
sourceFileContents = result;
// if (options.inputSha) { obj.inputSha = createHash(result); }
return obj;

@@ -199,6 +202,35 @@ });

continuation.then(function(compiled) {
continuation = continuation.then(function(compiled) {
if (options.minify) { compiled = minify(compiled, options); }
if (options.outputSha) { compiled.outputSha = createHash(compiled.result); }
compiled.transformId = transformId === '' ? null : transformId;
if (options.inputSha) {
var inputSha;
if (compiled.sourcemap) {
inputSha = compiled.sourcemap.sources.map(function(path) {
if (path === pathName) {
return {
file: pathName,
sha: createHash(sourceFileContents)
};
} else {
return fs.readFile(path, 'utf8').then(function(content) {
return {
file: path,
sha: createHash(content)
};
});
}
});
} else {
inputSha = [{
file: pathName,
sha: createHash(sourceFileContents)
}];
}
return when.all(inputSha).then(function(inputSha) {
compiled.inputSha = inputSha;
return compiled;
});
}
return compiled;

@@ -205,0 +237,0 @@ });

2

package.json
{
"name": "baby-tolk",
"version": "4.5.0",
"version": "5.0.0",
"description": "A file reader that promises to translate non-web assets to web assets given the available transpilers, sourcemaps and all",

@@ -5,0 +5,0 @@ "main": "lib/baby-tolk.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