baja-lite 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/validate.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baja-lite",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "some util for self",
5
5
  "homepage": "https://github.com/void-soul/util-man",
6
6
  "repository": {
package/validate.js CHANGED
@@ -337,7 +337,7 @@ export class ValidateItem {
337
337
  return [{
338
338
  validator: (_rule, value, callback, _source, _op) => {
339
339
  this.value = value;
340
- runSequentially(Object.keys(this.props).filter(key => this[key] && typeof this[key] === 'function').map(key => this[key])).catch(error => callback(error)).then(() => callback());
340
+ runSequentially(Object.keys(this.props).filter(key => this.props[key] !== undefined && this[key] && typeof this[key] === 'function').map(key => () => this[key]())).catch(error => callback(error)).then(() => callback());
341
341
  }, trigger: this.props.mkTrigger
342
342
  }];
343
343
  }
@@ -346,14 +346,14 @@ export class ValidateItem {
346
346
  required: this.props.required,
347
347
  validator: (val) => {
348
348
  this.value = val;
349
- return runSequentially(Object.keys(this.props).filter(key => this[key] && typeof this[key] === 'function').map(key => this[key]));
349
+ return runSequentially(Object.keys(this.props).filter(key => this.props[key] !== undefined && this[key] && typeof this[key] === 'function').map(key => () => this[key]()));
350
350
  }
351
351
  }];
352
352
  }
353
353
  async service() {
354
354
  this.value = this.getProp(this.props.mkRealProp || this.props.prop);
355
355
  for (const key in this.props) {
356
- if (this[key] && typeof this[key] === 'function') {
356
+ if (this.props[key] !== undefined && this[key] && typeof this[key] === 'function') {
357
357
  await this[key]();
358
358
  }
359
359
  }