mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
Replace eslint and prettier with Biome
This commit is contained in:
parent
4a5a2ea590
commit
af0d627f19
199 changed files with 16493 additions and 16361 deletions
|
|
@ -2,7 +2,7 @@ import type { APActor, APNote } from "activitypub-types";
|
|||
import { ActivityPubTranslator } from "./protocols/activitypub";
|
||||
|
||||
export enum SupportedProtocols {
|
||||
ACTIVITYPUB = "activitypub",
|
||||
ACTIVITYPUB = "activitypub",
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -12,37 +12,40 @@ export enum SupportedProtocols {
|
|||
* This class is not meant to be instantiated directly, but rather for its children to be used.
|
||||
*/
|
||||
export class ProtocolTranslator {
|
||||
static auto(object: any) {
|
||||
const protocol = this.recognizeProtocol(object);
|
||||
switch (protocol) {
|
||||
case SupportedProtocols.ACTIVITYPUB:
|
||||
return new ActivityPubTranslator();
|
||||
default:
|
||||
throw new Error("Unknown protocol");
|
||||
}
|
||||
}
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
static auto(object: any) {
|
||||
const protocol = ProtocolTranslator.recognizeProtocol(object);
|
||||
switch (protocol) {
|
||||
case SupportedProtocols.ACTIVITYPUB:
|
||||
return new ActivityPubTranslator();
|
||||
default:
|
||||
throw new Error("Unknown protocol");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates an ActivityPub actor to a Lysand user
|
||||
* @param data Raw JSON-LD data from an ActivityPub actor
|
||||
*/
|
||||
user(data: APActor) {
|
||||
//
|
||||
}
|
||||
/**
|
||||
* Translates an ActivityPub actor to a Lysand user
|
||||
* @param data Raw JSON-LD data from an ActivityPub actor
|
||||
*/
|
||||
user(data: APActor) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates an ActivityPub note to a Lysand status
|
||||
* @param data Raw JSON-LD data from an ActivityPub note
|
||||
*/
|
||||
status(data: APNote) {
|
||||
//
|
||||
}
|
||||
/**
|
||||
* Translates an ActivityPub note to a Lysand status
|
||||
* @param data Raw JSON-LD data from an ActivityPub note
|
||||
*/
|
||||
status(data: APNote) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically recognizes the protocol of a given object
|
||||
*/
|
||||
private static recognizeProtocol(object: any) {
|
||||
// Temporary stub
|
||||
return SupportedProtocols.ACTIVITYPUB;
|
||||
}
|
||||
/**
|
||||
* Automatically recognizes the protocol of a given object
|
||||
*/
|
||||
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
private static recognizeProtocol(object: any) {
|
||||
// Temporary stub
|
||||
return SupportedProtocols.ACTIVITYPUB;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "protocol-translator",
|
||||
"version": "0.0.0",
|
||||
"main": "index.ts",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"activitypub-types": "^1.1.0"
|
||||
}
|
||||
}
|
||||
"name": "protocol-translator",
|
||||
"version": "0.0.0",
|
||||
"main": "index.ts",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"activitypub-types": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
import { ProtocolTranslator } from "..";
|
||||
|
||||
export class ActivityPubTranslator extends ProtocolTranslator {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
user() {
|
||||
|
||||
}
|
||||
}
|
||||
user() {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue