Commit e91df8e00ca174250db3f719cc4bbf9a3b54b07c
Uses lodash.clonedeep to avoid modifying schema.
Piet Geursen committed on 3/6/2018, 2:02:05 AMParent: 91884c77ace6b192aab48201e2d99e3ae110d162
Files changed
package-lock.json | changed |
package.json | changed |
poll/schema/chooseOnePoll.js | changed |
package-lock.json | ||
---|---|---|
@@ -302,8 +302,13 @@ | ||
302 | 302 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", |
303 | 303 | "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", |
304 | 304 | "dev": true |
305 | 305 | }, |
306 | + "lodash.clonedeep": { | |
307 | + "version": "4.5.0", | |
308 | + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", | |
309 | + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" | |
310 | + }, | |
306 | 311 | "lodash.merge": { |
307 | 312 | "version": "4.6.1", |
308 | 313 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", |
309 | 314 | "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" |
package.json | ||
---|---|---|
@@ -29,9 +29,9 @@ | ||
29 | 29 | }, |
30 | 30 | "dependencies": { |
31 | 31 | "is-my-json-valid": "^2.17.1", |
32 | 32 | "libnested": "^1.2.1", |
33 | - "lodash.merge": "^4.6.1", | |
33 | + "lodash.clonedeep": "^4.5.0", | |
34 | 34 | "ssb-msg-schemas": "^6.3.0", |
35 | 35 | "ssb-ref": "^2.9.0" |
36 | 36 | } |
37 | 37 | } |
poll/schema/chooseOnePoll.js | ||
---|---|---|
@@ -1,7 +1,8 @@ | ||
1 | 1 | const pollSchema = require('./poll') |
2 | +const cloneDeep = require('lodash.clonedeep') | |
2 | 3 | |
3 | -const chooseOneSchema = Object.assign({}, pollSchema) | |
4 | +const chooseOneSchema = cloneDeep(pollSchema) | |
4 | 5 | |
5 | 6 | // collapse the details down to be ONLY chooseOne |
6 | 7 | chooseOneSchema.properties.pollDetails = { $ref: '#/definitions/pollDetails/chooseOne' } |
7 | 8 |
Built with git-ssb-web