@schema-ts/core 0.1.1 → 0.1.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.
- package/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2278,7 +2278,11 @@ var SchemaRuntime = class {
|
|
|
2278
2278
|
}
|
|
2279
2279
|
const defaultValue = initialValue !== void 0 ? initialValue : getDefaultValue(subschema);
|
|
2280
2280
|
const itemPath = jsonPointerJoin(normalizedPath, String(newIndex));
|
|
2281
|
-
|
|
2281
|
+
const success = setJsonPointer(this.value, itemPath, defaultValue);
|
|
2282
|
+
if (!success) return false;
|
|
2283
|
+
this.reconcile(normalizedPath);
|
|
2284
|
+
this.notify({ type: "value", path: normalizedPath });
|
|
2285
|
+
return true;
|
|
2282
2286
|
} else if (parentNode.type === "object" && parentValue && typeof parentValue === "object") {
|
|
2283
2287
|
if (!key) {
|
|
2284
2288
|
return false;
|
|
@@ -2292,7 +2296,11 @@ var SchemaRuntime = class {
|
|
|
2292
2296
|
}
|
|
2293
2297
|
const defaultValue = initialValue !== void 0 ? initialValue : getDefaultValue(subschema);
|
|
2294
2298
|
const propertyPath = jsonPointerJoin(normalizedPath, key);
|
|
2295
|
-
|
|
2299
|
+
const success = setJsonPointer(this.value, propertyPath, defaultValue);
|
|
2300
|
+
if (!success) return false;
|
|
2301
|
+
this.reconcile(normalizedPath);
|
|
2302
|
+
this.notify({ type: "value", path: normalizedPath });
|
|
2303
|
+
return true;
|
|
2296
2304
|
}
|
|
2297
2305
|
return false;
|
|
2298
2306
|
}
|