refactor(sanitizeAttributeNames): directly export function

no need to wrap the exported function in an object first
This commit is contained in:
Panagiotis Papadopoulos
2025-01-02 16:26:23 +01:00
parent 2556d51870
commit afb91f82e1
5 changed files with 9 additions and 14 deletions

View File

@@ -754,7 +754,7 @@ class ConsistencyChecks {
const attrNames = sql.getColumn<string>(`SELECT DISTINCT name FROM attributes`);
for (const origName of attrNames) {
const fixedName = sanitizeAttributeName.sanitizeAttributeName(origName);
const fixedName = sanitizeAttributeName(origName);
if (fixedName !== origName) {
if (this.autoFix) {

View File

@@ -151,7 +151,7 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Pr
labelName = 'pageUrl';
}
labelName = sanitizeAttributeName.sanitizeAttributeName(labelName || "");
labelName = sanitizeAttributeName(labelName || "");
if (note.attributes) {
note.attributes.push({
@@ -202,7 +202,7 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Pr
} else if (currentTag === 'tag' && note.attributes) {
note.attributes.push({
type: 'label',
name: sanitizeAttributeName.sanitizeAttributeName(text),
name: sanitizeAttributeName(text),
value: ''
})
}

View File

@@ -1,4 +1,4 @@
function sanitizeAttributeName(origName: string) {
export default function sanitizeAttributeName(origName: string) {
let fixedName: string;
if (origName === '') {
@@ -10,9 +10,4 @@ function sanitizeAttributeName(origName: string) {
}
return fixedName;
}
export default {
sanitizeAttributeName
};
}