@sanity/types 6.9.1-next.3 → 6.9.1-next.6
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/index.d.ts +9 -13
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -2122,22 +2122,18 @@ type InitialValueProperty<Params, Value> = Value | InitialValueResolver<Params,
|
|
|
2122
2122
|
* If the schema has not been run through `inferFromSchema` from
|
|
2123
2123
|
* `sanity/validation` then value could be a function.
|
|
2124
2124
|
*
|
|
2125
|
-
* `inferFromSchema` mutates the schema converts this value to an array of
|
|
2126
|
-
* `Rule` instances
|
|
2125
|
+
* `inferFromSchema` mutates the schema and converts this value to an array of
|
|
2126
|
+
* `Rule` instances, _except_ for context-aware validation (a function declaring a
|
|
2127
|
+
* `context` parameter), which stays a function so it can be re-evaluated against
|
|
2128
|
+
* the value being validated.
|
|
2127
2129
|
*
|
|
2128
2130
|
* @privateRemarks
|
|
2129
2131
|
*
|
|
2130
|
-
*
|
|
2131
|
-
*
|
|
2132
|
-
*
|
|
2133
|
-
*
|
|
2134
|
-
*
|
|
2135
|
-
* if (typeof type.validation === 'function') {
|
|
2136
|
-
* throw new Error(
|
|
2137
|
-
* `Schema type "${type.name}"'s \`validation\` was not run though \`inferFromSchema\``
|
|
2138
|
-
* )
|
|
2139
|
-
* }
|
|
2140
|
-
* ```
|
|
2132
|
+
* This means a compiled schema can still hold a function here, so do not treat
|
|
2133
|
+
* that as a sign the schema was never compiled. To read rules outside of document
|
|
2134
|
+
* validation, normalize on demand with `normalizeValidationRules(type)` and be
|
|
2135
|
+
* ready for it to throw, since context-aware validation may dereference a context
|
|
2136
|
+
* that only exists while validating. `getValidationRule` does this.
|
|
2141
2137
|
*
|
|
2142
2138
|
* @public
|
|
2143
2139
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/types",
|
|
3
|
-
"version": "6.9.1-next.
|
|
3
|
+
"version": "6.9.1-next.6",
|
|
4
4
|
"description": "Type definitions for common Sanity data structures",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
45
|
"vite": "^8.2.0",
|
|
46
46
|
"vitest": "^4.1.10",
|
|
47
|
-
"@repo/
|
|
48
|
-
"@repo/
|
|
49
|
-
"@repo/
|
|
47
|
+
"@repo/tsconfig": "6.9.1-next.6+9ad5a19b5f",
|
|
48
|
+
"@repo/tsdown.config": "6.9.1-next.6+9ad5a19b5f",
|
|
49
|
+
"@repo/test-config": "6.9.1-next.6+9ad5a19b5f"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@types/react": "*"
|