Fix eslint

This commit is contained in:
Henrik Giesel 2021-07-09 03:12:38 +02:00
parent ef539bcb37
commit 8bcb0635ba

View file

@ -14,16 +14,16 @@ export function replaceWithColon(name: string): string {
export function normalizeTagname(tagname: string): string {
let trimmed = tagname.trim();
while (true) {
if (trimmed.startsWith(":") || trimmed.startsWith(delimChar)) {
while (trimmed.startsWith(":") || trimmed.startsWith(delimChar)) {
trimmed = trimmed.slice(1).trimStart();
} else if (trimmed.endsWith(":") || trimmed.endsWith(delimChar)) {
}
while (trimmed.endsWith(":") || trimmed.endsWith(delimChar)) {
trimmed = trimmed.slice(0, -1).trimEnd();
} else {
}
return trimmed;
}
}
}
export interface Tag {
id: string;
@ -32,14 +32,14 @@ export interface Tag {
flash: () => void;
}
const noop = () => {};
export function attachId(name: string): Tag {
return {
id: Math.random().toString(36).substring(2),
name,
selected: false,
flash: noop,
flash: () => {
/* noop */
},
};
}