@sinclair/typebox 0.34.38 → 0.34.39
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.
|
@@ -149,7 +149,7 @@ function FromNumber(schema, references, value) {
|
|
|
149
149
|
}
|
|
150
150
|
// prettier-ignore
|
|
151
151
|
function FromObject(schema, references, value) {
|
|
152
|
-
if (!(0, index_5.IsObject)(value))
|
|
152
|
+
if (!(0, index_5.IsObject)(value) || (0, index_5.IsArray)(value))
|
|
153
153
|
return value;
|
|
154
154
|
for (const propertyKey of Object.getOwnPropertyNames(schema.properties)) {
|
|
155
155
|
if (!(0, index_5.HasPropertyKey)(value, propertyKey))
|
|
@@ -159,7 +159,7 @@ function FromObject(schema, references, value) {
|
|
|
159
159
|
return value;
|
|
160
160
|
}
|
|
161
161
|
function FromRecord(schema, references, value) {
|
|
162
|
-
const isConvertable = (0, index_5.IsObject)(value);
|
|
162
|
+
const isConvertable = (0, index_5.IsObject)(value) && !(0, index_5.IsArray)(value);
|
|
163
163
|
if (!isConvertable)
|
|
164
164
|
return value;
|
|
165
165
|
const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0];
|
|
@@ -145,7 +145,7 @@ function FromNumber(schema, references, value) {
|
|
|
145
145
|
}
|
|
146
146
|
// prettier-ignore
|
|
147
147
|
function FromObject(schema, references, value) {
|
|
148
|
-
if (!IsObject(value))
|
|
148
|
+
if (!IsObject(value) || IsArray(value))
|
|
149
149
|
return value;
|
|
150
150
|
for (const propertyKey of Object.getOwnPropertyNames(schema.properties)) {
|
|
151
151
|
if (!HasPropertyKey(value, propertyKey))
|
|
@@ -155,7 +155,7 @@ function FromObject(schema, references, value) {
|
|
|
155
155
|
return value;
|
|
156
156
|
}
|
|
157
157
|
function FromRecord(schema, references, value) {
|
|
158
|
-
const isConvertable = IsObject(value);
|
|
158
|
+
const isConvertable = IsObject(value) && !IsArray(value);
|
|
159
159
|
if (!isConvertable)
|
|
160
160
|
return value;
|
|
161
161
|
const propertyKey = Object.getOwnPropertyNames(schema.patternProperties)[0];
|