Skip to content

Feat required config - #48

Open
ycjcl868 wants to merge 4 commits into
node-modules:masterfrom
ycjcl868:feat-required-config
Open

Feat required config#48
ycjcl868 wants to merge 4 commits into
node-modules:masterfrom
ycjcl868:feat-required-config

Conversation

@ycjcl868

Copy link
Copy Markdown

No description provided.

@codecov

codecovBot commented Aug 8, 2018

Copy link
Copy Markdown

Codecov Report

Merging #48 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@## master #48 +/- ##
=====================================
Coverage 100% 100% =====================================
Files 1 1 Lines 162 164 +2 Branches 56 57 +1 =====================================
+ Hits 162 164 +2
Impacted FilesCoverage Δ
index.js100% <100%> (ø)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 157712a...b8d4fa6. Read the comment docs.

@ycjcl868

ycjcl868 commented Aug 8, 2018

Copy link
Copy Markdown
Author

The condition is when having a create and edit common interface , I may code like this:

constschema={userId: {type: 'int'},title: {required: false,type: 'string',},brief: {required: false,type: 'string',},content: {required: false,type: 'string',},xxx1: {required: false,type: 'string',},
...
}ctx.validate(schema,myParams);

Comment threadindex.js Outdated
this.validateRoot = true;
}
this.defaultRequired = opts.defaultRequired !== undefined ?
opts.defaultRequired :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.defaultRequired = opts.defaultRequired !== false;

@ycjcl868ycjcl868Aug 8, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for cr ! ~

Comment threadindex.js Outdated
if (rule.required !== false) {
var required = rule.required !== undefined ?
rule.required :
this.defaultRequired;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

放一行吧,这样缩进有点奇怪

@ycjcl868ycjcl868Aug 8, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯,已修改。 839d425

@ycjcl868
ycjcl868force-pushed the feat-required-config branch from 698d819 to 85e257bCompareAugust 8, 2018 23:29
docs: options.defaultRequired
@fengmk2

Copy link
Copy Markdown
Member

rebase ?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ycjcl868@fengmk2@dead-horse