Socket
Socket
Sign inDemoInstall

varlessify

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

varlessify - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

test/import/definition.json

6

index.js

@@ -51,3 +51,4 @@ var fs = require('fs');

}
var variable = tree.variable('@' + variableName);
var evalTree = tree.eval(new less.tree.evalEnv({}, [tree]));
var variable = evalTree.variable('@' + variableName);
if (variable == null) {

@@ -57,3 +58,4 @@ stream.emit('error', new Error('variable @' + variableName + ' is undefined'));

}
var evalEnv = new less.tree.evalEnv({}, [tree]);
var evalEnv = new less.tree.evalEnv({}, [evalTree]);
var value = variable.eval(evalEnv).value.toCSS(evalEnv);

@@ -60,0 +62,0 @@ stream.push(JSON.stringify(value));

{
"name": "varlessify",
"version": "0.0.1",
"version": "0.0.2",
"description": "Browserify transform to require LESS variable values into your JS",

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

@@ -31,2 +31,29 @@ var assert = require('chai').assert;

it('should pull top-level less variables imported from other less files', function (done) {
var definition = require('./import/definition.json');
browserify()
.add('./test/import/script.js')
.transform(varlessify, { file: './test/import/main.less' })
.bundle(function (err, src) {
if (err) { assert.ok(false, err); }
vm.runInNewContext(src, { console: { log: log(definition.expected) }});
done();
});
});
it('should pull top-level less variables imported from other less files based on the paths config', function (done) {
var definition = require('./paths-config/definition.json');
browserify()
.add('./test/paths-config/script.js')
.transform(varlessify, {
file: './test/paths-config/main.less',
paths: ['./test/paths-config/mysterious-folder', './test/paths-config/magnificent-folder']
})
.bundle(function (err, src) {
if (err) { assert.ok(false, err); }
vm.runInNewContext(src, { console: { log: log(definition.expected) }});
done();
});
});
it('should error if no less file is specified', function (done) {

@@ -33,0 +60,0 @@ browserify()

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