MCPcopy Index your code
hub / github.com/keepfool/vue-tutorials / formatSubPath

Function formatSubPath

06.Router/basic/js/vue.js:2611–2618  ·  view source on GitHub ↗

* Format a subPath, return its plain form if it is * a literal string or number. Otherwise prepend the * dynamic indicator (*). * * @param {String} path * @return {String}

(path)

Source from the content-addressed store, hash-verified

2609 */
2610
2611 function formatSubPath(path) {
2612 var trimmed = path.trim();
2613 // invalid leading 0
2614 if (path.charAt(0) === '0' && isNaN(path)) {
2615 return false;
2616 }
2617 return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;
2618 }
2619
2620 /**
2621 * Parse a string path into an array of segments

Callers 1

parseFunction · 0.70

Calls 2

isLiteralFunction · 0.70
stripQuotesFunction · 0.70

Tested by

no test coverage detected