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:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user