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);
|
||||
|
||||
if (out.type === 'array') {
|
||||
var hasItemType = typeof prop.type !== 'string' && prop.type.length;
|
||||
var hasItemType = typeof prop.type !== 'string' && prop.type[0];
|
||||
|
||||
if (hasItemType) {
|
||||
var arrayProp = prop.type[0];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-explorer",
|
||||
"version": "1.2.3",
|
||||
"version": "1.2.4",
|
||||
"description": "Browse and test your LoopBack app's APIs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -89,6 +89,16 @@ describe('model-helper', function() {
|
|||
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() {
|
||||
var def = getDefinition({
|
||||
array: 'array'
|
||||
|
|
Loading…
Reference in New Issue