Ensure leading slash, if str does not start with slash, it will be added.
确保前缀,如果字符串不以斜杠开头,则将添加斜杠。
The string to ensure leading slash. / 要确保前缀的字符串
The string with leading slash. / 确保前缀后的字符串
ensureLeadingSlash('foo/bar') // => /foo/bar Copy
ensureLeadingSlash('foo/bar') // => /foo/bar
Ensure leading slash, if str does not start with slash, it will be added.
确保前缀,如果字符串不以斜杠开头,则将添加斜杠。