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
+7 -7
View File
@@ -8,7 +8,7 @@ import _ol_obj_ from '../obj.js';
* @private
* @type {Object.<string, Object.<string, ol.TransformFunction>>}
*/
var transforms = {};
let transforms = {};
/**
@@ -28,8 +28,8 @@ export function clear() {
* @param {ol.TransformFunction} transformFn Transform.
*/
export function add(source, destination, transformFn) {
var sourceCode = source.getCode();
var destinationCode = destination.getCode();
const sourceCode = source.getCode();
const destinationCode = destination.getCode();
if (!(sourceCode in transforms)) {
transforms[sourceCode] = {};
}
@@ -47,9 +47,9 @@ export function add(source, destination, transformFn) {
* @return {ol.TransformFunction} transformFn The unregistered transform.
*/
export function remove(source, destination) {
var sourceCode = source.getCode();
var destinationCode = destination.getCode();
var transform = transforms[sourceCode][destinationCode];
const sourceCode = source.getCode();
const destinationCode = destination.getCode();
const transform = transforms[sourceCode][destinationCode];
delete transforms[sourceCode][destinationCode];
if (_ol_obj_.isEmpty(transforms[sourceCode])) {
delete transforms[sourceCode];
@@ -65,7 +65,7 @@ export function remove(source, destination) {
* @return {ol.TransformFunction|undefined} The transform function (if found).
*/
export function get(sourceCode, destinationCode) {
var transform;
let transform;
if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {
transform = transforms[sourceCode][destinationCode];
}