Skip to content

Commit d6d5dbb

Browse files
committed
Group of changes addressing compatibility issued with Obsidian 1.7.2 and newer
1 parent 2c2053d commit d6d5dbb

File tree

6 files changed

+217
-172
lines changed

6 files changed

+217
-172
lines changed

src/custom-sort/folder-matching-rules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class FolderWildcardMatching<SortingSpec> {
161161
}
162162
}
163163

164-
rule = rule ?? inheritedRule
164+
rule ??= inheritedRule
165165
}
166166

167167
if (rule) {

src/custom-sort/sorting-spec-processor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,23 +673,23 @@ export interface SortSpecsCollection {
673673
}
674674

675675
const ensureCollectionHasSortSpecByPath = (collection?: SortSpecsCollection | null) => {
676-
collection = collection ?? {}
676+
collection ??= {}
677677
if (!collection.sortSpecByPath) {
678678
collection.sortSpecByPath = {}
679679
}
680680
return collection
681681
}
682682

683683
const ensureCollectionHasSortSpecByName = (collection?: SortSpecsCollection | null) => {
684-
collection = collection ?? {}
684+
collection ??= {}
685685
if (!collection.sortSpecByName) {
686686
collection.sortSpecByName = {}
687687
}
688688
return collection
689689
}
690690

691691
const ensureCollectionHasSortSpecByWildcard = (collection?: SortSpecsCollection | null) => {
692-
collection = collection ?? {}
692+
collection ??= {}
693693
if (!collection.sortSpecByWildcard) {
694694
collection.sortSpecByWildcard = new FolderWildcardMatching<CustomSortSpec>((spec: CustomSortSpec) => !!spec.implicit)
695695
}

0 commit comments

Comments
 (0)