Skip to content

Commit 4baf89e

Browse files
committed
rebuild
1 parent afcb48b commit 4baf89e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/object.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ var isRecursive = function isRecursive(schema) {
2222
return (schema._subType || schema) === '$this';
2323
};
2424

25+
c.type('altCamel', function (str) {
26+
var result = c.camel(str),
27+
idx = str.search(/[^_]/);
28+
29+
return idx === 0 ? result : str.substr(0, idx) + result;
30+
});
31+
2532
var childSchema = function childSchema(field, parent) {
2633
return isRecursive(field) ? field.of ? field.of(parent) : parent : field;
2734
};
@@ -217,7 +224,7 @@ inherits(ObjectSchema, MixedSchema, {
217224
camelcase: function camelcase() {
218225
return this.transform(function (obj) {
219226
return obj == null ? obj : transform(obj, function (newobj, val, key) {
220-
return newobj[c.camel(key)] = val;
227+
return newobj[c.altCamel(key)] = val;
221228
});
222229
});
223230
},

0 commit comments

Comments
 (0)