chore(prettier): fix all files

This commit is contained in:
Elian Doran
2025-01-09 18:07:02 +02:00
parent 19ee861699
commit 4cbb529fd4
571 changed files with 23226 additions and 23940 deletions

View File

@@ -1,35 +1,29 @@
import { DefinitionObject } from "./promoted_attribute_definition_interface.js";
function parse(value: string): DefinitionObject {
const tokens = value.split(',').map(t => t.trim());
const tokens = value.split(",").map((t) => t.trim());
const defObj: DefinitionObject = {};
for (const token of tokens) {
if (token === 'promoted') {
if (token === "promoted") {
defObj.isPromoted = true;
}
else if (['text', 'number', 'boolean', 'date', 'datetime', 'time', 'url'].includes(token)) {
} else if (["text", "number", "boolean", "date", "datetime", "time", "url"].includes(token)) {
defObj.labelType = token;
}
else if (['single', 'multi'].includes(token)) {
} else if (["single", "multi"].includes(token)) {
defObj.multiplicity = token;
}
else if (token.startsWith('precision')) {
const chunks = token.split('=');
} else if (token.startsWith("precision")) {
const chunks = token.split("=");
defObj.numberPrecision = parseInt(chunks[1]);
}
else if (token.startsWith('alias')) {
const chunks = token.split('=');
} else if (token.startsWith("alias")) {
const chunks = token.split("=");
defObj.promotedAlias = chunks[1];
}
else if (token.startsWith('inverse')) {
const chunks = token.split('=');
} else if (token.startsWith("inverse")) {
const chunks = token.split("=");
defObj.inverseRelation = chunks[1].replace(/[^\p{L}\p{N}_:]/ug, "")
}
else {
defObj.inverseRelation = chunks[1].replace(/[^\p{L}\p{N}_:]/gu, "");
} else {
console.log("Unrecognized attribute definition token:", token);
}
}