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) {
|
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, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user