Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_js:
- '10'
- '12'
before_install:
- npm i npminstall -g
- npm i npminstall@3.28.0 -g
install:
- npminstall
script:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:

install:
- ps: Install-Product node $env:nodejs_version
- npm i npminstall && node_modules\.bin\npminstall
- npm i npminstall@3.28.0 && node_modules\.bin\npminstall

test_script:
- node --version
Expand Down
8 changes: 3 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ interface ValidateError {
}

declare module 'egg' {
import Parameter from 'parameter'
export interface Application {
validator: {
addRule: (type: string, check: RegExp | CheckHandlerFunc) => void;
validate: (rules: any, data: any) => ValidateError[];
};
validator: Parameter;
}

export interface Context {
validate: (rules: any, data?: any) => void;
validate: (rules: Parameter.ParameterRules, data?: unknown) => void;
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"validate"
],
"dependencies": {
"@types/parameter": "^3.6.0",
"parameter": "^3.0.0"
},
"devDependencies": {
Expand Down