turbo-carto
Advanced tools
Comparing version 0.21.0 to 0.21.1
# Changelog | ||
## Version 0.21.1 | ||
Released 2019-01-21 | ||
- Update dev deps: | ||
- mocha@5.2.0 | ||
- semistandard@13.0.1 | ||
- semistandard-format@3.0.0 | ||
## Version 0.21.0 | ||
@@ -4,0 +12,0 @@ Released 2018-11-21 |
@@ -43,5 +43,5 @@ 'use strict'; | ||
].join('\n'); | ||
var q = format(sql, {column: column, sql: query, buckets: buckets}); | ||
var q = format(sql, { column: column, sql: query, buckets: buckets }); | ||
request('http://development.localhost.lan:8080/api/v1/sql?' + qs.stringify({q: q}), function (err, response, body) { | ||
request('http://development.localhost.lan:8080/api/v1/sql?' + qs.stringify({ q: q }), function (err, response, body) { | ||
if (!err && response.statusCode === 200) { | ||
@@ -48,0 +48,0 @@ var result = JSON.parse(body).rows[0]; |
{ | ||
"name": "turbo-carto", | ||
"version": "0.21.0", | ||
"version": "0.21.1", | ||
"description": "CartoCSS preprocessor", | ||
@@ -15,3 +15,4 @@ "main": "src/index.js", | ||
"contributors": [ | ||
"Raul Ochoa <rochoa@cartodb.com>" | ||
"Raul Ochoa <rochoa@cartodb.com>", | ||
"Daniel García Aubert <dgaubert@carto.com>" | ||
], | ||
@@ -36,7 +37,7 @@ "license": "BSD-3-Clause", | ||
"jshint": "^2.9.1-rc2", | ||
"mocha": "^2.3.4", | ||
"mocha": "^5.2.0", | ||
"querystring": "^0.2.0", | ||
"request": "^2.67.0", | ||
"semistandard": "^7.0.4", | ||
"semistandard-format": "^2.1.0", | ||
"semistandard": "^13.0.1", | ||
"semistandard-format": "^3.0.0", | ||
"yargs": "^3.31.0" | ||
@@ -43,0 +44,0 @@ }, |
@@ -227,3 +227,3 @@ 'use strict'; | ||
new TurboCartoError( | ||
'invalid ramp length, got ' + filters.getLength() + ' values, expected ' + numBuckets | ||
'invalid ramp length, got ' + filters.getLength() + ' values, expected ' + numBuckets | ||
) | ||
@@ -230,0 +230,0 @@ ); |
@@ -19,2 +19,1 @@ 'use strict'; | ||
}; | ||
@@ -22,12 +22,12 @@ 'use strict'; | ||
assert.ifError(err); | ||
assert.equal(metadata.rules.length, 1); | ||
assert.strictEqual(metadata.rules.length, 1); | ||
var rule = metadata.rules[0]; | ||
assert.equal(rule.selector, '#layer'); | ||
assert.equal(rule.prop, 'marker-width'); | ||
assert.equal(rule.column, 'pop_max'); | ||
assert.equal(rule.buckets.length, 5); | ||
assert.strictEqual(rule.selector, '#layer'); | ||
assert.strictEqual(rule.prop, 'marker-width'); | ||
assert.strictEqual(rule.column, 'pop_max'); | ||
assert.strictEqual(rule.buckets.length, 5); | ||
assert.equal(rule.stats.filter_avg, 322717); | ||
assert.strictEqual(rule.stats.filter_avg, 322717); | ||
@@ -42,3 +42,3 @@ var expectedBuckets = [ | ||
assert.deepEqual(rule.buckets, expectedBuckets); | ||
assert.deepStrictEqual(rule.buckets, expectedBuckets); | ||
@@ -63,12 +63,12 @@ done(); | ||
assert.ifError(err); | ||
assert.equal(metadata.rules.length, 1); | ||
assert.strictEqual(metadata.rules.length, 1); | ||
var rule = metadata.rules[0]; | ||
assert.equal(rule.selector, '#layer'); | ||
assert.equal(rule.prop, 'marker-width'); | ||
assert.equal(rule.column, 'pop_max'); | ||
assert.equal(rule.buckets.length, 1); | ||
assert.strictEqual(rule.selector, '#layer'); | ||
assert.strictEqual(rule.prop, 'marker-width'); | ||
assert.strictEqual(rule.column, 'pop_max'); | ||
assert.strictEqual(rule.buckets.length, 1); | ||
assert.equal(rule.stats.filter_avg, 8); | ||
assert.strictEqual(rule.stats.filter_avg, 8); | ||
@@ -79,3 +79,3 @@ var expectedBuckets = [ | ||
assert.deepEqual(rule.buckets, expectedBuckets); | ||
assert.deepStrictEqual(rule.buckets, expectedBuckets); | ||
@@ -101,12 +101,12 @@ done(); | ||
assert.ifError(err); | ||
assert.equal(metadata.rules.length, 1); | ||
assert.strictEqual(metadata.rules.length, 1); | ||
var rule = metadata.rules[0]; | ||
assert.equal(rule.selector, '#layerheads'); | ||
assert.equal(rule.prop, 'marker-width'); | ||
assert.equal(rule.column, 'pop_max'); | ||
assert.equal(rule.buckets.length, 5); | ||
assert.strictEqual(rule.selector, '#layerheads'); | ||
assert.strictEqual(rule.prop, 'marker-width'); | ||
assert.strictEqual(rule.column, 'pop_max'); | ||
assert.strictEqual(rule.buckets.length, 5); | ||
assert.equal(rule.stats.filter_avg, 322717); | ||
assert.strictEqual(rule.stats.filter_avg, 322717); | ||
@@ -121,3 +121,3 @@ var expectedBuckets = [ | ||
assert.deepEqual(rule.buckets, expectedBuckets); | ||
assert.deepStrictEqual(rule.buckets, expectedBuckets); | ||
@@ -143,12 +143,12 @@ done(); | ||
assert.ifError(err); | ||
assert.equal(metadata.rules.length, 1); | ||
assert.strictEqual(metadata.rules.length, 1); | ||
var rule = metadata.rules[0]; | ||
assert.equal(rule.selector, '#layerheads'); | ||
assert.equal(rule.prop, 'marker-width'); | ||
assert.equal(rule.column, 'pop_max'); | ||
assert.equal(rule.buckets.length, 1); | ||
assert.strictEqual(rule.selector, '#layerheads'); | ||
assert.strictEqual(rule.prop, 'marker-width'); | ||
assert.strictEqual(rule.column, 'pop_max'); | ||
assert.strictEqual(rule.buckets.length, 1); | ||
assert.equal(rule.stats.filter_avg, 100); | ||
assert.strictEqual(rule.stats.filter_avg, 100); | ||
@@ -159,3 +159,3 @@ var expectedBuckets = [ | ||
assert.deepEqual(rule.buckets, expectedBuckets); | ||
assert.deepStrictEqual(rule.buckets, expectedBuckets); | ||
@@ -189,12 +189,12 @@ done(); | ||
assert.ifError(err); | ||
assert.equal(metadata.rules.length, 1); | ||
assert.strictEqual(metadata.rules.length, 1); | ||
var rule = metadata.rules[0]; | ||
assert.equal(rule.selector, '#layercat'); | ||
assert.equal(rule.prop, 'marker-width'); | ||
assert.equal(rule.column, 'adm0name'); | ||
assert.equal(rule.buckets.length, 9); | ||
assert.strictEqual(rule.selector, '#layercat'); | ||
assert.strictEqual(rule.prop, 'marker-width'); | ||
assert.strictEqual(rule.column, 'adm0name'); | ||
assert.strictEqual(rule.buckets.length, 9); | ||
assert.equal(rule.stats.filter_avg, undefined); | ||
assert.strictEqual(rule.stats.filter_avg, undefined); | ||
@@ -213,3 +213,3 @@ var expectedBuckets = [ | ||
assert.deepEqual(rule.buckets, expectedBuckets); | ||
assert.deepStrictEqual(rule.buckets, expectedBuckets); | ||
@@ -216,0 +216,0 @@ done(); |
@@ -50,3 +50,3 @@ 'use strict'; | ||
assert.equal(result, scenario.expectedCartocss); | ||
assert.strictEqual(result, scenario.expectedCartocss); | ||
done(); | ||
@@ -169,4 +169,4 @@ }); | ||
assert.equal(metadata.rules[0].buckets.length, scenario.numBuckets); | ||
assert.deepEqual(metadata.rules[0].buckets, scenario.expectedBuckets); | ||
assert.strictEqual(metadata.rules[0].buckets.length, scenario.numBuckets); | ||
assert.deepStrictEqual(metadata.rules[0].buckets, scenario.expectedBuckets); | ||
done(); | ||
@@ -173,0 +173,0 @@ }); |
@@ -153,3 +153,3 @@ 'use strict'; | ||
} | ||
assert.equal(cartocssResult, scenario.expectedCartocss()); | ||
assert.strictEqual(cartocssResult, scenario.expectedCartocss()); | ||
done(); | ||
@@ -167,3 +167,3 @@ }); | ||
} | ||
assert.equal(cartocssResult, scenario.expectedCartocss()); | ||
assert.strictEqual(cartocssResult, scenario.expectedCartocss()); | ||
done(); | ||
@@ -185,3 +185,3 @@ }); | ||
} | ||
assert.equal(cartocssResult, scenario.expectedCartocss(mapping)); | ||
assert.strictEqual(cartocssResult, scenario.expectedCartocss(mapping)); | ||
done(); | ||
@@ -188,0 +188,0 @@ }); |
@@ -256,3 +256,3 @@ 'use strict'; | ||
} | ||
assert.equal(cartocssResult, scenario.expectedCartocss); | ||
assert.strictEqual(cartocssResult, scenario.expectedCartocss); | ||
done(); | ||
@@ -259,0 +259,0 @@ }); |
@@ -7,6 +7,7 @@ 'use strict'; | ||
var DummyDatasource = require('../support/dummy-datasource'); | ||
var path = require('path'); | ||
var datasource = new DummyDatasource(); | ||
var scenariosPath = __dirname + '/scenarios'; | ||
var scenariosPath = path.join(__dirname, '/scenarios'); | ||
var scenarios = fs.readdirSync(scenariosPath) | ||
@@ -25,4 +26,4 @@ .filter(function (filename) { | ||
desc: desc, | ||
cartocss: fs.readFileSync(cartocssFilePath, {encoding: 'utf-8'}), | ||
expectedCartocss: fs.readFileSync(expectedCartocssFilePath, {encoding: 'utf-8'}) | ||
cartocss: fs.readFileSync(cartocssFilePath, { encoding: 'utf-8' }), | ||
expectedCartocss: fs.readFileSync(expectedCartocssFilePath, { encoding: 'utf-8' }) | ||
}; | ||
@@ -38,3 +39,3 @@ }); | ||
} | ||
assert.equal(cartocssResult, scenario.expectedCartocss); | ||
assert.strictEqual(cartocssResult, scenario.expectedCartocss); | ||
done(); | ||
@@ -41,0 +42,0 @@ }); |
@@ -214,3 +214,3 @@ 'use strict'; | ||
} | ||
assert.equal(cartocssResult, scenario.expectedCartocss); | ||
assert.strictEqual(cartocssResult, scenario.expectedCartocss); | ||
done(); | ||
@@ -217,0 +217,0 @@ }); |
@@ -34,4 +34,4 @@ 'use strict'; | ||
.then(function (result) { | ||
assert.deepEqual(result.values, ['#f0f9e8', '#bae4bc', '#7bccc4', '#43a2ca', '#0868ac']); | ||
assert.deepEqual(result.filters, [0, 1, 2, 3, 4]); | ||
assert.deepStrictEqual(result.values, ['#f0f9e8', '#bae4bc', '#7bccc4', '#43a2ca', '#0868ac']); | ||
assert.deepStrictEqual(result.filters, [0, 1, 2, 3, 4]); | ||
}); | ||
@@ -57,6 +57,6 @@ }); | ||
.then(function (result) { | ||
assert.deepEqual(result.values, ['Red', 'Green', 'Blue']); | ||
assert.deepEqual(result.filters, [0, 1, 2]); | ||
assert.deepStrictEqual(result.values, ['Red', 'Green', 'Blue']); | ||
assert.deepStrictEqual(result.filters, [0, 1, 2]); | ||
}); | ||
}); | ||
}); |
@@ -8,4 +8,4 @@ 'use strict'; | ||
it('should replace brackets', function () { | ||
assert.equal(columnName('[wadus_column]'), 'wadus_column'); | ||
assert.strictEqual(columnName('[wadus_column]'), 'wadus_column'); | ||
}); | ||
}); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
fn('red', 'green', 'blue').then(function (result) { | ||
assert.deepEqual(result.get(), [ 'red', 'green', 'blue' ]); | ||
assert.deepStrictEqual(result.get(), [ 'red', 'green', 'blue' ]); | ||
done(); | ||
@@ -18,3 +18,3 @@ }); | ||
fn(9, 8, 7).then(function (result) { | ||
assert.deepEqual(result.get(), [ 9, 8, 7 ]); | ||
assert.deepStrictEqual(result.get(), [ 9, 8, 7 ]); | ||
done(); | ||
@@ -21,0 +21,0 @@ }); |
@@ -11,3 +11,3 @@ 'use strict'; | ||
fn('BluGrn').then(function (result) { | ||
assert.equal(result.get().length, 5); | ||
assert.strictEqual(result.get().length, 5); | ||
done(); | ||
@@ -19,3 +19,3 @@ }); | ||
fn('Peach', 1).then(function (result) { | ||
assert.equal(result.get().length, 2); | ||
assert.strictEqual(result.get().length, 2); | ||
done(); | ||
@@ -27,3 +27,3 @@ }); | ||
fn('RedOr', 9).then(function (result) { | ||
assert.equal(result.get().length, 7); | ||
assert.strictEqual(result.get().length, 7); | ||
done(); | ||
@@ -36,3 +36,3 @@ }); | ||
fn('ArmyRose', numberDataClasses).then(function (result) { | ||
assert.equal(result.get().length, numberDataClasses); | ||
assert.strictEqual(result.get().length, numberDataClasses); | ||
done(); | ||
@@ -39,0 +39,0 @@ }); |
@@ -11,3 +11,3 @@ 'use strict'; | ||
fn('Reds').then(function (result) { | ||
assert.equal(result.get().length, 5); | ||
assert.strictEqual(result.get().length, 5); | ||
done(); | ||
@@ -19,3 +19,3 @@ }); | ||
fn('Reds', 1).then(function (result) { | ||
assert.equal(result.get().length, 3); | ||
assert.strictEqual(result.get().length, 3); | ||
done(); | ||
@@ -27,3 +27,3 @@ }); | ||
fn('Dark2', 9).then(function (result) { | ||
assert.equal(result.get().length, 8); | ||
assert.strictEqual(result.get().length, 8); | ||
done(); | ||
@@ -36,3 +36,3 @@ }); | ||
fn('Reds', numberDataClasses).then(function (result) { | ||
assert.equal(result.get().length, numberDataClasses); | ||
assert.strictEqual(result.get().length, numberDataClasses); | ||
done(); | ||
@@ -39,0 +39,0 @@ }); |
@@ -12,3 +12,3 @@ 'use strict'; | ||
.then(function (result) { | ||
assert.deepEqual(result.get(), [1, 3.25, 5.5, 7.75, 10]); | ||
assert.deepStrictEqual(result.get(), [1, 3.25, 5.5, 7.75, 10]); | ||
done(); | ||
@@ -22,3 +22,3 @@ }) | ||
.then(function (result) { | ||
assert.deepEqual(result.get(), [1, 4, 7, 10]); | ||
assert.deepStrictEqual(result.get(), [1, 4, 7, 10]); | ||
done(); | ||
@@ -32,3 +32,3 @@ }) | ||
.then(function (result) { | ||
assert.deepEqual(result.get(4), [1, 4, 7, 10]); | ||
assert.deepStrictEqual(result.get(4), [1, 4, 7, 10]); | ||
done(); | ||
@@ -35,0 +35,0 @@ }) |
@@ -8,14 +8,14 @@ 'use strict'; | ||
it('should create an array of buckets', function () { | ||
assert.deepEqual(interpolate(4, 12, 3), [4, 8, 12]); | ||
assert.deepEqual(interpolate(1, 10, 10), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); | ||
assert.deepEqual(interpolate(1, 20, 2), [1, 20]); | ||
assert.deepEqual(interpolate(1, 10, 4), [1, 4, 7, 10]); | ||
assert.deepEqual(interpolate(1, 10, 3), [1, 5.5, 10]); | ||
assert.deepEqual(interpolate(0, 10, 3), [0, 5, 10]); | ||
assert.deepEqual(interpolate(0, 10, 3), [0, 5, 10]); | ||
assert.deepStrictEqual(interpolate(4, 12, 3), [4, 8, 12]); | ||
assert.deepStrictEqual(interpolate(1, 10, 10), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); | ||
assert.deepStrictEqual(interpolate(1, 20, 2), [1, 20]); | ||
assert.deepStrictEqual(interpolate(1, 10, 4), [1, 4, 7, 10]); | ||
assert.deepStrictEqual(interpolate(1, 10, 3), [1, 5.5, 10]); | ||
assert.deepStrictEqual(interpolate(0, 10, 3), [0, 5, 10]); | ||
assert.deepStrictEqual(interpolate(0, 10, 3), [0, 5, 10]); | ||
}); | ||
it('should work with array range as first argument', function () { | ||
assert.deepEqual(interpolate([0, 10], 3), [0, 5, 10]); | ||
assert.deepStrictEqual(interpolate([0, 10], 3), [0, 5, 10]); | ||
}); | ||
}); |
@@ -17,3 +17,3 @@ #!/usr/bin/env node | ||
} | ||
var cartocss = fs.readFileSync(filename, {encoding: 'utf-8'}); | ||
var cartocss = fs.readFileSync(filename, { encoding: 'utf-8' }); | ||
@@ -20,0 +20,0 @@ var turbocarto = require('../src/index'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109841
2854