mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Bring lint config back to original strictness
This commit is contained in:
@@ -38,7 +38,7 @@ export function isGuarded<T extends NodeJS.EventEmitter>(stream: T): stream is G
|
||||
function guardingErrorListener(this: Guarded, error: Error): void {
|
||||
// Only fall back to this if no new listeners are attached since guarding started.
|
||||
const errorListeners = this.listeners('error');
|
||||
if (errorListeners[errorListeners.length - 1] === guardingErrorListener) {
|
||||
if (errorListeners.at(-1) === guardingErrorListener) {
|
||||
this[guardedErrors].push(error);
|
||||
if (!this[guardedTimeout]) {
|
||||
this[guardedTimeout] = setTimeout((): void => {
|
||||
|
||||
@@ -38,7 +38,7 @@ const logger = getLoggerFor('HeaderUtil');
|
||||
export function transformQuotedStrings(input: string): { result: string; replacements: Record<string, string> } {
|
||||
let idx = 0;
|
||||
const replacements: Record<string, string> = {};
|
||||
const result = input.replace(/"(?:[^"\\]|\\.)*"/gu, (match): string => {
|
||||
const result = input.replaceAll(/"(?:[^"\\]|\\.)*"/gu, (match): string => {
|
||||
// Not all characters allowed in quoted strings, see BNF above
|
||||
if (!QUOTED_STRING.test(match)) {
|
||||
logger.warn(`Invalid quoted string in header: ${match}`);
|
||||
|
||||
@@ -173,7 +173,6 @@ async function findNextSorted<T>(iterators: AsyncIterator<T>[], results: (T | un
|
||||
export async function* sortedAsyncMerge<T>(iterators: AsyncIterator<T>[], comparator?: (left: T, right: T) => number):
|
||||
AsyncIterable<T> {
|
||||
if (!comparator) {
|
||||
// eslint-disable-next-line style/no-extra-parens
|
||||
comparator = (left, right): number => left < right ? -1 : (left > right ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { errorTermsToMetadata } from './errors/HttpErrorUtil';
|
||||
* @returns The potentially changed path (POSIX).
|
||||
*/
|
||||
function windowsToPosixPath(path: string): string {
|
||||
return path.replace(/\\+/gu, '/');
|
||||
return path.replaceAll(/\\+/gu, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ export function splitCommaSeparated(input: string): string[] {
|
||||
* @returns The sanitized output.
|
||||
*/
|
||||
export function sanitizeUrlPart(urlPart: string): string {
|
||||
return urlPart.replace(/\W/gu, '-');
|
||||
return urlPart.replaceAll(/\W/gu, '-');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@ export type VocabularyTerm<T> = T extends Vocabulary<any, infer TKey> ? T['terms
|
||||
*/
|
||||
function createValueVocabulary<TBase extends string, TLocal extends string>(baseUri: TBase, localNames: TLocal[]):
|
||||
ValueVocabulary<TBase, TLocal> {
|
||||
const expanded: Partial<ExpandedRecord<TBase, TLocal>> = { };
|
||||
const expanded: Partial<ExpandedRecord<TBase, TLocal>> = {};
|
||||
// Expose the listed local names as properties
|
||||
for (const localName of localNames) {
|
||||
expanded[localName] = `${baseUri}${localName}`;
|
||||
|
||||
Reference in New Issue
Block a user