@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 +1 -1
- package/lib/utils/validators.js +5 -3
- package/lib/utils.js +4 -1
- package/package.json +3 -3
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/framework.iml +0 -9
package/LICENSE.md
CHANGED
package/lib/utils/validators.js
CHANGED
|
@@ -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(
|
|
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.
|
|
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.
|
|
26
|
+
"@live-change/uid": "^0.8.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "53b8efc8ec7f5c1c4af33077d8fb4a8a5580f1d9"
|
|
29
29
|
}
|
package/.idea/misc.xml
DELETED
package/.idea/modules.xml
DELETED
package/.idea/vcs.xml
DELETED
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>
|