From 21a1e1fcb0ff7a59e7adca069aa8f4ffe745e570 Mon Sep 17 00:00:00 2001 From: jakobrosenberg Date: Fri, 4 Oct 2024 16:48:02 -0700 Subject: [PATCH] feat: null support for $url and $goto --- lib/runtime/helpers/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/runtime/helpers/index.js b/lib/runtime/helpers/index.js index 519dacf4..82019435 100644 --- a/lib/runtime/helpers/index.js +++ b/lib/runtime/helpers/index.js @@ -159,7 +159,12 @@ export const createUrl = (fragment, router) => /** @type {UrlFromString} */ (pathOrNode, userParams = {}, options = {}) => { - let _inputPath = typeof pathOrNode === 'string' ? pathOrNode : pathOrNode?.path + let _inputPath = + typeof pathOrNode === 'string' + ? pathOrNode + : pathOrNode === null + ? '$leaf' + : pathOrNode?.path const route = fragment.route // in case we swapped the routes tree (rootNode), make sure we find