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