Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
breadcrumbs-next
Advanced tools
Imagine your app having the following routes:
/momentum
/projects/[projectId]
/[[…slug]]
/users/[userId]/[[…stuff]]
/users/[userId]/[[…slug]]?t=record
/users?t=record
/users/[userId]?t=record
Last three examples also include URL parameters, which can be used to construct breadcrumbs. For example, when you have a page consisting from another set of tabs, but you don't want to create another route for that.
All of those examples can be transformed to the following formats (lets omit Home
element in resulting breadcrumbs):
Pattern | Breadcrumbs | Example URL |
---|---|---|
/momentum | Momentum | = |
/profile?t=records | Profile > Records | = |
/projects/[projectId] | Projects > "Grammar" | /projects/17 |
/[[…slug]] | Russia > Moscow > Subway > Kommunarka | /russia/moscow/subway/kommunarka |
/users/[userId]/[[…stuff]] | Users > Pavel > Deliveries > Yandex > Lavka | /users/132/deliveries/yandex/lavka |
/users/[userId]/[[…slug]]?t=records [1] | Users > Pavel > Deliveries > Dashboard > Record | /users/132/deliveries/dashboard?t=records |
/users/[userId]?t=records | Users > Pavel > Records | /users/132?t=records |
[1] - Search params always are taken last, because change of URL (w/o params) is the same as opening another page, thus even having the same params set int the URL doesn't mean they should go in the beginning. They are behaviour modifiers of the page, but not its primary descriptor.
Ƭ BreadCrumb: Object
Name | Type |
---|---|
href | string |
text | string |
textGenerator | null or TextGeneratorFn |
Ƭ CrumbProps: Object
▪ [key: string
]: any
Name | Type |
---|---|
href | string |
isLast | boolean |
text | string |
Ƭ GetDefaultTextGenerator: (config
: { href
: string
; paramIndex
: number
; paramName
: string
; paramSlugIndex
: number
; paramValue
: string
; query
: NextRouter
["query"
] }) => string
▸ (config
): string
Name | Type |
---|---|
config | Object |
config.href | string |
config.paramIndex | number |
config.paramName | string |
config.isCatchAllSubpath | boolean |
config.paramSlugIndex | null or number |
config.paramValue | string |
config.query | NextRouter ["query" ] |
string
Ƭ GetTextGenerator: (config
: { href
: string
; paramIndex
: number
; paramName
: string
; paramSlugIndex
: number
; paramValue
: string
; query
: NextRouter
["query"
] }) => null
| TextGeneratorFn
▸ (config
): null
| TextGeneratorFn
Name | Type |
---|---|
config | Object |
config.href | string |
config.paramIndex | number |
config.paramName | string |
config.isCatchAllSubpath | boolean |
config.paramSlugIndex | null or number |
config.paramValue | string |
config.query | NextRouter ["query" ] |
null
| TextGeneratorFn
Ƭ NextBreadcrumbsProps: Object
Name | Type |
---|---|
Container | string or FC<{children: ReactNode}\> |
Crumb | FC<CrumbProps> |
getDefaultTextGenerator? | GetDefaultTextGenerator |
getTextGenerator? | GetTextGenerator |
homeText? | string |
useQueryParamsAsPathItems? | string[] |
Ƭ TextGeneratorFn: () => Promise
<string
>
▸ (): Promise
<string
>
Promise
<string
>
▸ NextBreadcrumbs(«destructured»
): JSX.Element
Name | Type |
---|---|
«destructured» | NextBreadcrumbsProps |
JSX.Element
▸ createNextCrumbComponent(Component
): FC<{ text: string ; textGenerator: null | TextGeneratorFn }\>
Name | Type |
---|---|
Component | FC<{ children: ReactNode }\> |
FC<{ text: string; textGenerator: null | TextGeneratorFn }\>
Here I would place any ideas to make in the future.
FAQs
The component to display breadcrumbs within NextJS web application
The npm package breadcrumbs-next receives a total of 0 weekly downloads. As such, breadcrumbs-next popularity was classified as not popular.
We found that breadcrumbs-next demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.