@bedrockio/yada 1.2.8 → 1.2.9

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.2.9
2
+
3
+ - Fixed field missing on empty strings.
4
+
1
5
  ## 1.2.8
2
6
 
3
7
  - Added "missing" which runs a custom validator on undefined.
@@ -35,7 +35,7 @@ class StringSchema extends _TypeSchema.default {
35
35
  allowEmpty
36
36
  } = options;
37
37
  if (val === '' && (required || allowEmpty === false)) {
38
- throw new _errors.LocalizedError('String may not be empty.');
38
+ throw new _errors.LocalizedError('Value is required.');
39
39
  }
40
40
  return val;
41
41
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/yada",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Validation library inspired by Joi.",
5
5
  "scripts": {
6
6
  "test": "jest",
package/src/string.js CHANGED
@@ -37,7 +37,7 @@ class StringSchema extends TypeSchema {
37
37
  this.assert('empty', (val, options) => {
38
38
  const { required, allowEmpty } = options;
39
39
  if (val === '' && (required || allowEmpty === false)) {
40
- throw new LocalizedError('String may not be empty.');
40
+ throw new LocalizedError('Value is required.');
41
41
  }
42
42
  return val;
43
43
  });