Fix all biome linter errors (#541)
This commit is contained in:
parent
f23c73f6a5
commit
e5d654bf41
46 changed files with 317 additions and 275 deletions
|
|
@ -248,18 +248,16 @@ export const patchTextNodes = (schema, oldNode, newNode) => {
|
|||
});
|
||||
|
||||
// Map diffs to nodes
|
||||
const res = diffs
|
||||
.map(([type, sentences]) => {
|
||||
return sentences.map((sentence) => {
|
||||
const node = createTextNode(
|
||||
schema,
|
||||
sentence,
|
||||
type !== DiffType.Unchanged ? [createDiffMark(schema, type)] : []
|
||||
);
|
||||
return node;
|
||||
});
|
||||
})
|
||||
.flat();
|
||||
const res = diffs.flatMap(([type, sentences]) => {
|
||||
return sentences.map((sentence) => {
|
||||
const node = createTextNode(
|
||||
schema,
|
||||
sentence,
|
||||
type !== DiffType.Unchanged ? [createDiffMark(schema, type)] : []
|
||||
);
|
||||
return node;
|
||||
});
|
||||
});
|
||||
|
||||
return res;
|
||||
};
|
||||
|
|
@ -278,28 +276,26 @@ const sentencesToChars = (oldSentences, newSentences) => {
|
|||
const chars1 = oldSentences
|
||||
.map((sentence) => {
|
||||
const line = sentence;
|
||||
if (lineHash.hasOwnProperty(line)) {
|
||||
return String.fromCharCode(lineHash[line]);
|
||||
} else {
|
||||
lineHash[line] = lineStart;
|
||||
lineArray[lineStart] = line;
|
||||
lineStart++;
|
||||
if (line in lineHash) {
|
||||
return String.fromCharCode(lineHash[line]);
|
||||
}
|
||||
lineHash[line] = lineStart;
|
||||
lineArray[lineStart] = line;
|
||||
lineStart++;
|
||||
return String.fromCharCode(lineHash[line]);
|
||||
})
|
||||
.join('');
|
||||
|
||||
const chars2 = newSentences
|
||||
.map((sentence) => {
|
||||
const line = sentence;
|
||||
if (lineHash.hasOwnProperty(line)) {
|
||||
return String.fromCharCode(lineHash[line]);
|
||||
} else {
|
||||
lineHash[line] = lineStart;
|
||||
lineArray[lineStart] = line;
|
||||
lineStart++;
|
||||
if (line in lineHash) {
|
||||
return String.fromCharCode(lineHash[line]);
|
||||
}
|
||||
lineHash[line] = lineStart;
|
||||
lineArray[lineStart] = line;
|
||||
lineStart++;
|
||||
return String.fromCharCode(lineHash[line]);
|
||||
})
|
||||
.join('');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue