![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/vue-router/src/util/ |
/* @flow */ import { warn } from './warn' import Regexp from 'path-to-regexp' // $flow-disable-line const regexpCompileCache: { [key: string]: Function } = Object.create(null) export function fillParams ( path: string, params: ?Object, routeMsg: string ): string { params = params || {} try { const filler = regexpCompileCache[path] || (regexpCompileCache[path] = Regexp.compile(path)) // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }} // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string if (typeof params.pathMatch === 'string') params[0] = params.pathMatch return filler(params, { pretty: true }) } catch (e) { if (process.env.NODE_ENV !== 'production') { // Fix #3072 no warn if `pathMatch` is string warn(typeof params.pathMatch === 'string', `missing param for ${routeMsg}: ${e.message}`) } return '' } finally { // delete the 0 if it was added delete params[0] } }