Skip to content

Commit

Permalink
Avoid const
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Feb 17, 2021
1 parent 53966ef commit 7971ea1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ function noSpacing(style) {
});
}

const isTokenField = /^\{name/;
var isTokenField = /^\{name/;
function isFlatExpressionField(isLangField, property) {
const isGetExpression = Array.isArray(property) && property[0] === 'get';
var isGetExpression = Array.isArray(property) && property[0] === 'get';
if (isGetExpression && isTokenField.test(property[1])) {
console.warn('This plugin no longer supports the use of token syntax (e.g. {name}). Please use a get expression. See https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/ for more details.');
}
Expand Down Expand Up @@ -145,8 +145,8 @@ function adaptPropertyLanguage(isLangField, property, languageFieldName) {

// handle special case of bare ['get', 'name'] expression by wrapping it in a coalesce statement
if (property[0] === 'get' && property[1] === 'name') {
const defaultProp = property.slice();
const adaptedProp = ['get', languageFieldName];
var defaultProp = property.slice();
var adaptedProp = ['get', languageFieldName];
property = ['coalesce', adaptedProp, defaultProp];
}

Expand Down

0 comments on commit 7971ea1

Please sign in to comment.