@live-change/framework 0.8.0 → 0.8.1

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.
@@ -1,3 +1,5 @@
1
+ import {mergeDeep} from "../utils.js"
2
+
1
3
  function nonEmpty(value) {
2
4
  if(!value) return 'empty'
3
5
  if(typeof value == 'string') {
@@ -21,7 +23,7 @@ function getField(context, fieldName) {
21
23
  } else {
22
24
  path = propPath.concat(fieldName.split('.'))
23
25
  }
24
- let p = context.props
26
+ let p = mergeDeep(context.props, context.parameters)
25
27
  for(let part of path) p = p[part]
26
28
  return p
27
29
  }
@@ -102,9 +104,9 @@ const validators = {
102
104
  ifNotOneOf: ({ prop, what, then }, { getValidator }) => {
103
105
  let validators = then.map(getValidator)
104
106
  const validator = (value, context) => {
105
- console.error("VIF NOT ONE OF", getField(context, prop), what, what.includes(getField(context, prop)))
107
+ //console.error("VIF NOT ONE OF", getField(context, prop), what, what.includes(getField(context, prop)))
106
108
  if(!what.includes(getField(context, prop))) {
107
- console.log("V", validators)
109
+ //console.log("V", validators)
108
110
  for(let v of validators) {
109
111
  const err = v(value, context)
110
112
  if(err) return err
package/lib/utils.js CHANGED
@@ -80,7 +80,10 @@ function crudChanges(oldElements, newElements, elementName, newParamName, params
80
80
  } else {
81
81
  if(newElement.computeChanges) {
82
82
  changes.push(...newElement.computeChanges(oldElement, params, newElementName))
83
- } else if(JSON.stringify(oldElement) != JSON.stringify(newElement)) {
83
+ } else if(
84
+ JSON.stringify({ ...oldElement, created: undefined })
85
+ != JSON.stringify({ ...newElement, created: undefined })
86
+ ) {
84
87
  let change = {
85
88
  operation: "delete"+elementName,
86
89
  ...params,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/framework",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Live Change Framework - ultimate solution for real time mobile/web apps",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "homepage": "https://github.com/live-change/live-change-framework",
24
24
  "devDependencies": {
25
25
  "@live-change/dao": "0.6.0",
26
- "@live-change/uid": "^0.8.0"
26
+ "@live-change/uid": "^0.8.1"
27
27
  },
28
- "gitHead": "59b8c38965b6b737b6123fdcdf12fd0b5bed164f"
28
+ "gitHead": "d26056b63edb7fecb98c6b9ee14eba859360f900"
29
29
  }