alaska-field-select
Advanced tools
Comparing version 0.1.0 to 0.2.0
17
index.js
@@ -31,3 +31,18 @@ /** | ||
exports.initSchema = function (field, schema, Model) { | ||
schema.path(field.path, field.number ? Number : String); | ||
let options = { | ||
type: field.number ? Number : field.boolean ? Boolean : String | ||
}; | ||
[ | ||
'get', | ||
'set', | ||
'default', | ||
'index', | ||
'select' | ||
].forEach(function (key) { | ||
if (field[key] !== undefined) { | ||
options[key] = field[key]; | ||
} | ||
}); | ||
schema.path(field.path, options); | ||
}; | ||
@@ -34,0 +49,0 @@ |
{ | ||
"name": "alaska-field-select", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Alaska select field", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
18120
273