mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
server-ts: Solve requested changes
This commit is contained in:
parent
040ed39a4e
commit
cbad58201e
@ -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, "");
|
||||
}
|
||||
|
||||
|
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user