Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Feb 8, 2016
1 parent afcb48b commit 4baf89e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ var isRecursive = function isRecursive(schema) {
return (schema._subType || schema) === '$this';
};

c.type('altCamel', function (str) {
var result = c.camel(str),
idx = str.search(/[^_]/);

return idx === 0 ? result : str.substr(0, idx) + result;
});

var childSchema = function childSchema(field, parent) {
return isRecursive(field) ? field.of ? field.of(parent) : parent : field;
};
Expand Down Expand Up @@ -217,7 +224,7 @@ inherits(ObjectSchema, MixedSchema, {
camelcase: function camelcase() {
return this.transform(function (obj) {
return obj == null ? obj : transform(obj, function (newobj, val, key) {
return newobj[c.camel(key)] = val;
return newobj[c.altCamel(key)] = val;
});
});
},
Expand Down

0 comments on commit 4baf89e

Please sign in to comment.