Feat(settings): add renderer for settings configuration #142

Merged
jakob.scheid merged 88 commits from feature/settings-renderer into main 2026-07-28 20:14:50 +02:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 24b4e45116 - Show all commits
@@ -57,7 +57,12 @@ describe('useSettingsPage', () => {
{ path: '....@a/#...)!&§[b.#§c..d....', expected: ['a', 'b', 'c', 'd'] }, { path: '....@a/#...)!&§[b.#§c..d....', expected: ['a', 'b', 'c', 'd'] },
{ path: '....@a/#...)!&§[b.#§c..dä....', expected: ['a', 'b', 'c', 'd'] }, { path: '....@a/#...)!&§[b.#§c..dä....', expected: ['a', 'b', 'c', 'd'] },
{ path: '..,...~..@a/#.+..)!&§[b.#§c..dä..)..', expected: ['a', 'b', 'c', 'd'] }, { path: '..,...~..@a/#.+..)!&§[b.#§c..dä..)..', expected: ['a', 'b', 'c', 'd'] },
{ path: 'a.@.b', expected: ['a', 'b'] } { path: 'a.@.b', expected: ['a', 'b'] },
{ path: 1, expected: [] },
{ path: false, expected: [] },
{ path: true, expected: [] },
{ path: null, expected: [] },
{ path: undefined, expected: [] }
])('normalizes path correctly', async ({ path, expected }) => { ])('normalizes path correctly', async ({ path, expected }) => {
expect(normalizePagePath(path)).toStrictEqual(expected); expect(normalizePagePath(path)).toStrictEqual(expected);
}); });
@@ -17,6 +17,7 @@ limitations under the License.
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
export const normalizePagePath = function normalizePagePath (path) { export const normalizePagePath = function normalizePagePath (path) {
if (typeof path !== 'string') return [];
return path return path
.replace(/^\.+|\.+$/g, '') .replace(/^\.+|\.+$/g, '')
.split('.') .split('.')