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

less-cluster

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

less-cluster - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

49

lib/less-cluster.js

@@ -248,12 +248,15 @@ /**

This overrides the filesToProcess array derived from the
data passed to the _finishCollect method.
This augments the filesToProcess array derived from the
data passed to the _finishCollect method if additional consumers
are detected.
@method _filterAdHocFiles
@param {String[]} adHocFiles
@return {String[]} sorted array of file paths
@param {String[]} filesToProcess
@return {String[]} sorted array of file paths to read into cache
@private
**/
LessCluster.prototype._filterAdHocFiles = function (adHocFiles) {
var memo = {},
LessCluster.prototype._filterAdHocFiles = function (filesToProcess) {
"use strict";
var read = {},
mix = utils.mix,

@@ -263,14 +266,21 @@ parents = this._parents,

visit = function (nodes, visitor, memo) {
if (nodes) {
Object.keys(nodes).forEach(visitor, memo);
}
},
visitParents = function (node) {
if (node in parents) {
mix(memo, parents[node]);
Object.keys(parents[node]).forEach(visitParents);
mix(this, parents[node]);
visit(parents[node], visitParents, this);
}
},
// copy array to allow modification in loop
adHocFiles = filesToProcess.slice(),
i = 0,
len = adHocFiles.length,
file;
for (; i < len; i += 1) {
for (; i < adHocFiles.length; i += 1) {
file = adHocFiles[i];

@@ -280,17 +290,22 @@

// file is imported elsewhere
mix(memo, children[file]);
mix(read, children[file]);
Object.keys(children[file]).forEach(visitParents);
} else if (file in parents) {
// files that import this file need to be compiled as well
filesToProcess.push.apply(filesToProcess, Object.keys(children[file]));
visit(children[file], visitParents, read);
}
if (file in parents) {
// file imports other files
mix(memo, parents[file]);
mix(read, parents[file]);
Object.keys(parents[file]).forEach(visitParents);
visit(parents[file], visitParents, read);
}
// always read adHocFiles
memo[file] = true;
read[file] = true;
}
return Object.keys(memo).sort();
return Object.keys(read).sort();
};

@@ -297,0 +312,0 @@

{
"name": "less-cluster",
"version": "0.4.5",
"version": "0.4.6",
"description": "Parallel, directory-based execution of lessc.",

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

@@ -225,3 +225,3 @@ /*global describe, it, before, beforeEach, after, afterEach, chai, should, sinon */

"toFilter" : ["modules/parent.less"],
"toProcess": ["modules/parent.less"],
"toProcess": ["modules/parent.less", "base.less"],
"toRead" : [

@@ -240,6 +240,6 @@ "_variables.less",

"toProcess": [
"_variables.less"
// "modules/child.less",
// "modules/parent.less",
// "themes/fancy.less"
"_variables.less",
"modules/child.less",
"modules/parent.less",
"themes/fancy.less"
],

@@ -259,3 +259,3 @@ "toRead" : [

"toFilter" : ["themes/simple.less"],
"toProcess": ["themes/simple.less"],
"toProcess": ["themes/simple.less", "modules/child.less"],
"toRead" : [

@@ -262,0 +262,0 @@ "_variables.less",

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