Update cafy to 8.0.0 🚀

This commit is contained in:
syuilo
2018-05-02 18:06:16 +09:00
parent 0c3e9dd5e0
commit f664cf09c0
97 changed files with 294 additions and 291 deletions

View File

@ -8,8 +8,8 @@ export const isNotAnId = x => !isAnId(x);
* ID
*/
export default class ID extends Query<mongo.ObjectID> {
constructor(...args) {
super(...args);
constructor() {
super();
this.transform = v => {
if (isAnId(v) && !mongo.ObjectID.prototype.isPrototypeOf(v)) {
@ -19,7 +19,7 @@ export default class ID extends Query<mongo.ObjectID> {
}
};
this.pushValidator(v => {
this.push(v => {
if (!mongo.ObjectID.prototype.isPrototypeOf(v) && isNotAnId(v)) {
return new Error('must-be-an-id');
}