Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit f6705af

Browse files
committed
remove errors from test
1 parent 038b0d3 commit f6705af

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

src/helpers/FileContent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class FileContent{
3030
}
3131

3232
remove(pattern_to_be_removed:RegExp): FileContent{
33-
let _object = this.object();
33+
const _object = this.object();
3434
_object.forEach((value,index) => {
3535
if (value.match(pattern_to_be_removed)){
3636
delete _object[index];
@@ -41,7 +41,7 @@ export class FileContent{
4141
}
4242

4343
removeAll(string_to_be_removed:string): FileContent{
44-
let _object = this.object();
44+
const _object = this.object();
4545
_object.forEach((value,index) => {
4646
if (value.trim().indexOf(string_to_be_removed)!=-1){
4747
delete _object[index];
@@ -52,7 +52,7 @@ export class FileContent{
5252
}
5353

5454
fetch(line_number:number){
55-
let _object = this.object();
55+
const _object = this.object();
5656
for (let i=0;i<_object.length;i++){
5757
if (i+1===line_number){
5858
return _object[i];
@@ -62,14 +62,14 @@ export class FileContent{
6262
}
6363

6464
edit(content:string,line_number:number): FileContent{
65-
let _object = this.object();
65+
const _object = this.object();
6666
_object[line_number-1] = content;
6767
this.value = this.real_array(_object).join('\n');
6868
return this;
6969
}
7070

7171
real_array(array:string[]):string[]{
72-
let output:string[] = [];
72+
const output:string[] = [];
7373
array.forEach(element=>{
7474
output.push(element);
7575
});

src/helpers/VaultManagement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function adapterTFilesToRows(folderPath: string): Promise<Array<Tab
5353
}
5454

5555
export function adapterRowToDatabaseYaml(rowInfo:any):string{
56-
let yaml = [];
56+
const yaml = [];
5757
yaml.push('---');
5858
Object.entries(rowInfo).forEach(entry => {
5959
const [key, value] = entry;
@@ -140,7 +140,7 @@ export async function updateRowFile(file:TFile, columnId:string, newValue:string
140140
updateOptions[UpdateRowOptions.REMOVE_COLUMN] = removeColumn;
141141
updateOptions[UpdateRowOptions.ADD_COLUMN] = addColumn;
142142
// Execute action
143-
if(updateOptions.hasOwnProperty(option)){
143+
if(updateOptions[option]){
144144
const noteObject = updateOptions[option]();
145145
await VaultManagerDB.editNoteContent(noteObject);
146146
}else{

src/parsers/DatabaseParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ export function hasFrontmatterKey(data: string) {
3636
databaseConfigString.push(`name: ${databaseConfig.name}`);
3737
databaseConfigString.push(`description: ${databaseConfig.description}`);
3838
databaseConfigString.push(`columns:`);
39-
for (let columnName in databaseConfig.columns) {
39+
for (const columnName in databaseConfig.columns) {
4040
databaseConfigString.push(`${yamlIndent.repeat(1)}${columnName}:`);
41-
for (let columnKey in databaseConfig.columns[columnName]) {
41+
for (const columnKey in databaseConfig.columns[columnName]) {
4242
databaseConfigString.push(`${yamlIndent.repeat(2)}${columnKey}: ${databaseConfig.columns[columnName][columnKey]}`);
4343
}
4444
}

src/services/DatabaseInfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class DatabaseInfo {
4545
const configRegex = new RegExp(`<%%\\s+([\\w\\W]+?)\\s+%%>`,"g");
4646
const databaseFilePath = this.file.path;
4747
const databaseConfigUpdated = convertDatabaseYamlToParsedString(this.yaml).join("\n");
48-
let noteObject:NoteContentAction = {
48+
const noteObject:NoteContentAction = {
4949
action: 'replace',
5050
file: this.file,
5151
regexp: configRegex,
@@ -80,7 +80,7 @@ export default class DatabaseInfo {
8080
*/
8181
async updateColumnProperties(columnId:string, properties:Record<string,any>):Promise<void>{
8282
const currentCol = this.yaml.columns[columnId];
83-
for (let key in properties) {
83+
for (const key in properties) {
8484
currentCol[key] = properties[key];
8585
}
8686
this.yaml.columns[columnId] = currentCol;

src/services/FileManagerService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { TFile, TFolder } from "obsidian";
44
import { LOGGER } from "services/Logger";
55
export class VaultManager{
66
private static instance: VaultManager;
7-
constructor(){}
87

98
/**
109
* Add new file inside TFolder
@@ -30,8 +29,8 @@ export class VaultManager{
3029
async editNoteContent(note:NoteContentAction):Promise<void>{
3130
LOGGER.debug(`=> editNoteContent. action:${note.action} filePath:${note.file.path}`);
3231
try{
33-
let tfileContent = await this.obtainContentFromTfile(note.file);
34-
let line_string = new FileContent(tfileContent);
32+
const tfileContent = await this.obtainContentFromTfile(note.file);
33+
const line_string = new FileContent(tfileContent);
3534
let releasedContent = tfileContent;
3635
switch (note.action) {
3736
case 'remove':
@@ -41,7 +40,7 @@ export class VaultManager{
4140
releasedContent = line_string.replaceAll(note.regexp, note.newValue).value;
4241
break;
4342
default:
44-
throw "Error: Option " + note.action + " is not supported with tp.user.editNoteContent.";
43+
throw "Error: Option " + note.action + " is not supported yet";
4544
}
4645
await app.vault.modify(note.file,releasedContent);
4746
LOGGER.debug(`<= editNoteContent. file '${note.file.path}' edited`);

src/services/Logger.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ const LevelInfoRecord: Record<string, number> = {
1515
};
1616
class Log implements LogInterface{
1717
private static instance: LogInterface;
18-
private isDebugModeEnabled: boolean = false;
19-
private levelInfo:number = 0;
20-
private constructor() {}
18+
private isDebugModeEnabled:boolean;
19+
private levelInfo:number;
20+
private constructor() {
21+
this.isDebugModeEnabled = false;
22+
this.levelInfo = 0;
23+
}
2124

2225
public debug(primaryMessage: string, ...supportingData: any[]){
2326
if(this.levelInfo >= LevelInfoRecord.debug){
@@ -61,7 +64,7 @@ class Log implements LogInterface{
6164
if(!this.isDebugModeEnabled){
6265
return;
6366
}
64-
let moment: string = new Date().toISOString();
67+
const moment: string = new Date().toISOString();
6568
if(supportingData.length > 0){
6669
console.log(`[${moment}] [${level}] ${message}`, supportingData);
6770
}else{

styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ html {
300300

301301
.resizer {
302302
display: inline-block;
303-
width: 15px;
303+
width: 10px;
304304
height: 100%;
305305
position: absolute;
306306
right: 0;

0 commit comments

Comments
 (0)