j-templates 7.0.23 → 7.0.25

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.
@@ -195,6 +195,8 @@ function UpdateValue(scope) {
195
195
  const [value, emitters, calcFunctions] = WatchScope(scope);
196
196
  if (scope.async) {
197
197
  scope.promise = value.then(function (result) {
198
+ if (scope.destroyed)
199
+ return;
198
200
  scope.value = result;
199
201
  emitter_1.Emitter.Emit(scope.emitter, scope);
200
202
  return result;
package/Utils/json.js CHANGED
@@ -46,9 +46,14 @@ function JsonDiffFactory() {
46
46
  const typedSource = source;
47
47
  const typedPatch = patch;
48
48
  const sourceKeys = Object.keys(typedSource);
49
+ const targetKeys = Object.keys(typedPatch).filter(key => !sourceKeys.includes(key));
49
50
  const result = {};
50
- for (let x = 0; x < sourceKeys.length; x++)
51
+ for (let x = 0; x < sourceKeys.length; x++) {
51
52
  result[sourceKeys[x]] = JsonMerge(typedSource[sourceKeys[x]], typedPatch[sourceKeys[x]]);
53
+ }
54
+ for (let x = 0; x < targetKeys.length; x++) {
55
+ result[targetKeys[x]] = typedPatch[targetKeys[x]];
56
+ }
52
57
  return result;
53
58
  }
54
59
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "j-templates",
3
- "version": "7.0.23",
3
+ "version": "7.0.25",
4
4
  "description": "j-templates",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TypesInCode/jTemplates",