miolo-model 3.0.0-beta.178 → 3.0.0-beta.179

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/MioloModel.mjs +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miolo-model",
3
- "version": "3.0.0-beta.178",
3
+ "version": "3.0.0-beta.179",
4
4
  "description": "Data models for miolo world",
5
5
  "author": "Donato Lorenzo <donato@afialapis.com>",
6
6
  "contributors": [
@@ -106,4 +106,15 @@ export default class MioloModel extends CacheMixin() {
106
106
  }
107
107
  }
108
108
  }
109
+
110
+ clone() {
111
+ const currentData = this.getData()
112
+ const clonedData = JSON.parse(JSON.stringify(currentData))
113
+
114
+ const clone = new this.constructor(clonedData)
115
+
116
+ Object.assign(clone, this)
117
+
118
+ return clone
119
+ }
109
120
  }