Skip to content

Commit

Permalink
Fix parsing of schema types.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Dec 15, 2017
1 parent 84f343b commit b9c163c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,24 +524,24 @@ SchemaBuilderEntity.prototype.$parse = function(name, value, required, custom) {
return result;
}

if (['string', 'text'].indexOf(lower) !== -1) {
if ((/^(string|text)+(\(\d+\))?$/).test(lower)) {
result.type = 3;
return parseLength(lower, result);
}

if (lower.indexOf('capitalize') !== -1 || lower.indexOf('camel') !== -1) {
if ((/^(capitalize|camelcase|camelize)+(\(\d+\))?$/).test(lower)) {
result.type = 3;
result.subtype = 'capitalize';
return parseLength(lower, result);
}

if (lower.indexOf('lower') !== -1) {
if ((/^(lower|lowercase)+(\(\d+\))?$/).test(lower)) {
result.subtype = 'lowercase';
result.type = 3;
return parseLength(lower, result);
}

if (lower.indexOf('upper') !== -1) {
if ((/^(upper|uppercase)+(\(\d+\))?$/).test(lower)) {
result.subtype = 'uppercase';
result.type = 3;
return parseLength(lower, result);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"name": "luoage",
"email": "[email protected]"
}],
"version": "2.9.2-7",
"version": "2.9.2-8",
"homepage": "http://www.totaljs.com",
"bugs": {
"url": "https://github.com/totaljs/framework/issues",
Expand Down

0 comments on commit b9c163c

Please sign in to comment.