MenuIterm selected but clicable mode added

This commit is contained in:
tmshv committed 2020-02-23 05:10:01 +03:00
1 parent 74f785134f
commit 822f1a0535
3 files changed
+7 -26

No files matched your search

-25
View File
@@ -1,25 +0,0 @@
function getPathWithNoTrailingSlash(path='') {
path = path.charAt(path.length - 1) === '/'
? path.substr(0, path.length - 1)
: path
return path.length === 0
? '/'
: path
}
function isEqualPath(a, b, ignoreTrailingSlash = false) {
return ignoreTrailingSlash
? getPathWithNoTrailingSlash(a) === getPathWithNoTrailingSlash(b)
: a === b
}
function isMatchPathPattern(pattern, path, ignoreTrailingSlash = false) {
const test = ignoreTrailingSlash
? getPathWithNoTrailingSlash(path)
: path
return pattern.test(test)
}
exports.getPathWithNoTrailingSlash = getPathWithNoTrailingSlash
exports.isMatchPathPattern = isMatchPathPattern
exports.isEqualPath = isEqualPath
+3
View File
@@ -0,0 +1,3 @@
export function isPartOfPath(part: string, path: string): boolean {
return path.startsWith(part)
}