@sanity/validation 2.36.2-weighted-search.10 → 2.36.2
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/lib/Rule.js
CHANGED
|
@@ -67,6 +67,7 @@ var Rule = (_class = class Rule {
|
|
|
67
67
|
_defineProperty(this, "_message", undefined);
|
|
68
68
|
_defineProperty(this, "_rules", []);
|
|
69
69
|
_defineProperty(this, "_fieldRules", undefined);
|
|
70
|
+
// Alias to static method, since we often have access to an _instance_ of a rule but not the actual Rule class
|
|
70
71
|
_defineProperty(this, "valueOfField", Rule.valueOfField.bind(Rule));
|
|
71
72
|
this._typeDef = typeDef;
|
|
72
73
|
this.reset();
|
|
@@ -76,9 +77,6 @@ var Rule = (_class = class Rule {
|
|
|
76
77
|
if (this._required === 'optional' || next._required === 'optional') return 'optional';
|
|
77
78
|
return undefined;
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
-
// Alias to static method, since we often have access to an _instance_ of a rule but not the actual Rule class
|
|
81
|
-
|
|
82
80
|
error(message) {
|
|
83
81
|
var rule = this.clone();
|
|
84
82
|
rule._level = 'error';
|
|
@@ -66,6 +66,8 @@ function traverse(typeDef, visited) {
|
|
|
66
66
|
|
|
67
67
|
// NOTE: this overload is for TS API compatibility with a previous implementation
|
|
68
68
|
|
|
69
|
+
// note: this seemingly redundant overload is required
|
|
70
|
+
|
|
69
71
|
function inferFromSchemaType(typeDef) {
|
|
70
72
|
traverse(typeDef, new Set());
|
|
71
73
|
return typeDef;
|
|
@@ -22,7 +22,6 @@ var isoDate = /^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:
|
|
|
22
22
|
|
|
23
23
|
// eslint-disable-next-line no-warning-comments
|
|
24
24
|
// TODO (eventually): move these to schema type package
|
|
25
|
-
|
|
26
25
|
var getFormattedDate = function getFormattedDate() {
|
|
27
26
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
28
27
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -87,7 +87,7 @@ var slugValidator = /*#__PURE__*/function () {
|
|
|
87
87
|
if (!slugValue) {
|
|
88
88
|
return 'Slug must have a value';
|
|
89
89
|
}
|
|
90
|
-
var options = context === null || context === void 0
|
|
90
|
+
var options = context === null || context === void 0 || (_context$type = context.type) === null || _context$type === void 0 ? void 0 : _context$type.options;
|
|
91
91
|
var isUnique = (options === null || options === void 0 ? void 0 : options.isUnique) || defaultIsUnique;
|
|
92
92
|
var wasUnique = yield isUnique(slugValue, _objectSpread(_objectSpread({}, context), {}, {
|
|
93
93
|
defaultIsUnique
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/validation",
|
|
3
|
-
"version": "2.36.2
|
|
3
|
+
"version": "2.36.2",
|
|
4
4
|
"description": "Validation and warning infrastructure for Sanity projects",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./dist/dts",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@sanity/client": "^3.3.3",
|
|
36
|
-
"@sanity/schema": "2.36.2
|
|
36
|
+
"@sanity/schema": "2.36.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@sanity/types": "2.36.2
|
|
39
|
+
"@sanity/types": "2.36.2",
|
|
40
40
|
"date-fns": "^2.16.1",
|
|
41
41
|
"lodash": "^4.17.15",
|
|
42
42
|
"rxjs": "^6.5.3"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "547637ed8fef99e605fd7677982a66c9bc1fd696"
|
|
45
45
|
}
|