Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,15 @@ function convert(rule, obj, key, defaultConvert) {
if (!convertType) return;

const value = obj[key];
// convert type only work for primitive data
if (typeof value === 'object') return;


// if set convertType function it should be support convert object
// convertType support function
if (typeof convertType === 'function') {
obj[key] = convertType(value, obj);
return;
}else{
// default convert type only work for primitive data
if (typeof value === 'object') return;
}

switch (convertType) {
Expand Down