trueValue
, falseValue
of keyIn
accept function
This commit is contained in:
parent
57758fa427
commit
e952a7b089
1 changed files with 4 additions and 7 deletions
|
@ -811,16 +811,13 @@ exports.keyIn = function(query, options) {
|
|||
readOptions.limit = readOptions.limitSrc.join('').replace(/[^A-Za-z0-9_ ]/g, '\\$&');
|
||||
|
||||
['trueValue', 'falseValue'].forEach(function(optionName) {
|
||||
var comps = [];
|
||||
readOptions[optionName].forEach(function(comp) {
|
||||
readOptions[optionName] = readOptions[optionName].reduce(function(comps, comp) {
|
||||
var type = typeof comp;
|
||||
if (type === 'string' || type === 'number') {
|
||||
comps = comps.concat((comp + '').split(''));
|
||||
} else if (comp instanceof RegExp) {
|
||||
comps.push(comp);
|
||||
}
|
||||
});
|
||||
readOptions[optionName] = comps;
|
||||
} else { comps.push(comp); }
|
||||
return comps;
|
||||
}, []);
|
||||
});
|
||||
|
||||
readOptions.display = replacePlaceholder(readOptions.display + '',
|
||||
|
|
Loading…
Reference in a new issue