Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
typed-routes-generator
Advanced tools
Provide route definitions in yaml file and get generated typed routes with parameters in paths. There is no limit how deep routes can be. Also you can define in one yaml file multiple route types that each will be exported as separate const.
Argument (parameter) can be text, numbers but no special characters like _
, -
, etc.
yarn typed-routes-generator --source ./example/routes.yaml --output ./example/generated.ts
mainRoutes:
firstLevel:
anotherLevel:
anotherLevel:
lastLevel:
homeWithArgument: "/[someargumentkey]"
websiteRoutes:
home: /
product:
archive: "/products"
detail: "/products/[detail]"
aboutUs: "/about-us"
export const mainRoutes = {
firstLevel: {
anotherLevel: {
anotherLevel: {
lastLevel: {
homeWithArgument: (params: { someargumentkey: string }) => '/[someargumentkey]'.replace('[someargumentkey]', params.someargumentkey.toLowerCase()),
},
},
},
},
};
export const websiteRoutes = {
home: () => '/',
product: { archive: () => '/products', detail: (params: { detail: string }) => '/products/[detail]'.replace('[detail]', params.detail.toLowerCase()) },
aboutUs: () => '/about-us',
};
websiteRoutes.product.detail({ detail: 'product-id' });
// Output: /products/product-id
FAQs
Generate typed routes from yaml file
The npm package typed-routes-generator receives a total of 281 weekly downloads. As such, typed-routes-generator popularity was classified as not popular.
We found that typed-routes-generator 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.