Skip to content

Commit

Permalink
Lint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
na9da committed Apr 26, 2024
1 parent a9094e8 commit c699f46
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/Core/arrayContains.ts
@@ -1,5 +1,5 @@
export default function arrayContains<T>(array: readonly T[], value: T) {
for (var i = 0; i < array.length; ++i) {
for (let i = 0; i < array.length; ++i) {
if (array[i] === value) {
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Core/linkifyContent.ts
Expand Up @@ -3,9 +3,9 @@ import linkifyIt from "linkify-it";
const linkify = linkifyIt();

function linkifyContent(content: string) {
let matches = linkify.match(content),
result = [],
last: number;
const matches = linkify.match(content),
result = [];
let last: number;

if (matches) {
last = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/Core/loadText.ts
@@ -1,7 +1,7 @@
import Resource from "terriajs-cesium/Source/Core/Resource";

async function loadText(urlOrResource: string | Resource): Promise<string> {
var resource = (Resource as any).createIfNeeded(urlOrResource) as Resource;
const resource = (Resource as any).createIfNeeded(urlOrResource) as Resource;
const response = resource.fetchText();
if (response === undefined) {
throw new Error("Request throttled");
Expand Down
2 changes: 1 addition & 1 deletion lib/Core/loadXML.ts
Expand Up @@ -3,7 +3,7 @@ import Resource from "terriajs-cesium/Source/Core/Resource";
async function loadXML(
urlOrResource: string | Resource
): Promise<XMLDocument | undefined> {
var resource = (Resource as any).createIfNeeded(urlOrResource) as Resource;
const resource = (Resource as any).createIfNeeded(urlOrResource) as Resource;
const response = await resource.fetchXML();

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/Core/pollToPromise.ts
Expand Up @@ -9,12 +9,12 @@ interface Options {
const pollToPromise = function (f: () => boolean, options: Options) {
options = defaultValue(options, (defaultValue as any).EMPTY_OBJECT);

var pollInterval = defaultValue(options.pollInterval, 1);
var timeout = defaultValue(options.timeout, 5000);
const pollInterval = defaultValue(options.pollInterval, 1);
const timeout = defaultValue(options.timeout, 5000);

return new Promise<void>((resolve, reject) => {
var startTimestamp = getTimestamp();
var endTimestamp = startTimestamp + timeout;
const startTimestamp = getTimestamp();
const endTimestamp = startTimestamp + timeout;

function poller() {
if (f()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Core/readXml.ts
Expand Up @@ -13,7 +13,7 @@ function readXml(file: Blob) {
if (!result) {
return undefined;
}
var xml = parser.parseFromString(result, "application/xml");
const xml = parser.parseFromString(result, "application/xml");
if (
!xml ||
!xml.documentElement ||
Expand Down
2 changes: 1 addition & 1 deletion lib/Core/triggerResize.ts
Expand Up @@ -5,7 +5,7 @@ export default function triggerResize() {
try {
window.dispatchEvent(new Event("resize"));
} catch (e) {
var evt = window.document.createEvent("UIEvents");
const evt = window.document.createEvent("UIEvents");
evt.initUIEvent("resize", true, false, window, 0);
window.dispatchEvent(evt);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Models/Feature/ImageryLayerFeatureInfo.ts
Expand Up @@ -10,10 +10,10 @@ import formatPropertyValue from "../../Core/formatPropertyValue";
ImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties =
function (properties: any) {
function describe(properties: any) {
var html = '<table class="cesium-infoBox-defaultTable">';
for (var key in properties) {
let html = '<table class="cesium-infoBox-defaultTable">';
for (const key in properties) {
if (Object.prototype.hasOwnProperty.call(properties, key)) {
var value = properties[key];
const value = properties[key];
if (defined(value)) {
if (typeof value === "object") {
html +=
Expand Down

0 comments on commit c699f46

Please sign in to comment.