-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f7502f
commit 68e9c8f
Showing
19 changed files
with
781 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/node_modules | ||
/package-lock.json | ||
*.log* | ||
*.log* | ||
.nyc_output | ||
.rpt2_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/src | ||
/test | ||
.nyc_output | ||
.rpt2_cache | ||
.travis.yml | ||
.gitignore | ||
rollup.config.js | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- 7.10.0 | ||
- 8.0.0 | ||
- 9.1.0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* A recursive function that takes a required route as an argument, | ||
* then calls itself if it's an array, otherwise returns the | ||
* translated route. | ||
* @param {mixed} route array or object containing the route information | ||
* @param {func} middleware middleware of the endpoint/group | ||
* @param {string} prefix prepended to the beginning of endpoint | ||
* @returns object containing the translated route | ||
*/ | ||
export declare function routeTranslator(route: any, middleware?: any, prefix?: any): any; | ||
/** | ||
* Flatten your route, takes care of your middleware and everything. | ||
* @param routes | ||
* @return Array | ||
*/ | ||
export declare function transformRoutes(routes: any): any; | ||
/** | ||
* takes a restify server as an argument, returns a function | ||
* that takes an array of object. | ||
* @param {Server} server restify server | ||
* @param {boolean} verbose log routing | ||
* @returns routing function | ||
*/ | ||
export default function configureRoutes(server: any, verbose?: boolean, logger?: (message?: any, ...optionalParams: any[]) => void): (routes: any) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* sorts the given routes | ||
* @param {array} routes array of routes | ||
* @returns sorted routes | ||
*/ | ||
export declare function sortRoutes(routes: Array<any>): any; | ||
/** | ||
* Group sorted routes based on wildcards | ||
* @param routes | ||
* @return grouped routes | ||
*/ | ||
export declare function groupSortWildcards(routes: Array<any>): any; | ||
/** | ||
* function for sorting based on slash count | ||
* @param previous previous element | ||
* @param current current element | ||
*/ | ||
export declare function slashCount(previous: any, current: any): number; | ||
/** | ||
* Group routes based on its slash count | ||
* @param array routes | ||
*/ | ||
export declare function groupBySlashes(array: Array<any>): any; | ||
/** | ||
* function for sorting based on wildcards | ||
* @param previous previous element | ||
* @param current current element | ||
*/ | ||
export declare function wildCard(previous: any, current: any): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,55 @@ | ||
{ | ||
"name": "restify-route-config", | ||
"version": "0.1.0", | ||
"description": "", | ||
"main": "index.js", | ||
"name": "restify-router-config", | ||
"version": "1.2.0-alpha.0", | ||
"description": "The laziest way to route your restify app.", | ||
"main": "dist/index.min.js", | ||
"types": "dist/src/router.d.ts", | ||
"scripts": { | ||
"clean:assets": "rimraf ./public/assets", | ||
"postinstall": "npm run compile", | ||
"clean": "rm -rf dist && mkdir dist", | ||
"clean:compile": "rm -rf dist/compiled", | ||
"compile:babel": "babel-compile -p env src:dist", | ||
"compile:minify": "minify dist/compiled -d dist", | ||
"compile": "npm run clean && npm run compile:babel", | ||
"dev": "nodemon server.js --exec babel-node --presets=env,stage-0,stage-1,stage-2 --watch", | ||
"test": "_mocha test --require babel-polyfill --require babel-register" | ||
"test": "nyc --check-coverage --lines 10 mocha -r ts-node/register test/**.test.ts", | ||
"rollup": "rollup -c", | ||
"clean": "rimraf ./dist", | ||
"build": "npm run clean && npm run rollup" | ||
}, | ||
"keywords": [ | ||
"restify", | ||
"restify-router", | ||
"express", | ||
"express-router-config", | ||
"express-router", | ||
"router", | ||
"config", | ||
"react", | ||
"inspired" | ||
], | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.ts" | ||
], | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
] | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-compile": "^2.0.0", | ||
"babel-core": "^6.26.0", | ||
"babel-minify": "^0.2.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"babel-preset-stage-1": "^6.24.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"@types/chai": "^4.1.3", | ||
"@types/mocha": "^5.2.0", | ||
"@types/node": "^10.1.0", | ||
"@types/restify": "^7.2.0", | ||
"chai": "^4.1.2", | ||
"mocha": "^5.1.1", | ||
"nyc": "^11.8.0", | ||
"rimraf": "^2.6.2", | ||
"xo": "^0.18.2" | ||
"rollup": "^0.58.2", | ||
"rollup-plugin-alias": "^1.4.0", | ||
"rollup-plugin-typescript2": "^0.14.0", | ||
"rollup-plugin-uglify": "^4.0.0", | ||
"ts-node": "^6.0.3", | ||
"typescript": "^2.8.3", | ||
"uglify-js": "^3.3.25" | ||
} | ||
} |
Oops, something went wrong.