Migrate to stylistic

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-16 16:43:07 +01:00
parent d8052e6a73
commit 6c6bf811a6
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
124 changed files with 239 additions and 196 deletions

View file

@ -10,7 +10,7 @@ import { EnhancedMap } from "./maps";
// Inspired by https://pkg.go.dev/golang.org/x/sync/singleflight
const keyMap = new EnhancedMap<Object, EnhancedMap<string, unknown>>();
const keyMap = new EnhancedMap<object, EnhancedMap<string, unknown>>();
/**
* Access class to get a singleflight context. Singleflights execute a
@ -47,7 +47,7 @@ export class Singleflight {
* @param {string} key A string key relevant to that instance to namespace under.
* @returns {SingleflightContext} Returns the context to execute the function.
*/
public static for(instance?: Object | null, key?: string | null): SingleflightContext {
public static for(instance?: object | null, key?: string | null): SingleflightContext {
if (!instance || !key) throw new Error("An instance and key must be supplied");
return new SingleflightContext(instance, key);
}
@ -56,7 +56,7 @@ export class Singleflight {
* Forgets all results for a given instance.
* @param {Object} instance The instance to forget about.
*/
public static forgetAllFor(instance: Object): void {
public static forgetAllFor(instance: object): void {
keyMap.delete(instance);
}
@ -72,7 +72,7 @@ export class Singleflight {
class SingleflightContext {
public constructor(
private instance: Object,
private instance: object,
private key: string,
) {}