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

turbo-carto

Package Overview
Dependencies
Maintainers
19
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turbo-carto - npm Package Compare versions

Comparing version 0.21.1 to 0.21.2

CHANGELOG.md.temp

4

CHANGELOG.md
# Changelog
## Version 0.21.2
Released 2019-06-12
- Fix crash when ramp fed with undefined argument #85
## Version 0.21.1

@@ -4,0 +8,0 @@ Released 2019-01-21

2

package.json
{
"name": "turbo-carto",
"version": "0.21.1",
"version": "0.21.2",
"description": "CartoCSS preprocessor",

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

@@ -191,4 +191,18 @@ 'use strict';

var method = (args[1] || 'quantiles').toLowerCase();
var numBuckets = values.getLength();
return getRamp(datasource, column, numBuckets, method).then(compatibilityCreateRampFn(values));
if (values.is(LazyFiltersResult)) {
var mapping = args[2];
var strategy = strategyFromMapping(mapping);
return values.getLength(column, strategy)
.then(function (numBuckets) {
return getRamp(datasource, column, numBuckets, method);
})
.then(compatibilityCreateRampFn(values));
} else {
var numBuckets = values.getLength();
return getRamp(datasource, column, numBuckets, method)
.then(compatibilityCreateRampFn(values));
}
}

@@ -195,0 +209,0 @@

@@ -19,1 +19,5 @@ 'use strict';

};
LazyFiltersResult.prototype.getLength = function (column, strategy) {
return this.get(column, strategy);
};

@@ -219,2 +219,29 @@ 'use strict';

});
it('should return an error if it receives an evil ramp (instead of unhandled exception)', function (done) {
// NOTE the missing first param (the column) in the ramp
var cartocss = [
'#layercat{',
' marker-width: ramp(, cartocolor(Safe), category(3));',
'}'
].join('\n');
var headtailsDatasource = new DummyDatasource(function () {
return {
ramp: [
'United States of America',
'Russia',
'China'
],
strategy: 'exact',
stats: { min_val: undefined, max_val: undefined, avg_val: undefined } };
});
turbocarto(cartocss, headtailsDatasource, function (err /*, result, metadata */) {
if (err) {
// We're expecting this error
assert.strictEqual(err.name, 'TurboCartoError');
assert.strictEqual(err.message, 'Failed to process "marker-width" property: column.replace is not a function');
done();
}
});
});
});
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