Cleanup unused Javascript (#3027)

* chore(js): be stricter about dead code warnings

* chore(js): remove dead code and unused exports

* rebase

* chore: remove unused files

* chore(deps): remove unused prop-types dep

* chore(js): remove unused function

* chore(deps): remove + check unused deps

* chore(js): remove unused exports. Closes #3036
This commit is contained in:
Gabe Kangas
2023-05-20 21:15:25 -07:00
committed by GitHub
parent 429289d508
commit e50b23d081
55 changed files with 1187 additions and 1071 deletions

View File

@@ -20,7 +20,7 @@ export function isEmptyObject(obj) {
return !obj || (Object.keys(obj).length === 0 && obj.constructor === Object);
}
export function padLeft(text, pad, size) {
function padLeft(text, pad, size) {
return String(pad.repeat(size) + text).slice(-size);
}
@@ -42,13 +42,6 @@ export function parseSecondsToDurationString(seconds = 0) {
return daysString + hoursString + minString + secsString;
}
export function makeAndStringFromArray(arr: string[]): string {
if (arr.length === 1) return arr[0];
const firsts = arr.slice(0, arr.length - 1);
const last = arr[arr.length - 1];
return `${firsts.join(', ')} and ${last}`;
}
export function formatUAstring(uaString: string) {
const parser = UAParser(uaString);
const { device, os, browser } = parser;