Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jules Sagot--Gentil
Flux articles console
Commits
8508d65a
Verified
Commit
8508d65a
authored
Feb 13, 2022
by
Jules Sagot--Gentil
Browse files
feat(article): implémentation de la méthode egal/getId d'ArticleRSS
parent
0f365f06
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/article.ts
View file @
8508d65a
...
...
@@ -4,6 +4,7 @@ import { Writable } from 'stream';
export
interface
Article
{
affiche
(
sortie
:
Writable
):
void
;
egal
(
autreArticle
:
Article
):
boolean
;
getId
():
string
|
undefined
;
}
export
class
ArticleRSS
implements
Article
{
...
...
@@ -25,5 +26,14 @@ export class ArticleRSS implements Article {
sortie
.
write
(
`\n`
);
}
egal
(
autreArticle
:
Article
)
{
return
false
};
egal
(
autreArticle
:
Article
)
{
if
(
autreArticle
.
getId
()
==
undefined
||
this
.
getId
()
==
undefined
)
{
return
false
;
}
return
autreArticle
.
getId
()
==
this
.
getId
();
};
public
getId
():
string
|
undefined
{
return
this
.
item
.
guid
||
this
.
item
.
link
||
this
.
item
.
content
;
}
}
Write
Preview
Supports
Markdown
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