server-ts: Solve requested changes

This commit is contained in:
Elian Doran 2024-03-17 21:40:14 +02:00
parent 040ed39a4e
commit cbad58201e
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View File

@ -35,7 +35,7 @@ const IGNORED_ATTR_NAMES = [
function filterUrlValue(value) {
return value
.replace(/https?:\/\//ig, "")
.replace(/www\./ig, "")
.replace(/www.js\./ig, "")
.replace(/(\.net|\.com|\.org|\.info|\.edu)/ig, "");
}

View File

@ -1,15 +1,15 @@
interface DefinitionObject {
isPromoted: boolean;
labelType: string;
multiplicity: string;
numberPrecision: number;
promotedAlias: string;
inverseRelation: string;
isPromoted?: boolean;
labelType?: string;
multiplicity?: string;
numberPrecision?: number;
promotedAlias?: string;
inverseRelation?: string;
}
function parse(value: string): DefinitionObject {
const tokens = value.split(',').map(t => t.trim());
const defObj: Partial<DefinitionObject> = {};
const defObj: DefinitionObject = {};
for (const token of tokens) {
if (token === 'promoted') {
@ -41,7 +41,7 @@ function parse(value: string): DefinitionObject {
}
}
return defObj as DefinitionObject;
return defObj;
}
export = {