Skip to content

Commit

Permalink
Most edited notes view
Browse files Browse the repository at this point in the history
Added an ability to see your most edited notes
  • Loading branch information
plasmabit committed Apr 7, 2024
1 parent fe01e64 commit f60bedd
Show file tree
Hide file tree
Showing 14 changed files with 661 additions and 531 deletions.
202 changes: 192 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@types/node": "^16.11.6",
"@types/moment-duration-format": "^2.2.6",
"@types/node": "^20.12.2",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.17.3",
"obsidian": "latest",
"obsidian": "^1.5.7-1",
"prettier": "3.2.5",
"ts-node": "^10.9.2",
"tslib": "2.4.0",
"typescript": "4.7.4"
},
"dependencies": {
"moment-duration-format": "^2.3.2"
}
}
11 changes: 6 additions & 5 deletions src/BOMS.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function getValue(obj: any, fieldPath: string) {
export function getValue(frontmatter: any, fieldPath: string) {
// Prepare everything
const keys = fieldPath.split(".");
let value = obj;
let value = frontmatter;

for (const key of keys) {
value = value[key];
Expand All @@ -12,9 +13,9 @@ export function getValue(obj: any, fieldPath: string) {
return value;
}

export function setValue(obj: any, path: string, value: any) {
const keys = path.split(".");
let currentLevel = obj;
export function setValue(frontmatter: any, fieldPath: string, value: any) {
const keys = fieldPath.split(".");
let currentLevel = frontmatter;

for (let i = 0; i < keys.length - 1; i++) {
const key = keys[i];
Expand Down
Loading

0 comments on commit f60bedd

Please sign in to comment.