fix merge conflict
This commit is contained in:
commit
d2ef76abb5
|
@ -0,0 +1,3 @@
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "lts/*"
|
15
HISTORY.md
15
HISTORY.md
|
@ -3,6 +3,21 @@
|
||||||
https://github.com/josdejong/jsoneditor
|
https://github.com/josdejong/jsoneditor
|
||||||
|
|
||||||
|
|
||||||
|
## not yet published, version 5.33.0
|
||||||
|
|
||||||
|
- Fixed #697: JSON Schema enum dropdown not working inside an array.
|
||||||
|
- Fixed #698: When using `onCreateMenu`, `node.path` is null when clicking
|
||||||
|
on an append node or when multiple nodes are selected.
|
||||||
|
- Upgraded dependencies to `mobius1-selectr@2.4.10`, `vanilla-picker@2.8.0`.
|
||||||
|
|
||||||
|
|
||||||
|
## 2019-04-27, version 5.32.5
|
||||||
|
|
||||||
|
- Fixed a bug in the JMESPath query wizard which didn't correctly handle
|
||||||
|
selecting multiple fields.
|
||||||
|
- Fixed context menu not working when multiple nodes are selected.
|
||||||
|
|
||||||
|
|
||||||
## 2019-04-10, version 5.32.4
|
## 2019-04-10, version 5.32.4
|
||||||
|
|
||||||
- Fixed #682 and #687: JSONEditor not being able to handle JSON schema
|
- Fixed #682 and #687: JSONEditor not being able to handle JSON schema
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
* Copyright (c) 2011-2019 Jos de Jong, http://jsoneditoronline.org
|
* Copyright (c) 2011-2019 Jos de Jong, http://jsoneditoronline.org
|
||||||
*
|
*
|
||||||
* @author Jos de Jong, <wjosdejong@gmail.com>
|
* @author Jos de Jong, <wjosdejong@gmail.com>
|
||||||
* @version 5.32.4
|
* @version 5.33.0
|
||||||
* @date 2019-04-10
|
* @date 2019-05-29
|
||||||
*/
|
*/
|
||||||
(function webpackUniversalModuleDefinition(root, factory) {
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
if(typeof exports === 'object' && typeof module === 'object')
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
|
@ -3148,8 +3148,16 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.editor.options.onCreateMenu) {
|
if (this.options.onCreateMenu) {
|
||||||
items = this.editor.options.onCreateMenu(items, { path : node.getPath() });
|
var paths = selectedNodes.map(function (node) {
|
||||||
|
return node.getPath();
|
||||||
|
});
|
||||||
|
|
||||||
|
items = this.options.onCreateMenu(items, {
|
||||||
|
type: 'multiple',
|
||||||
|
path: paths[0],
|
||||||
|
paths: paths
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var menu = new ContextMenu(items, {close: onClose});
|
var menu = new ContextMenu(items, {close: onClose});
|
||||||
|
@ -9949,12 +9957,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (childSchema.items && childSchema.items.properties) {
|
|
||||||
childSchema = childSchema.items.properties[key];
|
|
||||||
if (childSchema) {
|
|
||||||
foundSchema = Node._findSchema(childSchema, schemaRefs, nextPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (typeof key === 'string' && childSchema.properties) {
|
else if (typeof key === 'string' && childSchema.properties) {
|
||||||
if (!(key in childSchema.properties)) {
|
if (!(key in childSchema.properties)) {
|
||||||
foundSchema = null;
|
foundSchema = null;
|
||||||
|
@ -11729,7 +11731,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.editor.options.onCreateMenu) {
|
if (this.editor.options.onCreateMenu) {
|
||||||
items = this.editor.options.onCreateMenu(items, { path : node.getPath() });
|
var path = node.getPath();
|
||||||
|
|
||||||
|
items = this.editor.options.onCreateMenu(items, {
|
||||||
|
type: 'single',
|
||||||
|
path: path,
|
||||||
|
paths: [path]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var menu = new ContextMenu(items, {close: onClose});
|
var menu = new ContextMenu(items, {close: onClose});
|
||||||
|
@ -13866,7 +13874,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
];
|
];
|
||||||
|
|
||||||
if (this.editor.options.onCreateMenu) {
|
if (this.editor.options.onCreateMenu) {
|
||||||
items = this.editor.options.onCreateMenu(items, { path : node.getPath() });
|
var path = node.parent.getPath();
|
||||||
|
|
||||||
|
items = this.editor.options.onCreateMenu(items, {
|
||||||
|
type: 'append',
|
||||||
|
path: path,
|
||||||
|
paths: [path]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var menu = new ContextMenu(items, {close: onClose});
|
var menu = new ContextMenu(items, {close: onClose});
|
||||||
|
@ -15048,14 +15062,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
if (values.length === 1) {
|
if (values.length === 1) {
|
||||||
query.value += '.' + selectedValue;
|
query.value += '.' + values[0];
|
||||||
}
|
}
|
||||||
else if (values.length > 1) {
|
else if (values.length > 1) {
|
||||||
query.value += '.{' +
|
query.value += '.{' +
|
||||||
values.map(function (value) {
|
values.map(function (value) {
|
||||||
var parts = value.split('.');
|
var parts = value.split('.');
|
||||||
var last = parts[parts.length - 1];
|
var last = parts[parts.length - 1];
|
||||||
return last + ': ' + selectedValue;
|
return last + ': ' + value;
|
||||||
}).join(', ') +
|
}).join(', ') +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
22
docs/api.md
22
docs/api.md
|
@ -163,14 +163,26 @@ Constructs a new JSONEditor.
|
||||||
|
|
||||||
See also option `schema` for JSON schema validation.
|
See also option `schema` for JSON schema validation.
|
||||||
|
|
||||||
- `{function} onCreateMenu(items,{path})`
|
- `{function} onCreateMenu(items, node)`
|
||||||
|
|
||||||
Customize context menus in tree mode.
|
Customize context menus in tree mode.
|
||||||
|
|
||||||
Sets a callback function to customize the context menu in tree mode. Each time the user clicks on the context menu button, an array of menu items is created. If this callback is set, the array is passed to this function along with an object containing the current path (if any). This function can customize any aspect of these menu items, including deleting them and/or adding new items. Each menu item is represented by an object, which may also contain a submenu array of items. See the source code of example 21 in the examples folder for more info on the format of the items and submenu objects.
|
|
||||||
|
|
||||||
The function should return the final array of menu items to be displayed to the user.
|
|
||||||
|
|
||||||
|
Sets a callback function to customize the context menu in tree mode. Each time the user clicks on the context menu button, an array of menu items is created. If this callback is configured, the array with menu items is passed to this function. The menu items can be customized in this function in any aspect of these menu items, including deleting them and/or adding new items. The function should return the final array of menu items to be displayed to the user.
|
||||||
|
|
||||||
|
Each menu item is represented by an object, which may also contain a submenu array of items. See the source code of example 21 in the examples folder for more info on the format of the items and submenu objects.
|
||||||
|
|
||||||
|
The second argument `node` is an object containing the following properties:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
type: 'single' | 'multiple' | 'append'
|
||||||
|
path: Array,
|
||||||
|
paths: Array with paths
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The property `path` containing the path of the node, and `paths` contains the same path or in case there are multiple selected nodes it contains the paths of all selected nodes.
|
||||||
|
When the user opens the context menu of an append node (in an empty object or array), the `type` will be `'append'` and the `path` will contain the path of the parent node.
|
||||||
|
|
||||||
- `{boolean} escapeUnicode`
|
- `{boolean} escapeUnicode`
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,8 @@
|
||||||
onCreateMenu : function (items, node) {
|
onCreateMenu : function (items, node) {
|
||||||
var path = node.path
|
var path = node.path
|
||||||
|
|
||||||
console.log(items); // log the current items for inspection
|
// log the current items and node for inspection
|
||||||
|
console.log('items:', items, 'node:', node);
|
||||||
|
|
||||||
// We are going to add a menu item which returns the current node path
|
// We are going to add a menu item which returns the current node path
|
||||||
// as a jq path selector ( https://stedolan.github.io/jq/ ). First we
|
// as a jq path selector ( https://stedolan.github.io/jq/ ). First we
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "jsoneditor",
|
"name": "jsoneditor",
|
||||||
"version": "5.32.4",
|
"version": "5.33.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -28,9 +28,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"acorn-globals": {
|
"acorn-globals": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz",
|
||||||
"integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==",
|
"integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"acorn": "^6.0.1",
|
"acorn": "^6.0.1",
|
||||||
|
@ -288,11 +288,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"assert": {
|
"assert": {
|
||||||
"version": "1.4.1",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz",
|
||||||
"integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=",
|
"integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"object-assign": "^4.1.1",
|
||||||
"util": "0.10.3"
|
"util": "0.10.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -302,6 +303,12 @@
|
||||||
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=",
|
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"object-assign": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
|
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"util": {
|
"util": {
|
||||||
"version": "0.10.3",
|
"version": "0.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
|
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
|
||||||
|
@ -344,9 +351,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"async-each": {
|
"async-each": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
|
||||||
"integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==",
|
"integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"async-limiter": {
|
"async-limiter": {
|
||||||
|
@ -640,9 +647,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chokidar": {
|
"chokidar": {
|
||||||
"version": "2.1.5",
|
"version": "2.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz",
|
||||||
"integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==",
|
"integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"anymatch": "^2.0.0",
|
"anymatch": "^2.0.0",
|
||||||
|
@ -729,9 +736,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"cloneable-readable": {
|
"cloneable-readable": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz",
|
||||||
"integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==",
|
"integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"inherits": "^2.0.1",
|
"inherits": "^2.0.1",
|
||||||
|
@ -786,9 +793,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
|
@ -801,9 +808,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"component-emitter": {
|
"component-emitter": {
|
||||||
"version": "1.2.1",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||||
"integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=",
|
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
|
@ -1215,9 +1222,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"es5-ext": {
|
"es5-ext": {
|
||||||
"version": "0.10.49",
|
"version": "0.10.50",
|
||||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.49.tgz",
|
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||||
"integrity": "sha512-3NMEhi57E31qdzmYp2jwRArIUsj1HI/RxbQ4bgnSB+AIKIxsAmTiK83bYMifIcpWvEc3P1X30DhUKOqEtF/kvg==",
|
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"es6-iterator": "~2.0.3",
|
"es6-iterator": "~2.0.3",
|
||||||
|
@ -1583,9 +1590,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fined": {
|
"fined": {
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/fined/-/fined-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
|
||||||
"integrity": "sha512-jQp949ZmEbiYHk3gkbdtpJ0G1+kgtLQBNdP5edFP7Fh+WAYceLQz6yO1SBj72Xkg8GVyTB3bBzAYrHJVh5Xd5g==",
|
"integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"expand-tilde": "^2.0.2",
|
"expand-tilde": "^2.0.2",
|
||||||
|
@ -1669,14 +1676,14 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"fsevents": {
|
"fsevents": {
|
||||||
"version": "1.2.7",
|
"version": "1.2.9",
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
|
||||||
"integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==",
|
"integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"nan": "^2.9.2",
|
"nan": "^2.12.1",
|
||||||
"node-pre-gyp": "^0.10.0"
|
"node-pre-gyp": "^0.12.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"abbrev": {
|
"abbrev": {
|
||||||
|
@ -1754,12 +1761,12 @@
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "2.6.9",
|
"version": "4.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.0.0"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deep-extend": {
|
"deep-extend": {
|
||||||
|
@ -1930,24 +1937,24 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.0.0",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"needle": {
|
"needle": {
|
||||||
"version": "2.2.4",
|
"version": "2.3.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "^2.1.2",
|
"debug": "^4.1.0",
|
||||||
"iconv-lite": "^0.4.4",
|
"iconv-lite": "^0.4.4",
|
||||||
"sax": "^1.2.4"
|
"sax": "^1.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node-pre-gyp": {
|
"node-pre-gyp": {
|
||||||
"version": "0.10.3",
|
"version": "0.12.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -1975,13 +1982,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npm-bundled": {
|
"npm-bundled": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"npm-packlist": {
|
"npm-packlist": {
|
||||||
"version": "1.2.0",
|
"version": "1.4.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -2120,7 +2127,7 @@
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.6.0",
|
"version": "5.7.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
|
@ -2254,9 +2261,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.1.3",
|
"version": "7.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
|
||||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"fs.realpath": "^1.0.0",
|
"fs.realpath": "^1.0.0",
|
||||||
|
@ -2441,9 +2448,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"gulp-cli": {
|
"gulp-cli": {
|
||||||
"version": "2.1.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz",
|
||||||
"integrity": "sha512-txzgdFVlEPShBZus6JJyGyKJoBVDq6Do0ZQgIgx5RAsmhNVTDjymmOxpQvo3c20m66FldilS68ZXj2Q9w5dKbA==",
|
"integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-colors": "^1.0.1",
|
"ansi-colors": "^1.0.1",
|
||||||
|
@ -3606,18 +3613,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mime-db": {
|
"mime-db": {
|
||||||
"version": "1.38.0",
|
"version": "1.40.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
|
||||||
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==",
|
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mime-types": {
|
"mime-types": {
|
||||||
"version": "2.1.22",
|
"version": "2.1.24",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
|
||||||
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
|
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"mime-db": "~1.38.0"
|
"mime-db": "1.40.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
|
@ -3674,9 +3681,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mobius1-selectr": {
|
"mobius1-selectr": {
|
||||||
"version": "2.4.2",
|
"version": "2.4.10",
|
||||||
"resolved": "https://registry.npmjs.org/mobius1-selectr/-/mobius1-selectr-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/mobius1-selectr/-/mobius1-selectr-2.4.10.tgz",
|
||||||
"integrity": "sha512-yfy1sLxIDlgZjhThuG6gBsI4L2pJHRNaHth/hwPN5ESH5n2qkhfay/OnVmwhhDVYeui54NKIWeu6zWcobVcYtQ=="
|
"integrity": "sha512-U/pQ8jZwO7z3Mf9OYzJR6AKfleF5jSBIueKKxGMr/tgyLuTWgchgFyeaXpAIz3Cbp+7eIN1hw5D2gxc4cNnOkQ=="
|
||||||
},
|
},
|
||||||
"mocha": {
|
"mocha": {
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
|
@ -3753,9 +3760,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"nan": {
|
"nan": {
|
||||||
"version": "2.13.2",
|
"version": "2.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz",
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||||
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
|
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
@ -3869,9 +3876,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"now-and-later": {
|
"now-and-later": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz",
|
||||||
"integrity": "sha1-vGHLtFbXnLMiB85HygUTb/Ln1u4=",
|
"integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"once": "^1.3.2"
|
"once": "^1.3.2"
|
||||||
|
@ -3884,9 +3891,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"nwsapi": {
|
"nwsapi": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz",
|
||||||
"integrity": "sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A==",
|
"integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"oauth-sign": {
|
"oauth-sign": {
|
||||||
|
@ -3933,9 +3940,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"object-keys": {
|
"object-keys": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
||||||
"integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==",
|
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"object-visit": {
|
"object-visit": {
|
||||||
|
@ -4326,9 +4333,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"psl": {
|
"psl": {
|
||||||
"version": "1.1.31",
|
"version": "1.1.32",
|
||||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
|
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
|
||||||
"integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==",
|
"integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"pump": {
|
"pump": {
|
||||||
|
@ -4613,9 +4620,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.10.0",
|
"version": "1.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
|
||||||
"integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
|
"integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"path-parse": "^1.0.6"
|
"path-parse": "^1.0.6"
|
||||||
|
@ -4972,9 +4979,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spdx-license-ids": {
|
"spdx-license-ids": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz",
|
||||||
"integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==",
|
"integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"split-string": {
|
"split-string": {
|
||||||
|
@ -5362,9 +5369,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"undertaker": {
|
"undertaker": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz",
|
||||||
"integrity": "sha1-M52kZGJS0ILcN45wgGcpl1DhG0k=",
|
"integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"arr-flatten": "^1.0.1",
|
"arr-flatten": "^1.0.1",
|
||||||
|
@ -5545,9 +5552,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"v8flags": {
|
"v8flags": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz",
|
||||||
"integrity": "sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw==",
|
"integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"homedir-polyfill": "^1.0.1"
|
"homedir-polyfill": "^1.0.1"
|
||||||
|
@ -5570,11 +5577,11 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"vanilla-picker": {
|
"vanilla-picker": {
|
||||||
"version": "2.4.2",
|
"version": "2.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/vanilla-picker/-/vanilla-picker-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/vanilla-picker/-/vanilla-picker-2.8.0.tgz",
|
||||||
"integrity": "sha512-fAjOGwruYIrRSWtMfriwE2zya2IDHcI7ncundd1NWh/Py3WzuNIAcj6dwaoG7f72ZT9YHRCAfy84f0BoJb0tyA==",
|
"integrity": "sha512-NPBxrtLi2LA2mEyRLW+Lyt7Eqtm0t0SmKqscE5RaugXLtJXXjPzy6r65fqLiQkhRc2WoLnmj2m/EnTWKN4hL+g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@sphinxxxx/color-conversion": "^2.1.1",
|
"@sphinxxxx/color-conversion": "^2.2.1",
|
||||||
"drag-tracker": "^1.0.0"
|
"drag-tracker": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "jsoneditor",
|
"name": "jsoneditor",
|
||||||
"version": "5.32.4",
|
"version": "5.33.0",
|
||||||
"main": "./index",
|
"main": "./index",
|
||||||
"description": "A web-based tool to view, edit, format, and validate JSON",
|
"description": "A web-based tool to view, edit, format, and validate JSON",
|
||||||
"tags": [
|
"tags": [
|
||||||
|
@ -28,9 +28,9 @@
|
||||||
"javascript-natural-sort": "0.7.1",
|
"javascript-natural-sort": "0.7.1",
|
||||||
"jmespath": "0.15.0",
|
"jmespath": "0.15.0",
|
||||||
"json-source-map": "0.4.0",
|
"json-source-map": "0.4.0",
|
||||||
"mobius1-selectr": "2.4.2",
|
"mobius1-selectr": "2.4.10",
|
||||||
"picomodal": "3.0.0",
|
"picomodal": "3.0.0",
|
||||||
"vanilla-picker": "2.4.2"
|
"vanilla-picker": "2.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "4.0.0",
|
"gulp": "4.0.0",
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
"gulp-concat-css": "2.3.0",
|
"gulp-concat-css": "2.3.0",
|
||||||
"gulp-shell": "0.6.3",
|
"gulp-shell": "0.6.3",
|
||||||
"gulp-util": "3.0.8",
|
"gulp-util": "3.0.8",
|
||||||
"jsdom": "^13.2.0",
|
"jsdom": "13.2.0",
|
||||||
"json-loader": "0.5.7",
|
"json-loader": "0.5.7",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"mocha": "5.2.0",
|
"mocha": "5.2.0",
|
||||||
|
|
|
@ -2659,12 +2659,6 @@ Node._findSchema = function (schema, schemaRefs, path) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (childSchema.items && childSchema.items.properties) {
|
|
||||||
childSchema = childSchema.items.properties[key];
|
|
||||||
if (childSchema) {
|
|
||||||
foundSchema = Node._findSchema(childSchema, schemaRefs, nextPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (typeof key === 'string' && childSchema.properties) {
|
else if (typeof key === 'string' && childSchema.properties) {
|
||||||
if (!(key in childSchema.properties)) {
|
if (!(key in childSchema.properties)) {
|
||||||
foundSchema = null;
|
foundSchema = null;
|
||||||
|
@ -4439,7 +4433,13 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.editor.options.onCreateMenu) {
|
if (this.editor.options.onCreateMenu) {
|
||||||
items = this.editor.options.onCreateMenu(items, { path : node.getPath() });
|
var path = node.getPath();
|
||||||
|
|
||||||
|
items = this.editor.options.onCreateMenu(items, {
|
||||||
|
type: 'single',
|
||||||
|
path: path,
|
||||||
|
paths: [path]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var menu = new ContextMenu(items, {close: onClose});
|
var menu = new ContextMenu(items, {close: onClose});
|
||||||
|
|
|
@ -202,7 +202,13 @@ function appendNodeFactory(Node) {
|
||||||
];
|
];
|
||||||
|
|
||||||
if (this.editor.options.onCreateMenu) {
|
if (this.editor.options.onCreateMenu) {
|
||||||
items = this.editor.options.onCreateMenu(items, { path : node.getPath() });
|
var path = node.parent.getPath();
|
||||||
|
|
||||||
|
items = this.editor.options.onCreateMenu(items, {
|
||||||
|
type: 'append',
|
||||||
|
path: path,
|
||||||
|
paths: [path]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var menu = new ContextMenu(items, {close: onClose});
|
var menu = new ContextMenu(items, {close: onClose});
|
||||||
|
|
|
@ -233,14 +233,14 @@ function showTransformModal (node, container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (values.length === 1) {
|
if (values.length === 1) {
|
||||||
query.value += '.' + selectedValue;
|
query.value += '.' + values[0];
|
||||||
}
|
}
|
||||||
else if (values.length > 1) {
|
else if (values.length > 1) {
|
||||||
query.value += '.{' +
|
query.value += '.{' +
|
||||||
values.map(function (value) {
|
values.map(function (value) {
|
||||||
var parts = value.split('.');
|
var parts = value.split('.');
|
||||||
var last = parts[parts.length - 1];
|
var last = parts[parts.length - 1];
|
||||||
return last + ': ' + selectedValue;
|
return last + ': ' + value;
|
||||||
}).join(', ') +
|
}).join(', ') +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1685,8 +1685,16 @@ treemode.showContextMenu = function (anchor, onClose) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.editor.options.onCreateMenu) {
|
if (this.options.onCreateMenu) {
|
||||||
items = this.editor.options.onCreateMenu(items, { path : node.getPath() });
|
var paths = selectedNodes.map(function (node) {
|
||||||
|
return node.getPath();
|
||||||
|
});
|
||||||
|
|
||||||
|
items = this.options.onCreateMenu(items, {
|
||||||
|
type: 'multiple',
|
||||||
|
path: paths[0],
|
||||||
|
paths: paths
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var menu = new ContextMenu(items, {close: onClose});
|
var menu = new ContextMenu(items, {close: onClose});
|
||||||
|
|
|
@ -27,6 +27,34 @@ describe('Node', function () {
|
||||||
assert.strictEqual(Node._findSchema(schema, {}, path), schema.properties.child);
|
assert.strictEqual(Node._findSchema(schema, {}, path), schema.properties.child);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should find schema inside an array item', function () {
|
||||||
|
var schema = {
|
||||||
|
properties: {
|
||||||
|
job: {
|
||||||
|
type: 'array',
|
||||||
|
items: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
company: {
|
||||||
|
enum: ['test1', 'test2']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.strictEqual(Node._findSchema(schema, {}, []), schema);
|
||||||
|
|
||||||
|
assert.strictEqual(Node._findSchema(schema, {}, ['job']), schema.properties.job);
|
||||||
|
|
||||||
|
assert.strictEqual(Node._findSchema(schema, {}, ['job', 0]),
|
||||||
|
schema.properties.job.items);
|
||||||
|
|
||||||
|
assert.strictEqual(Node._findSchema(schema, {}, ['job', 0, 'company']),
|
||||||
|
schema.properties.job.items.properties.company);
|
||||||
|
});
|
||||||
|
|
||||||
it('should find schema within multi-level object properties', function () {
|
it('should find schema within multi-level object properties', function () {
|
||||||
var schema = {
|
var schema = {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
|
Loading…
Reference in New Issue