Skip to content

Commit

Permalink
docs: commenting methods
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Sep 26, 2016
1 parent dc17006 commit 0d7848e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/schema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {get, set, each} from "lodash";

// Create a new model by schema default values
module.exports.createDefaultObject = function (schema, obj = {}){
each(schema.fields, (field) => {
if (get(obj, field.model) === undefined && field.default !== undefined)
Expand All @@ -8,6 +9,7 @@ module.exports.createDefaultObject = function (schema, obj = {}){
return obj;
};

// Get a new model which contains only properties of multi-edit fields
module.exports.getMultipleFields = function(schema) {
let res = [];
each(schema.fields, (field) => {
Expand All @@ -18,6 +20,7 @@ module.exports.getMultipleFields = function(schema) {
return res;
};

// Merge many models to one 'work model' by schema
module.exports.mergeMultiObjectFields = function(schema, objs) {
let model = {};

Expand Down

0 comments on commit 0d7848e

Please sign in to comment.