Skip to content

Commit

Permalink
queries is optional; alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenYong committed May 16, 2019
1 parent 799d40c commit e42ba7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@jimengio/router-code-generator",
"version": "0.1.3-a1",
"version": "0.1.3-a2",
"description": "",
"main": "./lib/generator.js",
"scripts": {
Expand All @@ -12,7 +12,7 @@
"postinstall": "rm -rfv node_modules/@types/*/node_modules/@types/react",
"compile": "rm -rf lib && tsc -d --project tsconfig-compile.json --outDir lib/",
"test": "jest",
"prepare": "yarn compile"
"prepare": "yarn test && yarn compile"
},
"keywords": [],
"author": "",
Expand Down
4 changes: 2 additions & 2 deletions src/generator.ts
Expand Up @@ -62,8 +62,8 @@ function generateField(rule: IRouteRule, basePath: string): string {
let resultObj = ` {
name: ${nameString},
raw: ${rawPath},
path: <T=${queriesParam}>(${paramsList} queries: T) => ${pathInString},
go: <T=${queriesParam}>(${paramsList} queries: T) => switchPath(${pathInString}),
path: <T=${queriesParam}>(${paramsList} queries?: T) => ${pathInString},
go: <T=${queriesParam}>(${paramsList} queries?: T) => switchPath(${pathInString}),
${fieldsInString}
}
`;
Expand Down

0 comments on commit e42ba7e

Please sign in to comment.