@live-change/framework
Advanced tools
Comparing version 0.8.115 to 0.8.116
import PropertyDefinition from "./PropertyDefinition.js" | ||
import { crudChanges } from "../utils.js" | ||
import { crudChanges, definitionToJSON } from "../utils.js" | ||
@@ -47,4 +47,5 @@ class ModelDefinition { | ||
} | ||
const fixed = definitionToJSON(this, true) | ||
return { | ||
... this, | ||
...fixed, | ||
properties, | ||
@@ -66,3 +67,3 @@ indexes | ||
if(!oldModel.search && this.search) changes.push({ operation: "searchEnabled", model: this.name }) | ||
if(oldModel.search && this.search && JSON.stringify(oldModel.search) != JSON.stringify(this.search)) | ||
if(oldModel.search && this.search && JSON.stringify(oldModel.search) !== JSON.stringify(this.search)) | ||
changes.push({ operation: "searchUpdated", model: this.name }) | ||
@@ -72,3 +73,3 @@ | ||
const newStorage = this.storage || {} | ||
if(JSON.stringify(oldStorage) != JSON.stringify(newStorage)) { | ||
if(JSON.stringify(oldStorage) !== JSON.stringify(newStorage)) { | ||
changes.push({ operation: "storageChanged", model: this.name, oldStorage, storage: newStorage }) | ||
@@ -75,0 +76,0 @@ for(let indexName in this.indexes) { |
@@ -31,2 +31,17 @@ | ||
export function definitionToJSON(definition, ignoreRoot = false) { | ||
if(!definition) return definition | ||
if(!ignoreRoot) { | ||
if(typeof definition.getTypeName === 'function') | ||
return definition.getTypeName() | ||
if(typeof definition.toJSON === 'function') | ||
return definition.toJSON() | ||
} | ||
if(typeof definition !== 'object') return definition | ||
if(Array.isArray(definition)) return definition.map(definitionToJSON) | ||
return Object.fromEntries(Object.entries(definition).map( | ||
([key, value]) => [key, definitionToJSON(value)]) | ||
) | ||
} | ||
function setDifference(setA, setB) { | ||
@@ -33,0 +48,0 @@ var difference = new Set(setA) |
{ | ||
"name": "@live-change/framework", | ||
"version": "0.8.115", | ||
"version": "0.8.116", | ||
"description": "Live Change Framework - ultimate solution for real time mobile/web apps", | ||
@@ -25,6 +25,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@live-change/dao": "^0.8.115", | ||
"@live-change/uid": "^0.8.115" | ||
"@live-change/dao": "^0.8.116", | ||
"@live-change/uid": "^0.8.116" | ||
}, | ||
"gitHead": "fc360f214e2cd529db9e5795849005a563cb6866" | ||
"gitHead": "32131af3707ec744c9d314035676d09512483799" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188906
5136