Merge branch 'release/1.2.4' into production
This commit is contained in:
commit
3d1b26aad4
|
@ -79,7 +79,7 @@ var modelHelper = module.exports = {
|
||||||
out.type = modelHelper.getPropType(out.type);
|
out.type = modelHelper.getPropType(out.type);
|
||||||
|
|
||||||
if (out.type === 'array') {
|
if (out.type === 'array') {
|
||||||
var hasItemType = typeof prop.type !== 'string' && prop.type.length;
|
var hasItemType = typeof prop.type !== 'string' && prop.type[0];
|
||||||
|
|
||||||
if (hasItemType) {
|
if (hasItemType) {
|
||||||
var arrayProp = prop.type[0];
|
var arrayProp = prop.type[0];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "loopback-explorer",
|
"name": "loopback-explorer",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"description": "Browse and test your LoopBack app's APIs",
|
"description": "Browse and test your LoopBack app's APIs",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -89,6 +89,16 @@ describe('model-helper', function() {
|
||||||
expect(prop).to.eql({ type: 'array' });
|
expect(prop).to.eql({ type: 'array' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('converts [undefined] type', function() {
|
||||||
|
var def = getDefinition({
|
||||||
|
// This value is somehow provided by loopback-boot called from
|
||||||
|
// loopback-workspace.
|
||||||
|
array: [undefined]
|
||||||
|
});
|
||||||
|
var prop = def.properties.array;
|
||||||
|
expect(prop).to.eql({ type: 'array' });
|
||||||
|
});
|
||||||
|
|
||||||
it('converts "array" type', function() {
|
it('converts "array" type', function() {
|
||||||
var def = getDefinition({
|
var def = getDefinition({
|
||||||
array: 'array'
|
array: 'array'
|
||||||
|
|
Loading…
Reference in New Issue