@@ -4,11 +4,6 @@ const Lock = require('./lock');
44const SnippetPublisher = require ( './publishers/snippet-publisher' ) ;
55const MarkdownPublisher = require ( './publishers/markdown-publisher' ) ;
66
7- const NOTE_TYPES = {
8- MARKDOWN_NOTE : 'MARKDOWN_NOTE' ,
9- SNIPPET_NOTE : 'SNIPPET_NOTE'
10- } ;
11-
127module . exports = class Sync {
138 /**
149 * Construct Sync Module
@@ -89,12 +84,12 @@ module.exports = class Sync {
8984 */
9085 async syncParsedMarkdown ( { file, raw, type } ) {
9186 const { title, content } = raw ;
92- if ( type === NOTE_TYPES . MARKDOWN_NOTE ) {
87+ if ( type === this . constants . fileTypes . MARKDOWN_NOTE ) {
9388 await this . markdownPublisher . publish ( { file, title, content } ) ;
9489 this . logger . info ( `Content of ${ file } synced as a parsed markdown note` ) ;
9590 }
9691
97- if ( type === NOTE_TYPES . SNIPPET_NOTE ) {
92+ if ( type === this . constants . fileTypes . SNIPPET_NOTE ) {
9893 await this . snippetPublisher . publish ( { file, title, content } ) ;
9994 this . logger . info ( `Content of ${ file } synced as a parsed snippet note` ) ;
10095 }
@@ -117,8 +112,8 @@ module.exports = class Sync {
117112
118113 if ( event === this . constants . events . FILE_CREATE_OR_UPDATE ) {
119114 const isParsableContent = [
120- NOTE_TYPES . MARKDOWN_NOTE ,
121- NOTE_TYPES . SNIPPET_NOTE
115+ this . constants . fileTypes . MARKDOWN_NOTE ,
116+ this . constants . fileTypes . SNIPPET_NOTE
122117 ] . includes ( type ) ;
123118
124119 if ( this . config . modes . raw ) {
0 commit comments