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) { function filterUrlValue(value) {
return value return value
.replace(/https?:\/\//ig, "") .replace(/https?:\/\//ig, "")
.replace(/www\./ig, "") .replace(/www.js\./ig, "")
.replace(/(\.net|\.com|\.org|\.info|\.edu)/ig, ""); .replace(/(\.net|\.com|\.org|\.info|\.edu)/ig, "");
} }

View File

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