@valbuild/shared 0.129.0 → 0.130.0
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 +7 -0
- package/dist/declarations/src/internal/emptyOf.d.ts +15 -2
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +12 -0
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +12 -0
- package/internal/dist/valbuild-shared-internal.esm.js +12 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.130.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8425378`](https://github.com/valbuild/val/commit/8425378c315ea46b5d822f1130b633e0449ff1b0), [`473a185`](https://github.com/valbuild/val/commit/473a185f70351b44388f3bc1852649e2c1dbe001), [`64f0de3`](https://github.com/valbuild/val/commit/64f0de339b8621cb5a6c422dfe55cae5b2bbe2a0)]:
|
|
8
|
+
- @valbuild/core@0.130.0
|
|
9
|
+
|
|
3
10
|
## 0.129.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SerializedSchema
|
|
1
|
+
import { SerializedSchema } from "@valbuild/core";
|
|
2
|
+
import { JSONValue } from "@valbuild/core/patch";
|
|
2
3
|
/**
|
|
3
4
|
* What `emptyOf` cannot read off a serialized schema.
|
|
4
5
|
*
|
|
@@ -22,4 +23,16 @@ export type EmptyOfContext = {
|
|
|
22
23
|
*/
|
|
23
24
|
selectedLocale?: string;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The empty value for a schema — the thing a "create this" affordance writes.
|
|
28
|
+
*
|
|
29
|
+
* Returns `JSONValue`, the MUTABLE shape, rather than `Json`. Every value here
|
|
30
|
+
* is built fresh on the way out — `Object.fromEntries`, a new array, a
|
|
31
|
+
* primitive — and none of it aliases anything a caller could then mutate out
|
|
32
|
+
* from under someone. Saying `Json` instead made the type readonly, which is
|
|
33
|
+
* a claim about sharing that is not true of anything this returns, and left
|
|
34
|
+
* every caller asserting `as JSONValue` at the point of writing a patch. A
|
|
35
|
+
* `JSONValue` is still assignable to `Json`, so a reader of the value loses
|
|
36
|
+
* nothing.
|
|
37
|
+
*/
|
|
38
|
+
export declare function emptyOf(schema: SerializedSchema, context?: EmptyOfContext): JSONValue;
|
|
@@ -4610,6 +4610,18 @@ function clampDateTimeString(value, options) {
|
|
|
4610
4610
|
* validation then reports, rather than wrong ones.
|
|
4611
4611
|
*/
|
|
4612
4612
|
|
|
4613
|
+
/**
|
|
4614
|
+
* The empty value for a schema — the thing a "create this" affordance writes.
|
|
4615
|
+
*
|
|
4616
|
+
* Returns `JSONValue`, the MUTABLE shape, rather than `Json`. Every value here
|
|
4617
|
+
* is built fresh on the way out — `Object.fromEntries`, a new array, a
|
|
4618
|
+
* primitive — and none of it aliases anything a caller could then mutate out
|
|
4619
|
+
* from under someone. Saying `Json` instead made the type readonly, which is
|
|
4620
|
+
* a claim about sharing that is not true of anything this returns, and left
|
|
4621
|
+
* every caller asserting `as JSONValue` at the point of writing a patch. A
|
|
4622
|
+
* `JSONValue` is still assignable to `Json`, so a reader of the value loses
|
|
4623
|
+
* nothing.
|
|
4624
|
+
*/
|
|
4613
4625
|
function emptyOf(schema, context) {
|
|
4614
4626
|
if (schema.type === "object") {
|
|
4615
4627
|
return Object.fromEntries(Object.keys(schema.items).map(function (key) {
|
|
@@ -4610,6 +4610,18 @@ function clampDateTimeString(value, options) {
|
|
|
4610
4610
|
* validation then reports, rather than wrong ones.
|
|
4611
4611
|
*/
|
|
4612
4612
|
|
|
4613
|
+
/**
|
|
4614
|
+
* The empty value for a schema — the thing a "create this" affordance writes.
|
|
4615
|
+
*
|
|
4616
|
+
* Returns `JSONValue`, the MUTABLE shape, rather than `Json`. Every value here
|
|
4617
|
+
* is built fresh on the way out — `Object.fromEntries`, a new array, a
|
|
4618
|
+
* primitive — and none of it aliases anything a caller could then mutate out
|
|
4619
|
+
* from under someone. Saying `Json` instead made the type readonly, which is
|
|
4620
|
+
* a claim about sharing that is not true of anything this returns, and left
|
|
4621
|
+
* every caller asserting `as JSONValue` at the point of writing a patch. A
|
|
4622
|
+
* `JSONValue` is still assignable to `Json`, so a reader of the value loses
|
|
4623
|
+
* nothing.
|
|
4624
|
+
*/
|
|
4613
4625
|
function emptyOf(schema, context) {
|
|
4614
4626
|
if (schema.type === "object") {
|
|
4615
4627
|
return Object.fromEntries(Object.keys(schema.items).map(function (key) {
|
|
@@ -4603,6 +4603,18 @@ function clampDateTimeString(value, options) {
|
|
|
4603
4603
|
* validation then reports, rather than wrong ones.
|
|
4604
4604
|
*/
|
|
4605
4605
|
|
|
4606
|
+
/**
|
|
4607
|
+
* The empty value for a schema — the thing a "create this" affordance writes.
|
|
4608
|
+
*
|
|
4609
|
+
* Returns `JSONValue`, the MUTABLE shape, rather than `Json`. Every value here
|
|
4610
|
+
* is built fresh on the way out — `Object.fromEntries`, a new array, a
|
|
4611
|
+
* primitive — and none of it aliases anything a caller could then mutate out
|
|
4612
|
+
* from under someone. Saying `Json` instead made the type readonly, which is
|
|
4613
|
+
* a claim about sharing that is not true of anything this returns, and left
|
|
4614
|
+
* every caller asserting `as JSONValue` at the point of writing a patch. A
|
|
4615
|
+
* `JSONValue` is still assignable to `Json`, so a reader of the value loses
|
|
4616
|
+
* nothing.
|
|
4617
|
+
*/
|
|
4606
4618
|
function emptyOf(schema, context) {
|
|
4607
4619
|
if (schema.type === "object") {
|
|
4608
4620
|
return Object.fromEntries(Object.keys(schema.items).map(function (key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.130.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Val shared types and utilities",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"flexsearch": "^0.8.212",
|
|
38
38
|
"zod": "^4.4.3",
|
|
39
39
|
"zod-validation-error": "^5.0.0",
|
|
40
|
-
"@valbuild/core": "0.
|
|
40
|
+
"@valbuild/core": "0.130.0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"CHANGELOG.md",
|