いい感じに

This commit is contained in:
syuilo 2017-03-03 10:31:59 +09:00
parent e0c44abd4a
commit 73ac13a274
1 changed files with 6 additions and 26 deletions

View File

@ -31,10 +31,10 @@
/**
* null undefined
*
* nullまたはundefined
* null undefined
*
*
* nullとundefinedを次のように区別していま:
* null undefined :
* null ...
* undefined ...
*
@ -47,9 +47,9 @@
* undefined null
* undefined null
*
* .require()
* () .notUndefined()
* .notNull() 使
* null null
* null nullable :
* const [val, err] = it(x).must.be.a.nullable.string().required().qed();
*/
import * as mongo from 'mongodb';
@ -104,35 +104,15 @@ class QueryCore implements Query {
}
/**
*
* (=undefined)
*/
required() {
if (this.error === null && this.isEmpty) {
this.error = new Error('required');
}
return this;
}
/**
* (=undefined)
*/
notUndefined() {
if (this.error === null && this.isUndefined) {
this.error = new Error('required');
}
return this;
}
/**
* null
*/
notNull() {
if (this.error === null && this.isNull) {
this.error = new Error('required');
}
return this;
}
/**
* (=undefined)
*/