import { Node } from 'neo4j-driver' ; import { User } from '../../user/entity/user.entity' ; import { Tag } from './tag.entity' ; export class Article { constructor ( private readonly article , private readonly author , private readonly tagList , private readonly favoritesCount , private readonly favorited ) { } toJson ( ) { return { ... this . article . properties , favoritesCount : this . favoritesCount , favorited : this . favorited , author : this . author . toJson ( ) , tagList : this . tagList . map ( tag => tag . toJson ( ) ) , } ; } }