mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
avoid importing all of lodash to reduce the bundle size
This commit is contained in:
parent
b50fb7b363
commit
149932a6b8
1 changed files with 3 additions and 2 deletions
|
@ -2,7 +2,8 @@
|
|||
* Schema converter/getters
|
||||
*/
|
||||
import Users from 'meteor/vulcan:users';
|
||||
import _ from 'lodash';
|
||||
import _filter from 'lodash/filter';
|
||||
import _keys from 'lodash/keys';
|
||||
|
||||
/* getters */
|
||||
// filter out fields with "." or "$"
|
||||
|
@ -33,7 +34,7 @@ export const getUpdateableFields = schema => {
|
|||
* @param {Object} user – the user for which to check field permissions
|
||||
*/
|
||||
export const getInsertableFields = function(schema, user) {
|
||||
const fields = _.filter(_.keys(schema), function(fieldName) {
|
||||
const fields = _filter(_keys(schema), function(fieldName) {
|
||||
var field = schema[fieldName];
|
||||
return Users.canCreateField(user, field);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue