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 2.1.1 to 3.0.0

102

lib/baby-tolk.js

@@ -10,4 +10,6 @@ 'use strict';

var extensionMap = {};
var loadedAdapters = [];
var extensionMap;
var loadedAdapters;
var targetExtension;
var sourceExtension;

@@ -30,52 +32,59 @@ // Whitelisted adapters

Object.keys(accord.all()).map(function (engine) {
if (adapters.indexOf(engine) === -1) {
return undefined;
}
try {
return accord.load(engine, global.babyTolkCompilerModulePath);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND' && e.message.indexOf('Cannot find module') === -1) {
console.error(e.message.replace(/^error: ?/i, 'Accord Error: ') + '. Try updating to the latest version');
function load() {
extensionMap = {};
loadedAdapters = [];
Object.keys(accord.all()).map(function (engine) {
if (adapters.indexOf(engine) === -1) {
return undefined;
}
// else {
// console.error('Missing adapter:', engine);
// }
}
}).filter(function (engine) {
return engine;
}).forEach(function (adapter) {
if (adapter.engineName === 'babel') {
// Monkey-patching Babel adapter so that it doesn't try and compile all .js files
adapter.extensions = ['jsx', 'es6', 'babel'];
}
loadedAdapters.push(adapter);
var extensions = adapter.extensions.map(function (extension) { return '.' + extension; });
extensions.forEach(function (extension) {
if (!Array.isArray(extensionMap[extension])) {
extensionMap[extension] = [];
try {
return accord.load(engine, global.babyTolkCompilerModulePath);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND' && e.message.indexOf('Cannot find module') === -1) {
console.error(e.message.replace(/^error: ?/i, 'Accord Error: ') + '. Try updating to the latest version');
}
// else {
// console.error('Missing adapter:', engine);
// }
}
}).filter(function (engine) {
return engine;
}).forEach(function (adapter) {
if (adapter.engineName === 'babel') {
// Monkey-patching Babel adapter so that it doesn't try and compile all .js files
adapter.extensions = ['jsx', 'es6', 'babel'];
}
loadedAdapters.push(adapter);
var extensions = adapter.extensions.map(function (extension) { return '.' + extension; });
extensionMap[extension].push(adapter);
extensions.forEach(function (extension) {
if (!Array.isArray(extensionMap[extension])) {
extensionMap[extension] = [];
}
extensionMap[extension].push(adapter);
});
});
});
var targetExtension = {};
var sourceExtension = {};
targetExtension = {};
sourceExtension = {};
Object.keys(extensionMap).forEach(function (sourceExt) {
var adapters = extensionMap[sourceExt];
var targetExt = '.' + adapters[0].output;
Object.keys(extensionMap).forEach(function (sourceExt) {
var adapters = extensionMap[sourceExt];
var targetExt = '.' + adapters[0].output;
targetExtension[sourceExt] = targetExt;
targetExtension[sourceExt] = targetExt;
if (!sourceExtension[targetExt]) {
sourceExtension[targetExt] = [];
}
if (!sourceExtension[targetExt]) {
sourceExtension[targetExt] = [];
}
sourceExtension[targetExt].push(sourceExt);
});
sourceExtension[targetExt].push(sourceExt);
});
}
load();

@@ -90,5 +99,12 @@ var dontCompile = function (pathName) {

module.exports = {
extensions: extensionMap,
sourceExtensionMap: sourceExtension,
targetExtensionMap: targetExtension,
get extensions() {
return extensionMap;
},
get sourceExtensionMap() {
return sourceExtension;
},
get targetExtensionMap() {
return targetExtension;
},
reload: load,
adapters: loadedAdapters,

@@ -95,0 +111,0 @@ isMinifiable: minify.isMinifiable,

{
"name": "baby-tolk",
"version": "2.1.1",
"version": "3.0.0",
"description": "A file reader that promises to translate non-web assets to web assets given the available transpilers, sourcemaps and all",

@@ -41,6 +41,6 @@ "main": "lib/baby-tolk.js",

"dependencies": {
"accord": "davej/accord#patch-1-build",
"clean-css": "^3.4.9",
"accord": "0.22.3",
"clean-css": "3.4.12",
"es6-promise": "^3.0.2",
"html-minifier": "^1.1.0",
"html-minifier": "2.1.0",
"uglify-js": "^2.6.1",

@@ -51,3 +51,3 @@ "when": "^3.7.5"

"LiveScript": "^1.3.1",
"babel": "^5.8.29",
"babel": "5.8.38",
"coco": "^0.9.1",

@@ -66,7 +66,7 @@ "coffee-script": "^1.10.0",

"myth": "^1.5.0",
"node-sass": "^3.4.2",
"stylus": "^0.52.4",
"node-sass": "3.6.0",
"stylus": "0.54.5",
"swig": "^1.4.2",
"unexpected": "^10.4.0"
"unexpected": "10.13.2"
}
}
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