Skip to content

Commit 792c243

Browse files
authored
Merge pull request #43 from icd2k3/42
#42 Adds matchOptions to ts types
2 parents 305a628 + 8460819 commit 792c243

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
yarn lint && yarn test
3+
yarn lint && yarn types && yarn test

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-breadcrumbs-hoc",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "Just a tiny, flexible, higher order component for rendering breadcrumbs with react-router 4.x",
55
"repository": "icd2k3/react-router-breadcrumbs-hoc",
66
"keywords": [
@@ -23,8 +23,8 @@
2323
"humanize-string": "^1.0.2"
2424
},
2525
"devDependencies": {
26-
"@types/react": "^16.4.6",
27-
"@types/react-router-dom": "^4.2.7",
26+
"@types/react": "16.4.6",
27+
"@types/react-router-dom": "4.2.7",
2828
"babel-cli": "^6.26.0",
2929
"babel-core": "^6.26.3",
3030
"babel-eslint": "^8.2.6",
@@ -44,8 +44,8 @@
4444
"eslint-plugin-react": "^7.10.0",
4545
"jest": "^23.4.0",
4646
"prop-types": "^15.6.2",
47-
"react": "^16.4.1",
48-
"react-dom": "^16.4.1",
47+
"react": "16.4.1",
48+
"react-dom": "16.4.1",
4949
"react-router": "^4.3.1",
5050
"react-router-dom": "^4.3.1",
5151
"rollup": "^0.62.0",

types/react-router-breadcrumbs-hoc/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ export interface Options {
1313
pathSection?: string;
1414
}
1515

16+
export interface MatchOptions {
17+
exact?: boolean;
18+
strict?: boolean;
19+
sensitive?: boolean;
20+
}
21+
1622
export interface BreadcrumbsRoute {
1723
path: string;
1824
breadcrumb: React.ReactNode | string;
25+
matchOptions?: MatchOptions;
1926
}
2027

2128
export interface BreadcrumbsProps<T = {}> {

types/react-router-breadcrumbs-hoc/react-router-breadcrumbs-hoc-tests.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ const UserBreadcrumb = ({ match }: UserBreadcrumbProps) => (
1818

1919
const routes: BreadcrumbsRoute[] = [
2020
{ path: "/users/:userId", breadcrumb: UserBreadcrumb },
21-
{ path: "/example", breadcrumb: "Custom Example" }
21+
{ path: "/example", breadcrumb: "Custom Example" },
22+
{
23+
path: "/test-match-options",
24+
breadcrumb: "Match Options",
25+
matchOptions: { exact: true, strict: true },
26+
},
2227
];
2328

2429
const Breadcrumbs = ({ breadcrumbs }: InjectedProps) => (

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
version "10.5.2"
105105
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707"
106106

107-
"@types/react-router-dom@^4.2.7":
107+
"@types/react-router-dom@4.2.7":
108108
version "4.2.7"
109109
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.2.7.tgz#9d36bfe175f916dd8d7b6b0237feed6cce376b4c"
110110
dependencies:
@@ -119,7 +119,7 @@
119119
"@types/history" "*"
120120
"@types/react" "*"
121121

122-
"@types/react@*", "@types/react@^16.4.6":
122+
"@types/react@*", "@types/react@16.4.6":
123123
version "16.4.6"
124124
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.6.tgz#5024957c6bcef4f02823accf5974faba2e54fada"
125125
dependencies:
@@ -3903,7 +3903,7 @@ rc@^1.2.7:
39033903
minimist "^1.2.0"
39043904
strip-json-comments "~2.0.1"
39053905

3906-
react-dom@^16.4.1:
3906+
react-dom@16.4.1:
39073907
version "16.4.1"
39083908
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6"
39093909
dependencies:
@@ -3957,7 +3957,7 @@ react-test-renderer@^16.0.0-0:
39573957
prop-types "^15.6.0"
39583958
react-is "^16.4.1"
39593959

3960-
react@^16.4.1:
3960+
react@16.4.1:
39613961
version "16.4.1"
39623962
resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32"
39633963
dependencies:

0 commit comments

Comments
 (0)