@sinclair/typebox 0.34.1 → 0.34.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.
|
@@ -15,7 +15,7 @@ const symbols_1 = require("../symbols/symbols");
|
|
|
15
15
|
// Guards
|
|
16
16
|
// ------------------------------------------------------------------
|
|
17
17
|
const kind_1 = require("../guard/kind");
|
|
18
|
-
const
|
|
18
|
+
const value_1 = require("../guard/value");
|
|
19
19
|
// ------------------------------------------------------------------
|
|
20
20
|
// Infrastructure
|
|
21
21
|
// ------------------------------------------------------------------
|
|
@@ -57,7 +57,7 @@ function PickResolve(properties, propertyKeys) {
|
|
|
57
57
|
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
58
58
|
// prettier-ignore
|
|
59
59
|
function Pick(type, key, options) {
|
|
60
|
-
const typeKey = (0,
|
|
60
|
+
const typeKey = (0, value_1.IsArray)(key) ? UnionFromPropertyKeys(key) : key;
|
|
61
61
|
const propertyKeys = (0, kind_1.IsSchema)(key) ? (0, index_6.IndexPropertyKeys)(key) : key;
|
|
62
62
|
const isTypeRef = (0, kind_1.IsRef)(type);
|
|
63
63
|
const isKeyRef = (0, kind_1.IsRef)(key);
|
|
@@ -11,7 +11,7 @@ import { TransformKind } from '../symbols/symbols.mjs';
|
|
|
11
11
|
// Guards
|
|
12
12
|
// ------------------------------------------------------------------
|
|
13
13
|
import { IsMappedKey, IsMappedResult, IsIntersect, IsUnion, IsObject, IsSchema, IsLiteralValue, IsRef } from '../guard/kind.mjs';
|
|
14
|
-
import { IsArray as IsArrayValue } from '
|
|
14
|
+
import { IsArray as IsArrayValue } from '../guard/value.mjs';
|
|
15
15
|
// ------------------------------------------------------------------
|
|
16
16
|
// Infrastructure
|
|
17
17
|
// ------------------------------------------------------------------
|