@live-change/framework 0.8.0 → 0.8.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/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2019-2022 Michał Łaszczewski
1
+ Copyright 2019-2024 Michał Łaszczewski
2
2
 
3
3
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
4
 
@@ -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.2",
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.2"
27
27
  },
28
- "gitHead": "59b8c38965b6b737b6123fdcdf12fd0b5bed164f"
28
+ "gitHead": "53b8efc8ec7f5c1c4af33077d8fb4a8a5580f1d9"
29
29
  }
package/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/framework.iml" filepath="$PROJECT_DIR$/framework.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
package/framework.iml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>