@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.js
CHANGED
|
@@ -2276,7 +2276,11 @@ var SchemaRuntime = class {
|
|
|
2276
2276
|
}
|
|
2277
2277
|
const defaultValue = initialValue !== void 0 ? initialValue : getDefaultValue(subschema);
|
|
2278
2278
|
const itemPath = jsonPointerJoin(normalizedPath, String(newIndex));
|
|
2279
|
-
|
|
2279
|
+
const success = setJsonPointer(this.value, itemPath, defaultValue);
|
|
2280
|
+
if (!success) return false;
|
|
2281
|
+
this.reconcile(normalizedPath);
|
|
2282
|
+
this.notify({ type: "value", path: normalizedPath });
|
|
2283
|
+
return true;
|
|
2280
2284
|
} else if (parentNode.type === "object" && parentValue && typeof parentValue === "object") {
|
|
2281
2285
|
if (!key) {
|
|
2282
2286
|
return false;
|
|
@@ -2290,7 +2294,11 @@ var SchemaRuntime = class {
|
|
|
2290
2294
|
}
|
|
2291
2295
|
const defaultValue = initialValue !== void 0 ? initialValue : getDefaultValue(subschema);
|
|
2292
2296
|
const propertyPath = jsonPointerJoin(normalizedPath, key);
|
|
2293
|
-
|
|
2297
|
+
const success = setJsonPointer(this.value, propertyPath, defaultValue);
|
|
2298
|
+
if (!success) return false;
|
|
2299
|
+
this.reconcile(normalizedPath);
|
|
2300
|
+
this.notify({ type: "value", path: normalizedPath });
|
|
2301
|
+
return true;
|
|
2294
2302
|
}
|
|
2295
2303
|
return false;
|
|
2296
2304
|
}
|