Use blocked scoped variables

In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
Tim Schaub
2018-01-11 23:32:36 -07:00
parent 0bf2b04dee
commit ad62739a6e
684 changed files with 18120 additions and 18184 deletions
+9 -9
View File
@@ -4,7 +4,7 @@ import _ol_uri_ from '../../../src/ol/uri.js';
describe('ol.uri.appendParams()', function() {
it('should append empty STYLES with =', function() {
var url = _ol_uri_.appendParams('http://example.com/foo', {
const url = _ol_uri_.appendParams('http://example.com/foo', {
SERVICE: 'WMS',
STYLES: ''
});
@@ -12,56 +12,56 @@ describe('ol.uri.appendParams()', function() {
});
it('should URL encode values but not names', function() {
var url = _ol_uri_.appendParams('http://example.com/foo', {
const url = _ol_uri_.appendParams('http://example.com/foo', {
'k ': 'v '
});
expect(url).to.equal('http://example.com/foo?k =v%20');
});
it('should append to simple base URL', function() {
var url = _ol_uri_.appendParams('http://example.com/foo', {
const url = _ol_uri_.appendParams('http://example.com/foo', {
k: 'v'
});
expect(url).to.equal('http://example.com/foo?k=v');
});
it('should append to base URL with ?', function() {
var url = _ol_uri_.appendParams('http://example.com/foo?', {
const url = _ol_uri_.appendParams('http://example.com/foo?', {
k: 'v'
});
expect(url).to.equal('http://example.com/foo?k=v');
});
it('should append to base URL with single existing param', function() {
var url = _ol_uri_.appendParams('http://example.com/foo?bar=bam', {
const url = _ol_uri_.appendParams('http://example.com/foo?bar=bam', {
k: 'v'
});
expect(url).to.equal('http://example.com/foo?bar=bam&k=v');
});
it('should append to base URL with single existing param and extraneous &', function() {
var url = _ol_uri_.appendParams('http://example.com/foo?bar=bam&', {
const url = _ol_uri_.appendParams('http://example.com/foo?bar=bam&', {
k: 'v'
});
expect(url).to.equal('http://example.com/foo?bar=bam&k=v');
});
it('should append to base URL with two existing params', function() {
var url = _ol_uri_.appendParams('http://example.com/foo?bar=bam&baz=bat', {
const url = _ol_uri_.appendParams('http://example.com/foo?bar=bam&baz=bat', {
k: 'v'
});
expect(url).to.equal('http://example.com/foo?bar=bam&baz=bat&k=v');
});
it('should append to base URL with three existing params last one empty', function() {
var url = _ol_uri_.appendParams('http://example.com/foo?bar=bam&baz=bat&bop=', {
const url = _ol_uri_.appendParams('http://example.com/foo?bar=bam&baz=bat&bop=', {
k: 'v'
});
expect(url).to.equal('http://example.com/foo?bar=bam&baz=bat&bop=&k=v');
});
it('should not append null or undefined parameters to the url', function() {
var url = _ol_uri_.appendParams('http://example.com/foo', {
const url = _ol_uri_.appendParams('http://example.com/foo', {
a: '1',
b: null,
c: undefined