From c49039c48cde1bbe1fe2818197a5bb3d82b03a15 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 12 Apr 2020 21:02:41 +0200 Subject: [PATCH] removed Utils import and added individual method import instead Signed-off-by: Philip Molares Signed-off-by: David Mehren --- lib/models/note.ts | 12 ++++++------ lib/models/revision.ts | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/models/note.ts b/lib/models/note.ts index d8b7ac8b7..129e365dc 100644 --- a/lib/models/note.ts +++ b/lib/models/note.ts @@ -16,7 +16,7 @@ import { import { generate as shortIdGenerate, isValid as shortIdIsValid } from 'shortid' import { Author, Revision, User } from './index' -import { Utils } from '../utils' +import { processData, stripNullByte } from '../utils' import Sequelize from 'sequelize' import fs from 'fs' import path from 'path' @@ -113,25 +113,25 @@ export class Note extends Model { @Column(DataType.TEXT) get title (): string { - return Utils.processData(this.getDataValue('title'), '') + return processData(this.getDataValue('title'), '') } set title (value: string) { - this.setDataValue('title', Utils.stripNullByte(value)) + this.setDataValue('title', stripNullByte(value)) } @Column(DataType.TEXT({ length: 'long' })) get content (): string { - return Utils.processData(this.getDataValue('content'), '') + return processData(this.getDataValue('content'), '') } set content (value: string) { - this.setDataValue('content', Utils.stripNullByte(value)) + this.setDataValue('content', stripNullByte(value)) } @Column(DataType.TEXT({ length: 'long' })) get authorship (): string { - return Utils.processData(this.getDataValue('authorship'), [], JSON.parse) + return processData(this.getDataValue('authorship'), [], JSON.parse) } set authorship (value: string) { diff --git a/lib/models/revision.ts b/lib/models/revision.ts index f49a802dc..f19c844ec 100644 --- a/lib/models/revision.ts +++ b/lib/models/revision.ts @@ -1,7 +1,7 @@ import { BelongsTo, Column, DataType, ForeignKey, IsUUID, Model, PrimaryKey, Table } from 'sequelize-typescript' import { ChildProcess } from 'child_process' import { Note } from './note' -import { Utils } from '../utils' +import { processData, stripNullByte } from '../utils' import Sequelize from 'sequelize' // core @@ -81,34 +81,34 @@ export class Revision extends Model { @Column(DataType.TEXT({ length: 'long' })) get patch (): string { - return Utils.processData(this.getDataValue('patch'), '') + return processData(this.getDataValue('patch'), '') } set patch (value: string) { - this.setDataValue('patch', Utils.stripNullByte(value)) + this.setDataValue('patch', stripNullByte(value)) } @Column(DataType.TEXT({ length: 'long' })) get lastContent (): string { - return Utils.processData(this.getDataValue('lastContent'), '') + return processData(this.getDataValue('lastContent'), '') } set lastContent (value: string) { - this.setDataValue('lastContent', Utils.stripNullByte(value)) + this.setDataValue('lastContent', stripNullByte(value)) } @Column(DataType.TEXT({ length: 'long' })) get content (): string { - return Utils.processData(this.getDataValue('content'), '') + return processData(this.getDataValue('content'), '') } set content (value: string) { - this.setDataValue('content', Utils.stripNullByte(value)) + this.setDataValue('content', stripNullByte(value)) } @Column(DataType.TEXT({ length: 'long' })) get authorship (): string { - return Utils.processData(this.getDataValue('authorship'), [], JSON.parse) + return processData(this.getDataValue('authorship'), [], JSON.parse) } set authorship (value: string) {