mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix eslint
This commit is contained in:
parent
ef539bcb37
commit
8bcb0635ba
1 changed files with 11 additions and 11 deletions
|
@ -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 */
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue