Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
SemWeb
libview
Commits
3a4b56dd28f6
Commit
cdb9ee0c
authored
Nov 09, 2018
by
Laurent Wouters
Browse files
[fix] Fixed linting issues with libview
parent
180abd85583f
Changes
6
Hide whitespace changes
Inline
Side-by-side
libview/src/application.ts
View file @
3a4b56dd
...
...
@@ -262,7 +262,7 @@ export interface RenderingOptions {
/**
* The rendering options per target
*/
[
target
:
string
]:
TargetRenderingOptions
;
[
target
:
string
]:
TargetRenderingOptions
|
undefined
;
}
/**
...
...
libview/src/rdf-entities.ts
View file @
3a4b56dd
...
...
@@ -204,11 +204,11 @@ export class RdfEntityStore {
/**
* The map of known aliases
*/
private
aliases
:
{
[
uri
:
string
]:
string
[]
};
private
aliases
:
{
[
uri
:
string
]:
string
[]
|
undefined
};
/**
* The inverse relations
*/
private
inverses
:
{
[
uri
:
string
]:
string
};
private
inverses
:
{
[
uri
:
string
]:
string
|
undefined
};
/**
* Initializes this store
...
...
@@ -286,7 +286,7 @@ export class RdfEntityStore {
let
self
=
this
;
relation
.
uris
.
forEach
((
uri
:
string
)
=>
{
let
inverse
=
self
.
inverses
[
uri
];
if
(
inverse
)
{
if
(
inverse
!==
undefined
)
{
let
inverseEntity
=
self
.
entityForUri
(
inverse
);
if
(
result
.
indexOf
(
inverseEntity
)
<
0
)
{
result
.
push
(
inverseEntity
);
...
...
@@ -360,7 +360,7 @@ export class RdfEntityStore {
.
forEach
(
onNamedNode
);
// look for registered aliases for this uri
let
registeredAliases
=
this
.
aliases
[
uris
[
i
]];
if
(
registeredAliases
)
{
if
(
registeredAliases
!==
undefined
)
{
registeredAliases
.
forEach
(
onUri
);
}
// look for equivalent URIs
...
...
libview/src/rdf-meta.ts
View file @
3a4b56dd
...
...
@@ -183,7 +183,7 @@ export class MetaPropertyData implements MetaProperty {
return
{
literal
:
literal
,
rank
:
l
}
as
RankedLiteral
;
}
}
if
(
!
literal
.
lang
||
literal
.
lang
===
""
)
{
if
(
literal
.
lang
===
""
)
{
// lang-tag is not defined, has more priority than other tagged literals that do not match (considered as a default)
return
{
literal
:
literal
,
...
...
libview/src/view-def.ts
View file @
3a4b56dd
...
...
@@ -94,7 +94,7 @@ export interface ViewDescriptor {
* A repository of view descriptors
*/
export
interface
ViewDescriptors
{
[
id
:
string
]:
ViewDescriptor
;
[
id
:
string
]:
ViewDescriptor
|
undefined
;
}
/**
...
...
libview/src/view-impl.ts
View file @
3a4b56dd
...
...
@@ -231,9 +231,7 @@ class ViewRendererImpl implements CachingViewRenderer {
if
(
options
&&
options
.
language
)
{
result
.
push
(
options
.
language
);
}
if
(
context
.
browserLanguage
)
{
result
.
push
(
context
.
browserLanguage
);
}
result
.
push
(
context
.
browserLanguage
);
return
result
;
}
...
...
@@ -250,7 +248,7 @@ class ViewRendererImpl implements CachingViewRenderer {
target
);
let
options
=
context
.
options
[
target
.
uri
];
if
(
options
&&
options
.
view
)
{
if
(
options
&&
options
.
view
!==
undefined
)
{
// try to use the forced view
view
=
this
.
implementations
[
options
.
view
];
}
...
...
@@ -296,13 +294,15 @@ class ViewRendererImpl implements CachingViewRenderer {
let
toAdd
:
ViewDescriptor
[]
=
[];
Object
.
keys
(
registry
.
descriptors
).
forEach
((
id
:
string
)
=>
{
let
candidate
=
self
.
descriptors
[
id
];
if
(
candidate
)
{
toAdd
.
push
(
registry
.
descriptors
[
id
]);
let
newDescriptor
=
registry
.
descriptors
[
id
];
if
(
candidate
===
undefined
&&
newDescriptor
!==
undefined
)
{
toAdd
.
push
(
newDescriptor
);
}
});
Object
.
keys
(
self
.
descriptors
).
forEach
((
id
:
string
)
=>
{
let
candidate
=
registry
.
descriptors
[
id
];
if
(
candidate
)
{
let
current
=
self
.
descriptors
[
id
];
let
newDescriptor
=
registry
.
descriptors
[
id
];
if
(
current
!==
undefined
&&
newDescriptor
===
undefined
)
{
// has been deleted
delete
self
.
descriptors
[
id
];
delete
self
.
implementations
[
id
];
...
...
libview/tslint.json
View file @
3a4b56dd
...
...
@@ -72,6 +72,7 @@
"quotemark"
:
[
true
,
"double"
,
"avoid-escape"
,
"jsx-double"
],
"semicolon"
:
[
true
,
"always"
],
"strict-type-predicates"
:
true
,
"strict-boolean-expressions"
:
[
true
,
"allow-undefined-union"
],
"space-before-function-paren"
:
[
true
,
"never"
],
"unified-signatures"
:
true
,
"variable-name"
:
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment