@sanity/schema 6.3.1-next.3 → 6.3.1-next.5
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/_internal.js +2 -1
- package/lib/_internal.js.map +1 -1
- package/package.json +5 -5
package/lib/_internal.js
CHANGED
|
@@ -2455,7 +2455,8 @@ function stringToRegExp(str) {
|
|
|
2455
2455
|
return match ? new RegExp(match[1], match[2]) : new RegExp(str);
|
|
2456
2456
|
}
|
|
2457
2457
|
function isRegexPattern(val) {
|
|
2458
|
-
return typeof val == "object" && val !== null && "type" in val &&
|
|
2458
|
+
return typeof val == "object" && val !== null && "type" in val && // oxlint-disable-next-line typescript/no-unnecessary-type-assertion
|
|
2459
|
+
val.type === "regex" && "pattern" in val && typeof val.pattern == "string";
|
|
2459
2460
|
}
|
|
2460
2461
|
function regexPatternToRegExp(val) {
|
|
2461
2462
|
const match = val.pattern.match(/^\(\?([a-z]+)\)(.*)$/);
|