generated from Seekra/repository-template
feat(settings): add page path normalization type check
Added a type check to the normalizePagePath function. The function now returns an empty array if the path is not a string.
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
export const normalizePagePath = function normalizePagePath (path) {
|
||||
if (typeof path !== 'string') return [];
|
||||
return path
|
||||
.replace(/^\.+|\.+$/g, '')
|
||||
.split('.')
|
||||
|
||||
Reference in New Issue
Block a user