@next-core/brick-utils 2.41.2 → 2.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.bundle.js +10 -2
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +10 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/types/matchPath.d.ts +6 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.42.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.41.2...@next-core/brick-utils@2.42.0) (2022-09-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support router if condition ([4486130](https://github.com/easyops-cn/next-core/commit/44861303b0c236ec36f3bb55f469229e23116e5d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.41.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.41.1...@next-core/brick-utils@2.41.2) (2022-09-25)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @next-core/brick-utils
|
package/dist/index.bundle.js
CHANGED
|
@@ -21639,7 +21639,9 @@
|
|
|
21639
21639
|
path: p,
|
|
21640
21640
|
exact = false,
|
|
21641
21641
|
strict = false,
|
|
21642
|
-
sensitive = true
|
|
21642
|
+
sensitive = true,
|
|
21643
|
+
checkIf,
|
|
21644
|
+
getContext
|
|
21643
21645
|
} = options;
|
|
21644
21646
|
var paths = Array.isArray(p) ? p : [p];
|
|
21645
21647
|
return paths.reduce((matched, path) => {
|
|
@@ -21669,7 +21671,7 @@
|
|
|
21669
21671
|
}
|
|
21670
21672
|
|
|
21671
21673
|
var initialParams = {};
|
|
21672
|
-
|
|
21674
|
+
var result = {
|
|
21673
21675
|
path,
|
|
21674
21676
|
// the path used to match
|
|
21675
21677
|
url: path === "/" && url === "" ? "/" : url,
|
|
@@ -21681,6 +21683,12 @@
|
|
|
21681
21683
|
return memo;
|
|
21682
21684
|
}, initialParams)
|
|
21683
21685
|
};
|
|
21686
|
+
|
|
21687
|
+
if (checkIf && !checkIf(getContext(result))) {
|
|
21688
|
+
return null;
|
|
21689
|
+
}
|
|
21690
|
+
|
|
21691
|
+
return result;
|
|
21684
21692
|
}, null);
|
|
21685
21693
|
}
|
|
21686
21694
|
function toPath(path, pathParams) {
|